System Design · Module 09
Distributed systems: replication and consistency
- Lessons
- 13
- Free
- 0
- Reading
- ~4 h
Your progress
0 / 13 lessons done
Sign in to trackLessons
- Distributed systems: why they are hardA service can save a change even when its caller sees an error. You need to preserve business rules across those uncertain outcomes, especially when retries and replicas are involved.
- Network partitions: when nodes cannot communicateA service can pass health checks while failing to reach its dependencies. You need explicit rules for what it may return, change and retry during that uncertainty.
- Logical clocks: ordering events across machinesReplicated services receive updates in different orders. Logical clocks help you preserve dependencies and detect competing edits without trusting machine timestamps.
- Replication models: single-leader, multi-leader, leaderlessAdding database copies changes where writes can succeed and what a successful response promises. You need these distinctions when choosing storage, routing reads or planning failover.
- Consistency models: from strong to eventualReplicas can return different answers without malfunctioning. You need an explicit contract to decide which differences are acceptable and which can lose an order or mislead a customer.
- Read-your-writes consistency: always seeing your own updatesA successful save followed by an old value makes customers doubt whether their change survived. You need a read path that respects completed writes without sending every request to the database leader.
- CAP and PACELC: core distributed tradeoffsReplication creates decisions about what to promise when copies cannot communicate. CAP and PACELC help you connect those decisions to customer-visible behavior and normal request latency.
- Quorums: how many replicas must agreeReplicated databases let you choose how many responses an operation needs. Those settings change latency, failure tolerance and what a successful response actually promises.
- CRDTs: merging concurrent edits without conflictsOffline clients and independently writable replicas can receive conflicting edits. CRDTs let you choose precise merge behavior instead of building ad hoc conflict handlers.
- Gossip protocols: sharing state between nodesCluster nodes need changing information about their peers without consulting one server for every request. Gossip spreads that information, but its delays and incomplete views must not become authority for unsafe actions.
- Failure detection: telling slow nodes from dead onesClusters must react when a peer stops answering. The difficult part is choosing a reaction that remains safe when the peer is slow, partitioned or still serving other clients.
- Service and node discovery in a clusterDeployments change addresses while requests are still arriving. Discovery connects stable service names to changing instances without making every request depend on a registry.
- Case: lessons from Amazon’s Dynamo paperReplication moves failures around rather than removing them. Dynamo shows how a product requirement changes the storage contract, application logic and recovery work together.
Practise with
Terms this module teaches 46
Open glossaryAnti-entropy
Repeated comparison and repair of stored replica state to recover differences missed by ordinary update delivery.
Applied watermark
In an ordered replicated log, the highest contiguous committed position applied and visible to new queries on a replica.
Asymmetric partition
A communication failure in which messages can travel in one direction but not the reverse direction.
Bounded staleness
A read guarantee limiting how far returned data may lag behind updates, measured using a stated time or version bound.
CAP theorem
The impossibility of guaranteeing both linearizable shared reads and writes and completion at every non-failing node when communication can remain partitioned.
Causal consistency
A guarantee that observations preserve dependencies between operations, without requiring a shared order for independent operations.
Consistency model
A contract defining which results and orderings clients may observe when reading and changing shared data.
CRDT (conflict-free replicated data type)
A data type whose copies can be changed independently on different replicas and always merge to the same result without coordination.
CRDT tombstone
Retained evidence that an identified addition was removed, preventing an older copy from restoring it.
Distributed system
Separate running components that coordinate by exchanging messages and can experience different failures.
Endpoint
A network destination described by an address, port and protocol.
Failure detector
A mechanism that observes communication or progress and reports suspicion when expected evidence stops arriving.
False suspicion
A failure detector suspecting a process that has not crashed.
Gossip fanout
The number of peers a node selects for an exchange in one gossip round.
Gossip protocol
A protocol in which nodes repeatedly exchange information with selected peers, allowing receivers to forward information learned elsewhere.
Happened-before
A dependency relation formed by local event order, message sends before their receives, and chains of those relationships.
Heartbeat
A periodic message used as evidence that a process has recently made progress.
Hinted handoff
Temporarily storing an update with its intended replica destination, then forwarding it when that destination becomes reachable.
Lamport clock
A logical counter whose timestamps increase along happened-before relationships, without identifying all concurrent event pairs.
Leaderless replication
A replication model where requests collect responses from replicas without a permanent exclusive write leader for the key.
Lease
Permission that lasts for a limited period unless renewed; its exact effect depends on the protocol.
Logical clock
Ordering metadata advanced by events and communication rather than elapsed physical time.
Merkle tree
A tree of hashes that lets peers locate differing data by comparing summaries before examining individual records.
Multi-leader replication
A replication model where multiple leaders accept independent writes and exchange the resulting changes.
Network partition
A communication failure that prevents groups of nodes from exchanging the messages they need to coordinate, even when the nodes remain running.
Node discovery
Finding cluster peers and their contact information without, by itself, granting them membership or authority.
Node incarnation
An ordered identifier for a node instance that distinguishes its announcements from those of an earlier instance.
Observed-remove set
A replicated set where a removal cancels the additions it observed, allowing an unseen concurrent addition to survive.
PACELC
A framework separating availability–consistency choices during partitions from latency–consistency choices during normal operation.
Phi accrual failure detector
A detector that uses recent heartbeat arrival intervals to report how unusual the current silence is under an estimated timing model.
Quorum
A set of replica responses sufficient for an operation to complete under a replication protocol.
Quorum intersection
The property that the response sets required by two operations must share at least one replica.
Read repair
Updating stale replicas after a read discovers that their stored versions are behind.
Read-your-writes consistency
A session guarantee that later reads reflect the writes that precede them in that session.
Readiness
Whether an application instance is prepared to accept new application requests.
Reconciliation
The process of resolving divergent records and their application-level consequences after independent changes.
Sequential consistency
A guarantee that results fit one legal order preserving each client’s operation order, without requiring real-time order across clients.
Service discovery
Maintaining and finding the usable network destinations behind a stable service name.
Service registry
A directory containing service instances, their network destinations and metadata used to decide whether to send them requests.
Single-leader replication
A replication model where one node accepts application writes for a data partition and followers reproduce its changes.
Sloppy quorum
A response threshold that can count substitute nodes when the normally assigned replicas are unavailable.
Split-brain
A failure condition in which separated parts of a system act as independent authorities over the same shared state.
State-based CRDT
A CRDT that exchanges mergeable state whose internal information advances monotonically and whose merge is associative, commutative, and idempotent.
Strong consistency
A guarantee that every read sees the latest successful write, as if there were only one copy of the data.
Vector clock
A logical timestamp with a counter for each participant, compared component by component to represent dependencies and concurrency.
Watch
A subscription that streams changes to selected stored records, sometimes with a position from which delivery can resume.