The Write Last, Read First Rule
When an application spans two stores without a shared transaction boundary, such as Postgres for account master data and TigerBeetle for the ledger, one must be designated the system of record and the other the system of reference. Writes go to the system of reference first and the system of record last, and existence checks read the system of record first. This keeps the system traceable: no funded ledger account ever lacks an owner record, even if it is temporarily inconsistent. The approach is implemented with Resonate's durable execution (Distributed Async Await) and idempotent per-store create functions. A result matrix classifies outcomes as success, recovery, conflict or ordering violation, and the application panics to alert an operator on violations.
Related posts
- RAMP-TAO: Layering atomic transactions on Facebook’s online graph store
Meta Engineering hardMasterRAMP-TAO is a protocol that layers read-atomic transactional guarantees on top of TAO, Facebook's eventually consistent social graph store, so developers get an intuitive read transaction API without handling fractured-read anomalies. Adapted from Read Atomic Multi-Partition (RAMP) protocols in a "bolt-on" style, it guards only recent, transactionally updated data and relies on eventual consistency for everything else, so non-transactional workloads pay no cost. Production feasibility results show 0.42% memory overhead, over 99.9% of reads completing in one round-trip to the local cache, and tail latency on par with existing TAO reads. The layered design is cache-friendly, hotspot tolerant and proposed as applicable to other read-optimized stores.
- What you get when you think of Postgres storage as a transaction journal
Neon mediumAdept
Neon treats Postgres storage as a transaction journal: the write-ahead log becomes the source of truth instead of a recovery aid. WAL is streamed to Safekeepers, which make it durable through Paxos-like consensus, and Pageservers turn it into page versions stored in S3, so compute nodes can stay stateless. Because any page can be rebuilt at any LSN, branching is copy-on-write via a pointer to an LSN, point-in-time restore is a specialized branch, read replicas share the Pageserver instead of copying data, and time-travel queries are possible. A walkthrough of WAL segment naming and pg_waldump output shows the underlying records.
- Deno KV internals: building a database for the modern web
Deno hardMasterDeno KV's production backend runs on FoundationDB, with a custom "transaction layer" in front of it that handles multi-tenant configuration, JavaScript-native types such as bigint sums, and cross-region replication. To keep latency low, every atomic operation is non-interactive: a single bag of versionstamp checks, set/delete writes and conflict-free mutations that completes in one or two network trips. A sequencer assigns monotonic transaction sequence numbers, and an evaluator turns each batch into a dataflow graph of AND/MUX operations and evaluates it concurrently. Results are reused speculatively before a writer commits them to FoundationDB, which raises throughput without locks.
- How we built a general purpose key value store for Facebook with ZippyDB
Meta Engineering hardMasterZippyDB is Facebook's largest strongly consistent, geo-distributed key-value store, built by layering a reusable replication library (Data Shuttle) on RocksDB, Shard Manager and a ZooKeeper-based config service. Shards of 50–100 GB hold tens of thousands of μshards, enabling transparent resharding. Each shard keeps a small Multi-Paxos quorum plus async follower replicas, with epoch-based leader leases assigned externally. Consistency is chosen per request: fast-ack or quorum writes, and eventual (actually bounded-staleness), read-your-writes or lease-based strong reads. Serializable transactions use optimistic concurrency control on the primary within an epoch, and conditional writes reuse that machinery server-side.
- Birth and death of a row in Turso's MVCC
Turso hardMasterTurso's MVCC, modeled on Hekaton, tracks each row as a chain of versions in a lock-free SkipMap, with begin/end fields holding a TxId while a transaction is active and a commit timestamp once it commits. The walkthrough follows one row from the INSERT bytecode executed by the VDBE, through the commit protocol (timestamp acquisition, first-committer-wins conflict checks, dependency waits, logical-log write and fsync), crash recovery by replaying the logical log, and checkpointing into the SQLite WAL and B-tree. Checkpoints default to a blocking Truncate mode triggered at about 4 MB, with an experimental Passive mode that lets writers proceed. Reads merge the in-memory store and the B-tree with a two-pointer iteration. Deletes set the end field under the version-chain lock, so concurrent writers to the same row get a WriteWriteConflict.