Chris Collins

Tagged “mvcc”

Exploration ·

How a database survives a crash

Pull the plug on a database halfway through a write and it comes back with every committed transaction and none of the half-finished ones. How? Follow a write through the log, the buffer pool and the disk, compare B+trees with LSM-trees, watch compaction, and then see the other half of the promise — what concurrent transactions are allowed to see — with real PostgreSQL and SQLite running between the paragraphs.

Data and event platformsSoftware engineering

Tool ·

Offline-first sync and replication

How offline-first apps sync, animated: CouchDB/PouchDB-style replication between a phone, a laptop and a server that go offline — revision trees, the changes feed, checkpoints, _revs_diff and _bulk_docs, conflicts and the deterministic winning revision, three ways to resolve them, compaction and _revs_limit's false conflicts — against a Firestore-style single-leader cache with pending writes, server timestamps and rolled-back writes.

Data and event platforms

Tool ·

Isolation lab

Two or three SQL sessions side by side: step through an interleaving and watch what PostgreSQL or MySQL InnoDB does at each isolation level — results, which statement blocks on which lock, deadlocks, serialization failures (40001 / 40P01) and the final table — with the classic anomalies, their fixes and the Hermitage tests built in, or the same steps on a real Postgres server.

Data and event platforms