Multi-Primary Replication
ELI5 — The Vibe Check
Multi-primary replication lets multiple database servers accept writes simultaneously, like having multiple cashiers at a store. The tricky part is what happens when two servers accept conflicting changes at the same time. Someone has to resolve that conflict, and it's usually ugly. Great for multi-region setups where you need local write speed.
Real Talk
Multi-primary (multi-master) replication allows write operations on any node, with changes asynchronously propagated to all other nodes. It provides lower write latency in distributed deployments but introduces conflict resolution complexity when concurrent writes modify the same data. Strategies include last-writer-wins, merge functions, and CRDTs. Used by CockroachDB, Cassandra, and Galera Cluster.
When You'll Hear This
"Multi-primary replication eliminates the single-writer bottleneck." / "The hardest part of multi-primary is conflict resolution when two nodes update the same row."
Related Terms
Conflict Resolution
Conflict resolution is what happens when two database servers both change the same thing at the same time and then try to sync up.
Distributed Database
A distributed database spreads your data across multiple computers that work together like a hive mind. If one server dies, the others pick up the slack.
Read Replica
A read replica is a copy of your database that only handles read queries.
Vector Clock
A vector clock is a way for distributed servers to figure out the order of events without a synchronized wall clock.