1 of 4

Your RightSignal

Systems design · 5 of 121 / 3

Replication

The concept

Why a crashed database server doesn't lose your order

Replication means keeping the same data on several machines, called replicas, so losing one loses nothing. When you place an online order, the database writes it to two or three servers, ideally in different buildings.

The common setup is leader–follower: one replica, the leader, accepts all writes, and the followers copy them. If the leader's disk dies, a follower already holds your order and can take over as the new leader, a step called failover.

The payoff is that data is lost only if every copy fails before it can be replaced. If failures are independent, each extra copy multiplies the odds of total loss by another small number.

What it’s forEstimates the chance that every copy of a piece of data is lost at once.

P(all lost) = pⁿ

p
chance one replica fails before it is repaired, e.g. 0.01
n
number of copies, often 3

What it givesHow much safer each extra copy makes the data, assuming the copies fail independently.

  1. One copy, p = 0.01: 1 in 100 chance of loss
  2. Three copies: 0.01 × 0.01 × 0.01 = 0.000001
  3. That is 1 in a million, not 1 in 100