Part 6 · 1 chapters · ~8 min

Multi-Region and Global

Active-passive, active-active and regional-sharding topologies, conflict resolution with last-writer-wins, CRDTs and application merge, Spanner and TrueTime, CockroachDB and YugabyteDB, Aurora's log-is-the-database design, Neon and PlanetScale, and data residency as a placement constraint.

16

Topologies and conflict resolution

topologywritesconflictsfits
active-passiveone regionnoneDR; most products
active-active, multi-writerany regionmust be resolved: LWW, CRDTs, or app mergedata that merges naturally (carts, likes), rarely money
regional shardingeach record in its home regionnone for local datamulti-country products, residency
consensus-replicated (NewSQL)any region, consensus per rangenone (serialisable), slower writesglobal strong consistency needs

Last-writer-wins silently drops concurrent updates and depends on clocks; CRDTs merge automatically for suitable types (Distributed Systems part 10); application merge stores both versions and resolves with domain rules. For balances, none of these: a single authority per account.

GLOBAL DATABASES, ONE IDEA EACH
what each system bet on
SpannerTrueTime: GPS and atomic clocksbound clock error, so commits waitout uncertainty and get globalorder.CockroachDBRaft per range, hybrid logicalclocks, Postgres wire protocol;serializable by default.YugabyteDBRaft per tablet on DocDB(RocksDB-based), reusing Postgres'query layer for compatibility.AuroraThe log is the database: computeships redo to a six-way replicatedstorage service across threezones.Neon / PlanetScaleSeparate storage and compute:branching, scale to zero (Neon);Vitess as a service (PlanetScale).regional shardingEach user lives in a home region;most queries stay local; globaltables are replicated reads.
swipe the figure sideways, or tap expand for full screen
1/6
Spanner
Spanner assigns commit timestamps and waits until TrueTime's uncertainty interval has passed (commit wait, a few ms), giving external consistency across continents.
bounded clock error buys global orderingcommit wait: a few ms per write