What is a Replica

A replica is a copy of data on a different node. If your database has three replicas, the same data exists on three separate machines. When one machine fails, the other two still have the data. Replicas are the building blocks of replication — they are what make distributed systems fault-tolerant.

How it works

In a leader-follower setup, the leader holds the primary copy. Followers are replicas that receive a stream of changes from the leader. Followers can serve read queries, offloading the leader. They cannot accept writes directly — writes go to the leader, which replicates them.

In a leaderless setup, all nodes are peers. Each holds a replica that accepts both reads and writes. Clients write to multiple replicas simultaneously and read from multiple replicas, using quorum rules to determine the correct value.

Replicas can be synchronous or asynchronous. A synchronous replica must confirm every write before the leader acknowledges the client — strong guarantee, but one slow replica slows everything down. An asynchronous replica receives changes with a delay — faster, but the replica may serve stale data. Most systems use a mix: one synchronous replica for safety, the rest asynchronous for performance.

Replication lag is the delay between a write landing on the leader and appearing on a replica. Under normal load, lag is milliseconds. Under heavy write load or network issues, it can grow to seconds or minutes. This creates consistency problems — a user writes data and immediately reads from a lagging replica that does not have it yet.

Why it matters

Replicas are how databases survive hardware failures without losing data or availability. Every cloud database, every managed database service, and every production deployment uses replicas. Understanding their behavior — especially replication lag — is essential for building systems that behave correctly under failure.

See How Replication Works for failover, promotion, and lag monitoring.