Interview concept

What is database replication?

Database replication maintains copies of data across multiple servers. It improves availability and read throughput and protects against data loss, using single-leader, multi-leader, or leaderless models with different consistency tradeoffs.

Interview concept

How it works

Leader and followers

Writes go to a leader and replicate to followers that serve reads, the most common model.

Synchronous vs async

Synchronous replication is durable but slower; asynchronous is faster but risks losing recent writes on failover.

Replication lag

Followers can trail the leader, so reads may be stale under eventual consistency.

Interview concept

Responsible use

Use any live AI assistant only where interview, workplace, school, and platform rules allow it. Do not use generated answers to misrepresent your skills, experience, or authorship.

FAQ

Common questions.

What is the difference between replication and sharding?

Replication copies the same data to many nodes; sharding splits different data across nodes. They are often combined.

What is replication lag?

The delay before a follower reflects a leader write, which can cause stale reads until it catches up.