Properties of the Distributed Transactions
The distributed transactions must possess the following ACID properties, like any other transaction. In distributed systems, a transaction manager is used to coordinate the distinct operations and then commit/rollback the transaction as needed.
- Atomicity: All data changes are treated as if they were a single operation. That is, either all of the modifications are made, or none of them are made. The atomicity feature assures that if a debit is successfully made from one account, the matching credit is made to the other account in an application that transfers money from one account to another.
- Consistency: This property implies that when a transaction begins and ends, the state of data is consistent. For example, it ensures that the value remains consistent at the start and end of a transaction in an application that transfers funds from one account to another.
- Isolation: In this property, concurrently running transactions appear to be serialized. For example, the isolation property assures that the transferred funds between two accounts can be seen by another transaction in either one of the accounts, but not both, or neither.
- Durability: Changes to data persist when a transaction completes successfully and are not undone, even if the system fails. It assures that modifications made to each account will not be reversed in an application that transfers money from one account to another.
Coordination in Distributed Transactions
At the time of coordination in Distributed Transactions, one of the servers becomes a coordinator, and the rest of the workers become coordinators.
- In a simple transaction, the first server acts as the Coordinator.
- In the nested transaction, the top-level server acts as the Coordinator.
- Role of Coordinator: The coordinator keeps track of participating servers, gathers results from workers, and makes a decision to ensure transaction consistency.
- Role of Workers: Workers are aware of the coordinatorâs existence and in addition, communicate their outcome to the coordinator and then follow the coordinatorâs decision.
Atomic Commit Protocol in Distributed System
In distributed systems, transactional consistency is guaranteed by the Atomic Commit Protocol. It coordinates two phasesâvoting and decisionâto ensure that a transaction is either fully committed or completely canceled on several nodes.
Contact Us