Skip to main content
SDMastery
intermediate5 min readUpdated 2026-10-03

Data Replication

Every production database uses replication. Without it, a single server failure means data loss and downtime.

Quick answer: Data Replication

Data Replication is covered here as a practical system design concept. Every production database uses replication. Without it, a single server failure means data loss and downtime. Use it to understand the Databases idea, where it appears in production systems, and how to discuss it clearly in interviews.

Focus on the problem being solved, the main design choice, the failure mode, and the tradeoff you would defend in front of a senior engineer. This page is part of the DosiBridge system design knowledge graph, so it links related concepts, interview problems, tradeoffs, and references instead of leaving the topic isolated.

Diagram showing the key components and data flow in a Data Replication system design
High-level overview of Data Replication
Data Replication

When You Need Data Replication

Every production database uses replication. Without it, a single server failure means data loss and downtime. In interviews, you must explain how replication affects consistency, availability, and performance.

What It Is

Data replication is the process of copying data from one database server (primary/master) to one or more other servers (replicas/slaves). It provides redundancy (survive server failures), performance (distribute reads across replicas), and geographic distribution (replicas near users).

System architecture diagram for Data Replication showing how services, databases, and caches connect
System architecture for Data Replication

How It Works

In leader-follower replication: All writes go to the leader. The leader writes to its write-ahead log (WAL). The WAL is streamed to followers, which replay the changes. Reads can go to any follower. If the leader fails, a follower is promoted (failover).

Replication lag is the delay between a write on the leader and that write being visible on a follower. During lag, reading from a follower may return stale data.

The Decision Framework

  • Synchronous replication: The primary waits for replicas to confirm before committing. Guarantees consistency but adds latency.
  • Asynchronous replication: The primary commits immediately and sends changes to replicas in the background. Fast but replicas may lag (eventual consistency).
  • Semi-synchronous: The primary waits for at least one replica to confirm. Balances consistency and performance.
  • Leader-follower (primary-replica): One leader handles writes; followers handle reads. Most common pattern.
  • Multi-leader: Multiple nodes accept writes. Used for multi-region deployments. Requires conflict resolution.
  • Leaderless (quorum): Any node can accept reads/writes. Uses quorum (R + W > N) for consistency. Used by Dynamo, Cassandra.
Step-by-step diagram showing how Data Replication processes a request from start to finish
How Data Replication works step by step

What the Industry Uses

PostgreSQL streams WAL records to replicas for leader-follower replication. Hot standby replicas serve read queries.

MySQL offers both asynchronous and semi-synchronous replication. Group Replication provides multi-leader with conflict detection.

Amazon Aurora replicates data 6 times across 3 availability zones with <20ms replication lag.

Performance and Tradeoffs

Comparison table for Data Replication contrasting approaches, tradeoffs, and when to use each
Comparing key aspects of Data Replication
  • Sync vs Async: Sync guarantees consistency but adds write latency. Async is faster but allows stale reads.
  • Single-leader vs Multi-leader: Single-leader is simpler; multi-leader enables multi-region writes but requires conflict resolution.
  • Read replicas vs Sharding: Replicas scale reads; sharding scales both reads and writes. Use both for maximum scale.

Mistakes Engineers Make

  1. Reading from a replica immediately after writing — may return stale data (read-after-write consistency issue)
  2. Not monitoring replication lag — a lagging replica can serve very stale data
  3. Using synchronous replication across regions — adds 100ms+ latency per write

Practice These Interview Questions

  1. What are the types of replication strategies?
  2. What is replication lag and how does it affect the system?
  3. When would you use synchronous vs asynchronous replication?
  4. How does quorum-based replication work?
Data flow diagram for Data Replication showing how requests and responses move through the system
Data flow through Data Replication

Original DosiBridge notes for Data Replication

This section is written specifically for this page, not copied from a general system-design checklist. The useful way to study Data Replication is to connect the concept to a data path where correctness, access pattern, and future migrations matter more than benchmark numbers. That framing changes the design discussion from definitions to operating choices.

What makes this topic distinct

  • Query Shape: For Data Replication, decide the query shape before choosing tools; otherwise the design looks clean but fails when data changes.
  • Write Amplification: For Data Replication, decide the write amplification before choosing tools; otherwise the design looks clean but fails when replication changes.
  • Replication Lag: For Data Replication, decide the replication lag before choosing tools; otherwise the design looks clean but fails when data changes.
  • Migration Safety: For Data Replication, decide the migration safety before choosing tools; otherwise the design looks clean but fails when replication changes.
  • Data Ownership: For Data Replication, decide the data ownership before choosing tools; otherwise the design looks clean but fails when data changes.

Distinct angle: replication lag as a product behavior

Data replication is not only a storage feature. It changes what users see after a write, what support teams debug, and how failover behaves. A useful design names the acceptable lag per workflow: account balance may require synchronous confirmation, while analytics dashboards can tolerate delayed replicas. That makes replication a product promise instead of a vendor checkbox.

Production review question

If a team adopts Data Replication, what observable signal proves it helped instead of only making the architecture diagram more fashionable?

Practical metric to track

Track data-replication health as a named dashboard or review item: combine one user-facing metric, one saturation metric, and one correctness metric. For Data Replication, this keeps the discussion grounded in behavior that can be measured after deployment instead of generic advice that sounds good in an interview but never gets verified.

Further Reading

Interview preparation checklist for Data Replication with key points to mention and mistakes to avoid
Interview tips for Data Replication

External Resources

Original Sourcearticle