What Your Database Actually Promises: Isolation & Consistency
CAP, isolation levels, and locking strategies as the documentation actually defines them. Covers why partition tolerance is never optional, what PostgreSQL's default Read Committed really lets through, why snapshot isolation permits write skew, how linearizability and serializability differ, and when to reach for SELECT ... FOR UPDATE, an advisory lock, or an optimistic version column.
Questions
- Not answered. In the Gilbert-Lynch formulation of CAP, why is "just don't tolerate partitions" not an available design option?
- Not answered. Does the C in CAP mean the same thing as the C in ACID?
- Not answered. What does the ELC half of Abadi's PACELC add to the picture that CAP leaves out?
- Not answered. How do linearizability and serializability differ as correctness properties?
- Not answered. When a distributed database's marketing page promises "strong consistency," which formal property does it almost always mean?
- Not answered. What does strict serializability guarantee that plain serializability does not?
- Not answered. Herlihy and Wing proved that linearizability is a local (composable) property. What does that buy you, and does serializability share it?
- Not answered. A read-only transaction at
SERIALIZABLEreturns data you know is out of date. Has the database violated serializability? - Not answered. Bailis et al. asked which isolation levels a system can provide while remaining available during a partition. Which of these made the cut?
- Not answered. For a system that must stay available under arbitrary partitions and converge, what is the strongest consistency model it can offer?
- Not answered. Which transaction isolation level does a stock PostgreSQL server use when you
BEGINwithout specifying one? - Not answered. PostgreSQL accepts all four SQL-standard isolation level names, but how many behaviourally distinct levels does it actually implement?
- Not answered. At
READ COMMITTED, when is the snapshot that a query sees actually taken? - Not answered. What does the concurrent
DELETEdo, and why? - Not answered. Two sessions concurrently run
UPDATE accounts SET balance = balance - 100 WHERE id = 1atREAD COMMITTED. Is one of the deductions lost? - Not answered. Both transactions commit successfully. What is the final
balance, and what is this anomaly called? - Not answered. Which of these anomalies does PostgreSQL's
REPEATABLE READprevent? - Not answered. Which five-character SQLSTATE code does PostgreSQL return when a transaction must be rolled back and retried because of a serialization failure?
- Not answered. PostgreSQL aborts your transaction with SQLSTATE
40P01. What happened, and what should the client do? - Not answered. Both transactions commit and nobody is left on call. Why did snapshot isolation allow it?
- Not answered. Snapshot isolation's first-committer-wins rule is described as its conflict detector. What class of conflict is it structurally unable to see?
- Not answered. PostgreSQL's Serializable Snapshot Isolation aborts a transaction when it spots a "dangerous structure." What is that structure?
- Not answered. Your reporting job runs at
SERIALIZABLE, but the writer that updates the same rows runs at the default level. Is the reporting job still protected from serialization anomalies? - Not answered. How does SSI's approach to serializability differ from classic two-phase locking?
- Not answered. At
READ COMMITTED, aSELECT ... FOR UPDATEblocks on a row another transaction is updating. When that transaction commits, what does your query return? - Not answered. Why does
SELECT ... FOR UPDATEfail to prevent this double booking? - Not answered. What is the practical difference between
pg_advisory_lock(key)andpg_advisory_xact_lock(key)? - Not answered. Which PostgreSQL function takes an exclusive advisory lock that is released automatically when the transaction ends?
- Not answered. At
READ COMMITTED, why does a version-columnUPDATEreliably detect a concurrent modification, even though the transaction read the row minutes earlier? - Not answered. Which locking clause should a
SELECTuse so that concurrent plainUPDATEs to a row's non-key columns are still allowed, whileDELETEs and key changes are blocked? - Not answered. Which of these approaches, applied correctly, actually prevent the double booking?
- Not answered. Oracle's
SERIALIZABLEisolation level: what does it actually implement? - Not answered. Which isolation level does MySQL's InnoDB engine use by default?
- Not answered. In the Adya-style anomaly taxonomy that Jepsen's Elle checker uses, what does G1a describe?
- Not answered. You have set every transaction to
SERIALIZABLEand added retry loops. Which class of bug does this still leave completely untouched?