Distributed Systems Basics Explained: Clocks, Quorums and Worked Examples
Learn how messages, replicas, quorums and logical clocks make distributed systems predictable. Two worked examples show how to calculate overlap and event order.
KnowledgeGate Team
Exam prep & CS education

A distributed system can look like one service to a user while several machines, delayed messages and partial failures sit behind it. The difficulty is deciding what happened when those machines disagree. For six replicas, quorum inequalities determine the smallest safe read set. For two communicating processes, Lamport's receive rule produces a causal event order without relying on wall clocks.
What makes a system distributed?
A distributed system contains independent computers that communicate through messages and provide a service. They do not share memory by default, they have no perfectly shared global clock, and one part can fail while another keeps running. The last case is a partial failure.
Case | Classification | Reason |
|---|---|---|
One process on one machine | Centralised | One computer owns the state |
Four cores sharing memory in one computer | Parallel, not this distributed model | One machine and memory |
R1, R2 and R3 exchanging messages | Distributed | Independent machines use a network |
Distributed Systems in Operating Systems: Clocks, Consistency and Worked Examples connects architectures, RPC, election, consensus, distributed files and multi-node clock traces. A six-replica quorum design and a two-process Lamport trace develop the calculation mechanics here from explicit assumptions.
Messages, replication and partial failure
A node is a participating computer or process. A client sends a request, a server processes it and returns a response. Naming routes messages. Replication keeps active copies on multiple nodes, coordination applies a shared rule, and failure detection looks for unavailable participants.
Failure observations need separate labels. If a client receives success from R1, waits without a reply from R2, and gets connection refused from R3, only R1's result is known. R2's silence may mean request delay, processing delay, a lost response or failure; R3's refusal shows that no listener accepted that connection. A retry needs a request identifier and an idempotent operation because the silent R2 may already have committed.
A replica is an active copy used for service or availability. A backup is a recovery copy and may not answer live requests. Replication does not prevent shared logical corruption.
Worked example: design a quorum for six replicas

There are N = 6 replicas, A through F. Each starts with (quota = 48, v20). A coordinator assigns increasing versions for this key, membership stays fixed, and a reader selects the highest committed version it receives. Set the write quorum to W = 4. The task is to find the smallest read quorum R that must intersect every completed write.
A read must satisfy R + W > N. Substitution gives R + 4 > 6, so R > 2. The smallest integer choice is therefore R = 3.
A write of (quota = 60, v21) reaches A, B, C and D, so four acknowledgements complete it. A later read from D, E and F receives v21 from D and v20 from E and F. Under the stated version rule, the reader returns quota 60 because D carries the completed write into the read set.
The guaranteed read-write overlap is:
R + W - N = 3 + 4 - 6 = 1 replica
If R = 2, replicas E and F can form a read set disjoint from the write set {A, B, C, D}; both return the stale value 48. That counterexample proves why 2 is too small.
Completed writes also intersect because 2W = 2 x 4 = 8 > 6. Any two four-replica write sets overlap in at least 2W - N = 8 - 6 = 2 replicas.
The calculation guarantees set intersection, not a complete storage protocol. Safety still depends on fixed membership, monotonic per-key versions, conflict handling, durable acknowledgement and the stated reader rule.
Ordering events when there is no global clock
Wall-clock timestamps alone cannot safely prove causality across machines. Clocks drift, messages are delayed, and a later displayed time does not reveal whether one event influenced another. A Lamport logical clock instead numbers events according to simple update rules.
Process P sends message m with L(P) = 1, then performs a local event and advances to 2. Process Q first performs a local event at L(Q) = 1. When Q receives m carrying timestamp 1, it computes L(Q) = max(1, 1) + 1 = 2. Q sends reply r at 3. P receives r while its own clock is 2 and computes L(P) = max(2, 3) + 1 = 4.
If event A causally precedes B, Lamport time preserves L(A) < L(B). The reverse is not guaranteed: L(A) < L(B) alone does not prove that A caused B. Distributed Systems in Operating Systems: Worked Examples for GATE and Interviews adds vector-clock comparisons and coordination-message counts; this trace isolates the scalar Lamport update rule.

