liveBook · Manning

Replication

As explained in Think Distributed Systems

Replication is the maintenance of multiple copies or instances of data or functionality to reduce reliance on a single component and improve availability or performance.

Replication represents one logical object with multiple identical physical objects, called replicas. It improves distributed-system reliability by avoiding dependence on a single component. section 8.3 section 7.0

A useful mental model separates the logical item from its physical copies. Replication transparency hides those copies behind the experience of one object, while consistency determines whether they still represent the same logical state. section 8.2 section 8.3

The library’s copies

A library may hold ten physical copies of a work, but different editions can make the answer to “how many copies of the same book?” depend on what counts as the logical item. Replication similarly concerns both the number of copies and whether they represent the same object. section 8.2

Replication becomes difficult when replicated state changes:

  • Replicate stateless services redundantly and load-balance requests between them; stateful components require changes to propagate correctly. section 8.4
  • Use monotonicity to recognize changes that preserve existing knowledge; an increment-only counter can preserve knowledge that its value exceeded a threshold, unlike a counter that can reset. section 8.4
  • Choose among single-leader, multileader, and leaderless arrangements. More leaders reduce dependence on one leader but make concurrent conflicts more important. section 8.4.5
  • Account for replication lag: follower reads can improve performance but may omit recent updates, so current data may require reading from the leader. section 8.4.5

Replication always balances competing goals. Synchronous replication favors consistency but can reduce availability or increase latency; asynchronous replication favors latency and availability but can weaken consistency. State-based replication sends current state, while log-based replication sends the operations that produced it. section 8.5 section 8.5

Figure 8.9 Single-leader, multileader, and leaderless configurations
A diagram of a multi leader

AI-generated content may be incorrect.

Compare single-leader, multileader, and leaderless replication configurations visually. section 8.4.5

How Think Distributed Systems covers it

How deep it goes
Explains logical objects, transparency, change propagation, monotonicity, leadership strategies, lag, and consistency trade-offs.
Examples
Uses library copies and book editions, redundant logic gates and services, replicated key-value stores, and threshold counters.
What it assumes
Assumes distributed-system components and logical state, while treating partitioning separately and assuming the dataset fits on one node.
What you can do after
Evaluate replication designs by comparing leadership, lag, conflict, consistency, availability, and latency trade-offs.
How it connects
Connects replication with consistency, availability, latency, replication lag, conflict resolution, partitioning, and redundancy.

Also explained in

Compare how 13 books explain replication →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Think Distributed Systems. The section links point to the parts of the book it draws on.