System Models and Failure Modes

Topics Covered

Why We Need System Models

An algorithm is only as good as its assumptions

Three questions every model answers

Models are deliberate simplifications

Safety under weak assumptions, liveness under stronger ones

Why interviewers care

Models in documentation

Communication assumptions

Models also bound the adversary

A worked example: electing a leader

Every distributed algorithm comes with fine print. It is correct only if the world behaves in certain ways: messages arrive within some time, nodes fail only by stopping, a majority of nodes stays up. That fine print is called the system model. It is a precise statement of what the algorithm assumes about timing, failures and communication. This lesson explains the standard models, why they matter and how practitioners choose among them, because the model you assume decides which problems can be solved at all and which guarantees a system can honestly make.

An algorithm is only as good as its assumptions

Consider a simple failure detector: every node sends a heartbeat each second, and a node that has not been heard from for three seconds is declared dead. If messages always arrive within one second, this detector is perfect. It never declares a live node dead, and it always notices a dead one within three seconds. In a real data center network, messages sometimes take longer than three seconds, during congestion, a long garbage collection pause or a network failover. Then the detector declares a live node dead. The algorithm did not change. The world violated its assumption.

This is why experienced engineers ask about the model before they ask about the algorithm. A protocol that is proven correct under synchronous timing tells you little about how it behaves on an asynchronous network. A protocol that tolerates crashes tells you nothing about a node with corrupted memory that sends garbage. Knowing the model lets you predict exactly when a system will break, rather than discovering it during an incident.

A failure detector built on a timeout is exact only when message delay is bounded, and on a real network a late message causes a false suspicion.

Three questions every model answers

A system model answers three questions. The first is about timing: are there known upper bounds on how long a message takes to arrive and how long a node takes to process a step, and are clocks synchronized to within a known error? The second is about failures: when a node fails, how does it misbehave? Does it simply stop, does it come back later, does it drop some messages, or can it do anything at all? The third is about communication: can messages be lost, duplicated or reordered, and is the network fully connected or can it partition?

Different answers produce different models, and each model has a different set of solvable problems. In a synchronous model with crash failures, consensus is easy. In an asynchronous model with even one crash, it is impossible to guarantee, as the consensus section explains. Between those extremes lie the models real systems use.

Models are deliberate simplifications

No model describes reality exactly. Real networks are mostly fast and occasionally terrible. Real nodes mostly crash cleanly and occasionally corrupt data. A model is a simplification chosen so that an algorithm can be proven correct, with assumptions weak enough that reality usually satisfies them. The art is to choose assumptions that are weak where violations are common and strong only where violations are rare enough to accept, or can be detected and handled some other way.

For example, almost all production consensus systems assume crash failures, not arbitrary ones, because hardware and software rarely lie in coordinated ways inside one organization. They add checksums to detect corrupted data, which covers the most common non crash fault, rather than paying the much higher cost of full Byzantine tolerance.

Safety under weak assumptions, liveness under stronger ones

A common and powerful design pattern is to split assumptions by property. Safety, the promise that nothing bad happens, is proven under the weakest timing assumptions: fully asynchronous, where messages can take any amount of time. Liveness, the promise that something good eventually happens, is proven only under stronger assumptions: eventually the network behaves well enough for long enough. This split means that a timing violation can delay progress but can never cause wrong answers. Raft and Paxos are both built this way, and it is one of the most important ideas in the field.

Why interviewers care

When a candidate proposes an algorithm in a system design interview, a strong follow up is: under what assumptions is this correct? A candidate who answers that the lock is safe as long as clocks are synchronized within a few milliseconds and processes never pause longer than the lease has shown real understanding, even if the design then needs fencing to remove that assumption. A candidate who has never thought about it will propose designs that work in the happy path and fail under the first long pause.

Models in documentation

Good systems state their model in their documentation. A consensus library might say that it tolerates the crash of any minority of nodes and remains safe under arbitrary message delay, loss and reordering, but requires that disks honor fsync. A database might say that it provides linearizable reads only when a majority of replicas can communicate. Reading documentation with an eye for these statements, and noticing when they are missing, is a practical skill. If a product claims strong guarantees without saying under which faults, treat the claim with suspicion until tests or proofs back it up.

Communication assumptions

The third part of a model, communication, is easy to overlook. Most models assume point to point links between every pair of nodes. Some assume reliable links, meaning a message sent between two correct nodes is eventually delivered, which can be built on lossy networks by retrying until acknowledged. Others assume fair loss links, meaning a message sent infinitely often is eventually delivered, which is closer to what raw packet networks provide. Some algorithms need stronger primitives such as reliable broadcast, where if any correct node delivers a message, every correct node eventually delivers it, or atomic broadcast, where every correct node delivers the same messages in the same order. Atomic broadcast turns out to be equivalent to consensus, a deep result that explains why replicated logs and consensus protocols are two views of the same problem.

These abstractions stack. Fair loss links plus retransmission and deduplication give reliable links. Reliable links plus sequence numbers give ordered delivery between two nodes. Ordered delivery to many nodes in the same total order needs consensus. Seeing the stack makes it clear which guarantees are cheap, provided by a library on each node, and which are expensive, needing coordination among many nodes.

Models also bound the adversary

A useful way to read a model is as a description of an adversary that controls the environment. In the asynchronous model, the adversary controls message timing and can delay any message for as long as it likes, as long as it eventually delivers. In the crash model, the adversary can stop up to f nodes at the worst possible moments. In the Byzantine model, it can also take over f nodes and make them do anything. An algorithm is correct if it meets its goal against every strategy the adversary has. Thinking adversarially, asking what is the worst schedule of delays and crashes, is how protocol designers find bugs, and it is how model checking tools explore designs automatically.

A worked example: electing a leader

Consider a three node cluster electing a leader. Under synchronous timing with crash stop failures, the algorithm can be trivial: every node waits one round, and the live node with the lowest identifier becomes leader. Everyone agrees because everyone hears from every live node within the round. Under partial synchrony, that algorithm breaks: a slow node misses the round, believes the lowest identifier is down and elects itself, and now there are two leaders. Raft fixes this with terms and majority votes: a node becomes leader only with votes from a majority in a term, and each node votes once per term, so two leaders in one term are impossible no matter how messages are delayed. The difference between the two algorithms is entirely a difference in assumed model.

State the model before trusting the algorithm

A system model fixes assumptions about timing, failures and communication, and an algorithm is correct only inside its model. Prove safety under the weakest timing assumptions and liveness under stronger ones, so that timing violations can stall progress but never produce wrong results.