Isolation, in the context of databases, specifies when and how the changes implemented in an operation become visible to other parallel operations. Transaction isolation is an important part of any transactional system. It deals with consistency and completeness of data retrieved by queries unaffecting a user data by other user actions. A database acquires locks on data to maintain a high level of isolation.
A number of isolation levels are defined to control degree of data locking. A high level of isolation might result in locking overhead for the system creating deadlocks. The four major isolation levels are:
Anomalies permitted by snapshot isolations may lead to violation of data consistency by interleaving transactions which maintain consistency. These anomalies can be eliminated by introducing update conflicts or artificial locking. All databases permit users to set their default isolation levels. Perfect isolation levels chosen prevent applications from introducing errors such as dirty reads, repeatable reads and phantom reads. When the first transaction reads uncommitted changes made by the second transaction, it gives rise to dirty reads. When a data read remains the same if read again during the same transaction, it is a repeatable read. Phantom reads occur when new records added are pointed out by transactions prior to insert. The different database locks isolation levels deal with are:
Read More ยป
Get Techopedia delivered to your inbox!