A transaction must have four properties, which are known from their initials as the ACID properties. These four requirements are:
Atomicity dictates that a transaction must execute completely, or not at all. If the process breaks down in the middle, based on atomicity, everything that occurred before the breakdown should be rolled back. So in the example above, our customer wouldn't lose his money.
Consistency dictates that the persistent state reflects that which the business rules had intended. In other words, the transaction must not break any rules laid down in the environment by the business rules. That means in our above example, that once the transaction occurred, there should be goods sent to the customer, and money removed from his account. We wouldn't expect goods to be sent to anyone else.
Isolation refers to how concurrent transactions are not aware of what each other is doing. The end point of the transaction would be the same no matter what the outcome of the individual transactions. In the above example, imagine if another customer was also purchasing something from our site at the same time. The two transactions would be unaware of each other, but would still successfully result in two orders being dispatched, and a set of funds being removed from both customers' accounts.
Durability states that when updates have occurred to a resource, only then should the client be notified that a transaction has occurred. If the system failed for any reason after the notification, then the changes would still be reflected once the system was restarted. This allows the user to know that a transaction has been successfully completed even if there is an error later. So relating to the above example, our customer would not think that the money had been transferred when in fact it hadn't.
Was this article helpful?