Consistency, availability and partitions without slogans
Consistency describes what values a read is allowed to observe after writes. A strong single-order view makes operations appear in one agreed order. Eventual consistency allows replicas to differ temporarily but requires them to converge after updates and communication resume. It does not mean random or permanently incorrect data.
In the six-replica example, W = 4 and R = 3. A partition side with four replicas can complete a write, while a side with only two cannot satisfy either quorum. Reducing the read requirement to R = 2 lets two old replicas answer, but it removes guaranteed overlap with the completed write.
The careful CAP point concerns the partition interval: a design cannot guarantee both a response from every side and one strongly consistent latest view. CAP does not say that every distributed system permanently chooses only two properties. Transaction isolation inside one database is also a different concern from observations across replicated nodes.
Six traps that make simple questions go wrong
Trap | Correction |
|---|---|
Distributed means parallel | Parallel work can happen in one shared-memory machine; distributed nodes use messages |
A timeout proves node failure | Request, response or processing may be delayed |
Replication is backup | Replicas support service; backups support recovery |
Lamport numbers reconstruct physical time | They preserve causal order one way, not wall-clock time |
A fast response must be current | A replica can answer quickly with stale data |
| It depends on membership, quorum, versioning and failure rules |
If A, B, C and D store (quota = 60, v21) while E and F store (quota = 48, v20), the replicas have not converged. That fact alone does not reveal the contract. Write down the membership, failure assumption, allowed response and version rule before judging the result.
How exams turn the basics into solvable questions
Useful practice mixes property classification, timeout reasoning, Lamport updates, quorum intersection and consistency statements. Check the relevant exam authority's syllabus or notification for the current cycle rather than assuming a fixed weightage or frequency.
Common forms ask you to identify a property, reason about a timeout or partial failure, update a logical clock, compute quorum intersection, or select a valid consistency statement. Try three checks:
For
N = 8andW = 5, the smallest read quorum isR = 4because4 + 5 > 8while3 + 5 = 8does not pass the strict inequality.A process at logical time 4 receives a message stamped 6. It updates to
max(4, 6) + 1 = 7.‘A timeout proves that the server crashed’ is false. Request delay, response delay or slow processing can also cause it.
Write the rule, substitute the values, and interpret the result. For a quorum question, test the smallest rejected value as a counterexample; for a clock question, separate causal implication from timestamp order.
The short version: model first, then calculate
Use a six-step retrieval chain: name the nodes, name the messages, state what can fail, write the ordering or version rule, calculate with the supplied values, then test the answer against a stale or delayed response. Use CS Fundamentals for Exams & Placements for the wider subject map and CS Fundamentals for Placements by Sanchit Sir for placement-oriented Operating Systems, DBMS and Computer Networks revision.
Now derive R = 3 from R + 4 > 6, construct the disjoint stale read at R = 2, and reproduce the Lamport sequence 1, 2, 3, 4 without looking.
Keep learning
Reliability in Distributed File Systems: Replication, Quorums and Worked Failure Examples
See how a distributed file system turns one pathname into metadata and replica requests, then calculate read-one and majority-quorum availability step by step.
Distributed Systems in Operating Systems: Clocks, Consistency and Worked Examples
Build a connected understanding of distributed systems through exact examples of duplicate RPC calls, logical clocks, leader election, replica quorums and block recovery.
Distributed Systems in Operating Systems: Worked Examples for GATE and Interviews
Learn how distributed operating systems reason about messages, causality, coordination, consistency, replication, and partial failure. Follow exact RPC, clock, quorum, and file-replication examples built for exam and interview practice.
Communication Protocols in Operating Systems and Distributed Systems: IPC, RPC and a Worked Reliability Trace
Separate OS communication mechanisms from protocol guarantees, then trace how a lost reply, a retry, and request-ID deduplication affect server state.





