11 Ekim 2021 Pazartesi

ACID - Isolation - Transaction'ların Birbirlerini Etkilememesi

Isolation Nedir
Transaction'ların birbirlerini etkilememesi anlamına gelir. Designing Data Intensive Applications kitabındaki açıklama şöyle.
Most databases are accessed by several clients at the same time. That is no problem if they are reading and writing different parts of the database, but if they are accessing the same database records, you can run into concurrency problems (race conditions).
...
Isolation in the sense of ACID means that concurrently executing transactions are isolated from each other: they cannot step on each other’s toes. The classic database textbooks formalize isolation as serializability, which means that each transaction can pretend that it is the only transaction running on the entire database. The database ensures that when the transactions have committed, the result is the same as if they had run serially (one after another), even though in reality they may have run concurrently.

However, in practice, serializable isolation is rarely used, because it carries a performance penalty. Some popular databases, such as Oracle 11g, don’t even implement it. In Oracle there is an isolation level called “serializable,” but it actually implements something called snapshot isolation, which is a weaker guarantee than serializability
Isolation Seviyeleri Nedir
ACID içindeki isolation seviyesi ve performans arasında bir seçim yapmak gerekiyor. Bu yüzden veri tabanları isolation seviyesini kontrol edebilmek için imkan tanıyorlar.
Seviyeler en güçlüden en zayıfa doğru şöyle
- Serializable
- Repeatable Read
- Read Committed
- Read Uncommitted
- Oracle default isolation level olarak "Read Committed" kullanıyor. SQL Server da aynı seviyeyi kullanıyor. Bu seviyede her iki veri tabanı için Non-Repeatable Read ve Phantom Read hataları olabilir.

- InnoDB ise ise default isolation level olarak repeatable read seviyesini kullanıyor. Bu seviyede nonrepeatable read hatası olmazken phantom read hataları halen olabiliyor.

Isolation Level ve Çözdükleri Problemler (Anomaly)
Şeklen şöyle. Burada Snapshot diye SQL Server'a özel bir isolation level daha gösteriliyor.


Read Committed Seviyesi Nedir?
Read Committed Nedir yazısına taşıdım.

Repeatable Read Seviyesi Nedir ?
Repeatable Read Nedir yazısına taşıdım.

Serializable Seviyesi Nedir ?
Serializable Nedir? yazısına taşıdım.

Ayrıca anomaliler için 
Lost Update Problem
Phantom Read

yazılarına bakabilirsiniz.












Hiç yorum yok:

Yorum Gönder