Transactions

Top  Previous  Next

The nature of the RESTful API is that resource representations are fetched updated and then sent back to the server for it to update the underlying data store. For small updates, such as changing a topic label, adding a single subject identifier, this approach works fine. However, for updates to more than one resource, e.g. creating two topics and an association between them, the inability to do all of this in a single transactional way could be a problem.

 

The Web3 Platform supports the notion of transactions. Transactions have a representation that describes a set of operations that should be performed. Each topic map has a collection of Jobs that should be executed. To execute a transaction a Transaction Job is first created and then the transaction data is uploaded to the new job. Background job processing services process the transaction and set the job status to completed when done. This means that all transaction processing happens asynchronously. If more than one Web3 node is installed then they will share the work of processing transactions.

 

The .NET client API abstracts away the complexity of creating Jobs, posting transactions and waiting for the transaction processing to complete.