Knowledge Guide
HomeSystem DesignReplication

Replication Methods

Replication in database systems is a strategy for ensuring data availability, redundancy, and load balancing. There are several replication methods, each with its advantages and challenges.

1. Single-leader replication

In single-leader (a.k.a. primary-backup) replication, one node handles all writes while one or more followers asynchronously or synchronously replicate its state. The follower may or may not serve read traffic (depending upon the settings).

Example

MySQL primary-replica: one master accepts writes; replicas pull binlog events and replay them.

Pros

Cons

2. Multi-leader replication

Here multiple nodes can accept writes; they asynchronously propagate changes to each other, resolving conflicts via timestamps or application logic.

Example

CouchDB bidirectional sync: each node can accept updates and exchange changesets via HTTP; conflicts flagged for manual or callback resolution.

Pros

Cons

3. Leaderless (quorum-based) replication

No designated leader—clients send reads/writes to any replica set and rely on read/write quorums to ensure consistency.

Example

Cassandra/Dynamo: write to N replicas; require W acknowledgments. Read from any; require R acknowledgments. With you get strong consistency.

Pros

Cons

4. Chain replication

Nodes are arranged in a fixed chain. Writes flow from head → … → tail; reads are served from the tail, so they see all preceding writes.

Example

Google’s Chain Replication paper: head receives write, forwards to next; tail acks back up the chain.

Pros

Cons

5. Read-replica replication

A variation of single-leader (primary-backup) replication where the leader handles all writes and one or more replicas serve only read traffic. Replicas continuously pull or receive a stream of write updates from the leader but never accept writes themselves.

Difference between Single-leader and Read-replica

Example

PostgreSQL streaming replication

Pros

Cons

6. Snapshot replication

Rather than continuously shipping every change, snapshot replication takes a full copy of the source dataset at a specific point in time and pushes that snapshot to one or more targets on a scheduled basis.

Example

SQL Server snapshot replication

  1. At publication time, the server generates a bulk “snapshot” of tables and schema.
  2. The snapshot is delivered to subscribers (often via file share or network transfer).
  3. Subscribers apply the entire snapshot, replacing their local data.
  4. The process repeats at configured intervals (e.g., nightly).

Pros

Cons

7. Hybrid Replication

Explanation

Pros

Cons

Summary

Replication trades off write complexity, availability, and consistency.

🤖 Don't fully get this? Learn it with Claude

Stuck on Replication Methods? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Replication Methods** (System Design) and want to truly understand it. Explain Replication Methods from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Replication Methods** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Replication Methods** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Replication Methods** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes