A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Multi-Master Replication

Research Depth 102 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
425prerequisites beneath it
See this on the map →
State Machine ReplicationThe Consensus Problem→→Quorum-Based Replication
replication topology writes

Core Idea

Multi-master replication allows writes to be accepted at any replica. All replicas must synchronize through consensus (Paxos, Raft) or eventual consistency with conflict resolution. This enables high availability and low-latency writes in geographically distributed systems but complicates consistency guarantees and conflict handling.

Explainer

In the replication models you have studied so far — primary-backup and state machine replication — there is a clear distinction between which node accepts writes and which nodes follow. Multi-master replication removes that distinction: every replica can accept writes independently. Think of it like a shared document where multiple people can type at the same time in different locations, rather than one person dictating while others copy. This sounds ideal for availability and latency — a user in Tokyo writes to a Tokyo replica, a user in London writes to a London replica — but it introduces a fundamental problem you already understand from the consensus problem: what happens when two replicas accept conflicting writes at the same time?

The answer depends on the consistency model the system chooses. One approach is to run a consensus protocol (Paxos or Raft) on every write, so all replicas agree on a single total order of operations before any write is confirmed. This gives you strong consistency — the system behaves as if there were a single copy of the data — but it reintroduces the latency cost of cross-replica coordination, partially defeating the purpose of allowing writes everywhere. The alternative is eventual consistency with conflict resolution: each replica accepts writes immediately and propagates them asynchronously, with conflicts detected and resolved after the fact.

Conflict resolution is where multi-master replication gets genuinely hard. Two users might update the same row at the same time on different replicas. Common resolution strategies include last-writer-wins (use timestamps to pick a winner, accepting that the "loser" write is silently discarded), merge functions (application-specific logic that combines both writes, like a union of set elements), and conflict-free replicated data types (CRDTs), which are data structures mathematically designed so that concurrent operations always converge to the same state regardless of the order they are applied. Each strategy trades off simplicity, correctness, and the kinds of operations the system can support.

In practice, most multi-master systems are used when geographic distribution makes single-leader latency unacceptable — global databases like Google Spanner (which uses consensus) or CouchDB (which uses eventual consistency with conflict detection). The design choice between consensus-backed multi-master and eventually-consistent multi-master maps directly to the CAP theorem tradeoff: you can optimize for consistency or availability under network partitions, but not both. Understanding this tradeoff is the key to choosing the right replication topology for a given system.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Kernel Architecture and OS Structure → System Calls and User/Kernel Mode → Processes and the Process Control Block → Logical Clocks and Event Ordering → Vector Clocks and Capturing Causality → Happened-Before Relation and Causal Ordering → Consistency Models in Distributed Systems → Read-After-Write Consistency → Sequential Consistency → Linearizability → State Machine Replication → Multi-Master Replication

Longest path: 103 steps · 425 total prerequisite topics

Prerequisites (2)

Leads To (1)