Course contentsShow
← Computer Science
Lesson 2637 of 2,87259. Consensus and ReplicationFree lesson

Introduction to Replication

Understanding why distributed systems replicate data across multiple nodes for fault tolerance and availability.

Introduction to Replication

What you'll learn: Why distributed systems intentionally copy data across multiple machines to survive failures and stay available.

The Problem: Single Points of Failure

In a distributed system, any single node can fail at any time—disks corrupt, networks disconnect, servers crash. If critical data lives on only one machine, that machine becomes a single point of failure. Lose it, and you lose your data and the ability to serve requests.

The Solution: Replication

Replication means storing the same piece of data on multiple nodes. Instead of one authoritative copy, you maintain several copies (replicas) spread across different physical machines or data centers.

Think of it like keeping backups of important documents. If your house burns down but you have copies at your office and a friend's place, you haven't lost anything critical.

Core Benefits

Fault tolerance: If one node fails, other replicas continue serving requests. Your system survives hardware failures, network partitions, and other disasters without data loss.

Availability: With multiple replicas, clients can read from any available copy. Even during partial failures, the system remains responsive. Geographic distribution also means users can access nearby replicas for better performance.

Load distribution: Multiple replicas can share read traffic, reducing bottlenecks and improving throughput.

The Trade-off

Replication isn't free. Multiple copies must stay consistent with each other—a challenge you've seen hinted at in earlier consistency models. When one replica updates, how and when do others learn about it? This tension between consistency, availability, and partition tolerance (the CAP theorem) makes replication a complex engineering problem.

Key Takeaway: Replication copies data across multiple nodes to ensure the system survives failures and remains available, though keeping replicas consistent introduces new challenges.