Free — no signup required

Introduction: The Illusion of a Single Copy

2 min read

The Problem with Replication

Imagine you're editing a shared Google Doc with a colleague. You type a sentence, hit save, and your colleague refreshes — but they still see the old version. A few seconds later, it updates. That gap between "you wrote it" and "they see it" is the fundamental challenge of replicated data.

In a distributed system, we replicate data across multiple machines for two main reasons:

  1. High Availability: If one machine dies, the data is safe on another.
  2. Performance: Users can read data from a machine that is geographically close to them.

However, replication introduces a fundamental challenge: keeping all those copies in sync. Every time data changes on one replica, that change must propagate to every other replica. During that propagation window — which can range from milliseconds to seconds — different clients reading from different replicas will see different versions of the same data.

If you update your profile photo on a server in New York, a user fetching your profile from a server in Tokyo might still see the old photo for a while. How long is "a while"? What happens if two people edit the same document at the same time on different servers? Who wins? What do other readers see?

Defining the Rules

A Consistency Model is a formal contract between the distributed system and the developer. It defines the rules about how and when updates to data become visible to different parts of the system. Think of it as the system's promise: "Here is what you can rely on when you read data."

It's a spectrum of trade-offs.

  • At one end, you have strong consistency models that make the distributed system behave like a single computer — every read sees the most recent write, globally. These are slow and fragile because they require heavy coordination.
  • At the other end, you have weak consistency models that are fast and robust but can show users confusing, out-of-date data.

Understanding these models is key to choosing the right database, designing correct applications, and reasoning about failure modes before they become production incidents.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free