Problem
A single leader forces all writes through one region, adding latency for distant users and creating a single failure point for writes. Yet independent writers can update the same data concurrently. The system must reconcile such conflicts.
Also known as: active-active-replication, master-master, multi-master
Accept writes at several nodes or regions and replicate them to each other to gain local write latency and regional availability.
A single leader forces all writes through one region, adding latency for distant users and creating a single failure point for writes. Yet independent writers can update the same data concurrently. The system must reconcile such conflicts.
In multi-leader, or active-active, replication every region has a node that accepts writes. Each leader replicates to the others asynchronously. It cuts write latency and survives region loss, in exchange for conflicts that must be handled. Examples include CouchDB, Cassandra multi-DC, Galera-like setups and DynamoDB global tables.
Region EU (leader) <--async--> Region US (leader)
^ ^
+------------async------------+
Region AP (leader)
User in EU: write x=1 at EU leader, ack locally
User in US: write x=2 at US leader concurrently
Both replicate: conflict on x -> resolve
Conflict handling options:
Each change carries its origin leader id so a leader does not re-send changes it already applied.
Full database footprint per region plus cross-region bandwidth
High: conflict monitoring, topology management
High: conflict semantics
Silent data loss from last-write-wins on skewed clocks
Replication loops or out-of-order delivery causing divergence
Uniqueness violations from concurrent inserts in different regions