Isolation Levels and Anomalies
Let's see a list of Isolation levels and a detailed explanation of anomalies that may occur in distributed systems due to inherent concurrency.
We'll cover the following...
The inherent concurrency in distributed systems creates the potential for anomalies and unexpected behaviors. Specifically, transactions that comprise multiple operations and run concurrently can lead to different results depending on how their operations are interleaved.
As a result, there is still a need for some formal models that define what is possible and what is not in a system’s behavior. These are called isolation levels.
We will study the most common ones here, which are the following:
-
Serializability: It essentially states that two transactions, when executed concurrently, should give the same result as though executed sequentially.
-
Repeatable read: It ensures that the data once read by a transaction will not change throughout its course.
-
Snapshot isolation: It guarantees that all reads made in a transaction will see a consistent snapshot of the database from the point it started, and the transaction will successfully commit if no other transaction has updated the same data since that snapshot.
-
Read committed: It does not allow transactions to read data that has not yet been committed by another transaction.
-
Read uncommitted: It is the lowest isolation level and allows the transaction to read uncommitted data by other transactions.
Unlike the consistency models presented in the Consistency Models lesson, some of these isolation levels do not define what is possible via some formal specification. Instead, they define what is not possible, i.e., which anomalies of the already known ones are prevented.
Of course, stronger isolation levels prevent more anomalies at the cost of performance. Let’s first have a look at the possible anomalies before examining the various levels.
The origin of the isolation levels above and the associated anomalies was essentially the ...