Goal

After this appendix you can name, for each layer of a production system, the tools that implement it and the module whose theory they rely on; read an etcd/raft Ready loop and a gRPC client and say which invariant each line protects; prove that ReadIndex reads are linearizable, that a lease is safe under bounded clock drift and that fencing tokens stop stale writes whatever the clocks do; and follow one Put from a Python client to a committed, applied, deduplicated entry, naming the theorem behind every hop.

Modules 1 to 10 prove that broadcast, quorums, Raft and Paxos are correct. Appendix A showed the network those proofs run on. This appendix answers the question an engineer asks next: which real packages implement all this, and where does each one sit in the theory? Nobody writes Raft from scratch for production. They pick a library (etcd/raft, hashicorp/raft), or call a service that already runs consensus (etcd, ZooKeeper), and wrap it in an RPC framework (gRPC), a storage engine (bbolt, Pebble, RocksDB) and a membership protocol (SWIM). Each of those choices either preserves an invariant from the modules or quietly breaks it.

The thread through the appendix is the course project: a key-value store with a Python gRPC front end and Raft underneath. We use its raft.proto as a running example, compare it with what production libraries do, and end with one Put traced end to end through every layer. On the way we prove three propositions that production systems depend on and that the modules did not cover: ReadIndex reads, leases and fencing tokens.

The appendix draws on Ongaro’s thesis for what production Raft adds to the paper (1); on the papers describing Chubby (2), ZooKeeper (3) and Zab (4), Spanner (5), Dynamo (6), Cassandra (7), Kafka (8), SWIM (9), hybrid logical clocks (10), CockroachDB (11) and FoundationDB (12); on Gray and Cheriton’s leases (13); on Kleppmann’s essay on distributed locking (14); and on the AWS report on TLA+ (15). Tool facts were checked against each project’s current documentation; version numbers are given only where they matter.

The stack at a glance

The question is how the pieces of a production system are layered, and which module each layer comes from.

Figure 1 stacks the layers from the client down to the wire. It extends Figure 2 of Appendix A upwards: Appendix A stopped at “consensus or broadcast”; here that layer is split into the parts a real deployment has to choose separately.

layer theory production tools client and RPC stubs, deadlines, retries, ids App. A gRPC + protobuf, Thrift Python grpcio in the course project replicated state machine KV map + client dedup table M4, M6 your code: the apply callback or etcd, ZooKeeper, Consul as a service consensus: replicated log elect, replicate, commit M5-M9 etcd/raft, hashicorp/raft, Ratis Zab (ZooKeeper), Paxos (Chubby) membership, time, leases failure detection, clocks M5 SWIM (memberlist, Serf), NTP, PTP TrueTime, HLC, fencing tokens durable storage WAL + fsync, snapshots M5 bbolt, Pebble, RocksDB Raft log and state machine on disk transport TCP, TLS, HTTP/2, QUIC App. A gRPC channels, mTLS, Envoy one long-lived connection per peer
Figure 1. The production stack. The left column is the layer and what it does, the middle column the module or appendix whose theory it implements, the right column the tools that implement it. The two top layers are what the course project writes itself; everything below is normally taken from a library.

The master table below maps each concept of the course to the systems that use it. Read it as “if you understood Module N, you understand the core of these tools”.

ConceptModuleToolsWhat to look for
FIFO-total order per partitionM1Kafka, NATS JetStreamone log per partition, read by everyone in the same order
gossip, anti-entropyM2, M3Cassandra, Dynamo-style stores, Consul’s SerfMerkle-tree repair, epidemic spread
quorums , read repair, LWWM3Cassandra, Riak, DynamoDB’s ancestorstunable consistency levels per request
total order broadcast = consensusM4ZooKeeper (Zab)primary-order atomic broadcast
RaftM5 to M7etcd, Consul, CockroachDB, TiKV, Kafka KRaftone Raft group per shard in the large systems
Multi-PaxosM8, M9Chubby, Spannerone Paxos group per shard, long-lived leaders
leases and fencingM5, this appendixChubby sequencers, ZooKeeper zxid, etcd revisionsa counter that only grows

Three observations from the table. First, every strongly consistent system in it runs a majority-quorum consensus protocol somewhere, even if only for its metadata (Kafka’s controllers). Second, the systems that do not (Cassandra, Dynamo) are exactly the ones whose guarantees are those of Module 3: convergence, not linearizability (Proposition 3.19). Third, the large systems (CockroachDB, TiKV, Spanner) do not run one consensus group; they split the key space into ranges and run one group per range, so the theory of the modules applies per range, and a transaction across ranges needs a protocol on top.

RPC and serialization

The question is what an RPC framework adds to the bare “send a message” of the modules, and what it leaves to us.

gRPC and protocol buffers. gRPC is the RPC framework used by etcd, CockroachDB, TiKV and the course project. An interface is written once in protobuf’s IDL; the protoc compiler generates the stubs of Birrell and Nelson (Appendix A) for each language: a client stub that marshals arguments, and a server servicer base class that unmarshals them. Calls travel over HTTP/2, so many calls share one TCP connection (each call is a stream). Four features matter for consensus code:

  • Deadlines. Every call can carry a deadline (timeout= in Python). When it passes, the client gets status DEADLINE_EXCEEDED. That is the timeout of Proposition A.1, so the call may have run, may not have run, or may still run.
  • Status codes. Failures come back as codes such as UNAVAILABLE (no connection) and DEADLINE_EXCEEDED. Neither says whether the server executed the call.
  • Retries. gRPC can retry a call automatically according to a retry policy in its service configuration. It does not deduplicate: the server sees two calls. Exactly-once effect is still our job (Proposition A.8).
  • Streams and cancellation. A call can be cancelled; the server sees the cancellation, but may already have acted.

Alternatives exist with the same shape: Apache Thrift (an IDL and RPC stack from Facebook, used by Cassandra’s older client protocol), Cap’n Proto (zero-copy serialization with promise pipelining), and plain HTTP/JSON. None of them changes the three-case picture of Appendix A.

The course raft.proto. The project’s interface is the paper’s Figure 2 written in protobuf. A short excerpt:

message KeyValue {                 // a client Put
    string key = 1;
    string value = 2;
    int32 clientId = 3;            // section 8 of the Raft paper:
    int32 requestId = 4;           // the deduplication key
}
message AppendEntriesArgs {
    int32 term = 1;
    int32 leaderId = 2;
    int32 prevLogIndex = 3;
    int32 prevLogTerm = 4;
    repeated LogEntry entries = 5;
    int32 leaderCommit = 6;
}
message AppendEntriesReply {
    int32 term = 1;
    bool success = 2;
}

The pair clientId, requestId is the identifier of the reply cache in Appendix A: the state machine executes a command only if its requestId is larger than the last one recorded for clientId. Since each LogEntry also carries both fields, deduplication happens where Raft needs it, at apply time.

Two things that production libraries add are missing.

  1. No conflict hint. A failed AppendEntries says only success = false, so the leader walks nextIndex back one entry per round trip (Proposition 6.6). The Raft paper (§5.3) suggests, and etcd/raft and hashicorp/raft implement, a hint: the follower reports the term of the conflicting entry and the first index it stores for that term (or simply its last index), so the leader can skip a whole term per round trip. Safety is unchanged, since a hint only chooses which prevLogIndex to try next and the consistency check still decides.
  2. No matchedUpTo in the reply. Our convention since Module 6 is that a success reply carries the index up to which the follower now matches, and Proposition A.11 uses it to show that stale replies are harmless. With the course proto, the leader must compute that number from the request the reply answers, prevLogIndex + len(entries). A gRPC unary call returns the reply to the code that made that call, so the request object is at hand. The bug to avoid is computing it from the leader’s current nextIndex[j] when the reply arrives: by then later requests may have moved nextIndex[j], and a delayed success reply would raise matchIndex[j] to an index the follower never acknowledged, which breaks claim 2 of Proposition A.11.

A servicer and a stub in Python. The server side of the course project: a servicer whose Put hands the command to the Raft module and answers only after the entry is committed and applied (Module 6, “Clients”).

from concurrent import futures
import grpc
import raft_pb2, raft_pb2_grpc            # generated from raft.proto
 
class KVServer(raft_pb2_grpc.KeyValueStoreServicer):
    def __init__(self, node):
        self.node = node                  # this server's Raft module
 
    def Put(self, request, context):
        if not self.node.is_leader():
            return raft_pb2.GenericResponse(success=False, error="not leader")
        # append, replicate, wait for commit AND apply (dedup happens in apply)
        ok = self.node.propose_and_wait(request, context.time_remaining())
        return raft_pb2.GenericResponse(success=ok)
 
    def AppendEntries(self, request, context):
        return self.node.handle_append_entries(request)   # Module 6 receiver
 
def serve(node, port):
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=16))
    raft_pb2_grpc.add_KeyValueStoreServicer_to_server(KVServer(node), server)
    server.add_insecure_port(f"[::]:{port}")
    server.start()
    return server

The client keeps one requestId per logical call and re-sends the same request on every retry, to the next server if the current one is not the leader. In the course project a FrontEnd service sits between client and servers; its forwarding loop is the same.

import itertools
import grpc
import raft_pb2, raft_pb2_grpc
 
class KVClient:
    def __init__(self, addrs, client_id):
        self.stubs = [raft_pb2_grpc.KeyValueStoreStub(grpc.insecure_channel(a))
                      for a in addrs]
        self.client_id, self.seq, self.leader = client_id, itertools.count(1), 0
 
    def put(self, key, value):
        req = raft_pb2.KeyValue(key=key, value=value, clientId=self.client_id,
                                requestId=next(self.seq))   # fixed for all retries
        while True:
            try:
                reply = self.stubs[self.leader].Put(req, timeout=0.5)  # deadline
                if reply.success:
                    return
            except grpc.RpcError:
                pass      # DEADLINE_EXCEEDED or UNAVAILABLE: ran, not ran, or late
            self.leader = (self.leader + 1) % len(self.stubs)   # try the next one
LineWhy it matters
requestId=next(self.seq) outside the loopthe retry is the same logical call; the state machine filters the duplicate (Proposition A.8)
timeout=0.5without a deadline a call to a partitioned leader blocks forever
except grpc.RpcError: passthe client cannot tell the three cases apart, so it does not guess; it retries
context.time_remaining()the server stops waiting when the client has given up; the entry may still commit later, which the dedup table makes harmless

Transport and security

The question is what sits under the RPC framework. Appendix A covered TCP and TLS in detail; here we only place the production choices.

  • TCP remains the default for peer traffic: etcd, Consul and the course project keep long-lived connections between peers. TCP’s guarantees end at a reset (Appendix A), which is why Raft’s handlers are idempotent.
  • QUIC (the transport of HTTP/3) runs over UDP and multiplexes independent streams, so one lost packet does not stall every call on the connection (head-of-line blocking in TCP). For consensus it changes latency, not correctness: a QUIC connection, like a TCP one, gives no guarantee across a reset or a crash.
  • TLS and mutual TLS. Production clusters authenticate peers with certificates on both sides (mTLS), so only cluster members can send AppendEntries or votes. This closes the arbitrary-link adversary of Appendix A on the wire; it does not make a compromised member honest, which would need Byzantine protocols.
  • Service meshes (Envoy as a sidecar proxy) add retries, timeouts and mTLS between services without code changes. A mesh retry is still a retry, with the three-case ambiguity, so a non-idempotent call needs request identifiers end to end.

Consensus libraries and consensus services

The question is how a system gets consensus: by linking a library into its own process, or by calling a separate service that already runs it.

Embed a library. The application runs the Raft module inside each of its own servers and replicates its own state machine.

LibraryLanguageShapeUsed by
etcd/raft (go.etcd.io/raft/v3)Gocore algorithm only; you bring transport and storageetcd, CockroachDB, Dgraph
raft-rsRustport of the etcd/raft designTiKV
hashicorp/raftGoalgorithm plus pluggable transport, log store, snapshot storeConsul, Nomad, Vault
Apache RatisJavaalgorithm plus gRPC or Netty transportApache Ozone
openraftRustasync, event-driven, storage via traitsseveral Rust databases

The etcd/raft library takes the minimal route. Its documentation says that it implements only the Raft algorithm and leaves network and disk I/O to the user. The library is a deterministic state machine: you feed it ticks, incoming messages and proposals, and it hands back a Ready batch with everything you must do next. The loop below follows the library’s README and the raftexample in the etcd repository (configuration changes omitted).

for {
    select {
    case <-ticker.C:
        n.Tick() // election and heartbeat timers (Module 5)
    case rd := <-n.Ready():
        // 1. persist entries and HardState{Term, Vote, Commit}, with fsync
        wal.Save(rd.HardState, rd.Entries)
        if !raft.IsEmptySnap(rd.Snapshot) {
            saveSnapshot(rd.Snapshot)
        }
        storage.Append(rd.Entries) // make them readable to the library
        // 2. only now send AppendEntries, votes and replies
        transport.Send(rd.Messages)
        // 3. apply committed entries in log order (Module 7)
        for _, e := range rd.CommittedEntries {
            applyToStateMachine(e) // dedup by (clientId, requestId)
        }
        // 4. tell the library this batch is done
        n.Advance()
    }
}

The order of the four steps is not a style choice. The README states that no messages may be sent until the latest HardState has been persisted. That is the “persist before replying” rule of Figure 2 that Module 5 uses for votes and Module 6 for entries: a vote or an acknowledgement is a promise that a crash must not erase.

          ticks, peer messages, proposals
                        |
                        v
        +-------------------------------+
        |  raft.Node (pure algorithm)   |
        +-------------------------------+
                        | Ready
                        v
   1. persist HardState + Entries (fsync)  <- Module 5: persist before reply
   2. send Messages                        <- App. A: may be lost, repeated
   3. apply CommittedEntries in order      <- Module 7: State Machine Safety
   4. Advance()                            -> next Ready

hashicorp/raft takes the opposite route: you implement a finite-state-machine interface (Apply, Snapshot, Restore) and supply a log store and a stable store (for example raft-boltdb), and the library runs the loop, the transport and the timers itself. A call to Apply(cmd, timeout) returns a future that resolves once the command is committed and applied, which is exactly propose_and_wait in the Python servicer above.

Call a service. Most applications should not run consensus at all. They call a small, strongly consistent service that does, and store only coordination data in it: who the leader is, which configuration is current, which lock is held.

  • etcd is a key-value store replicated with etcd/raft. Writes go through the Raft log; reads are linearizable by default (ReadIndex, below), or serializable if the client asks for a possibly stale local read. Every write gets a cluster-wide revision, a counter that only grows.
  • ZooKeeper is a tree of small nodes (znodes) replicated with Zab, a primary-order atomic broadcast protocol (4). Total order broadcast is consensus (Theorem 4.11), and Zab is the clearest production instance of that equivalence. ZooKeeper’s paper gives linearizable writes and FIFO order per client; reads are served locally by whichever server the client is connected to and may be stale, unless the client first calls sync (3). Every update gets a zxid, again a growing counter.
  • Consul stores its catalog and key-value data in hashicorp/raft among a few server nodes, and uses gossip (Serf, built on memberlist, a SWIM variant) for membership and health among all nodes.
  • Chubby is Google’s lock service: a cell of (typically) five replicas running Paxos, with coarse-grained advisory locks and small files (2). ZooKeeper and etcd fill the same role outside Google.

Key point

A library gives you a replicated log inside your own servers; a service gives you a small replicated store next to them. In both cases the safety proofs of Modules 5 to 9 cover only what goes through the log. Whatever your code does outside it (a read answered from memory, a write to another system while holding a lock) needs its own argument. The next two sections give the two arguments production systems use most.

What production Raft adds to the paper

The question is which mechanisms every production Raft has that the paper’s Figure 2 lacks, and why. All of them are in Ongaro’s thesis (1).

MechanismProblem it solvesWhere in the thesisIn etcd/raft
PreVotea partitioned server rejoins with a huge term and deposes a healthy leader§9.6Config.PreVote
CheckQuoruma leader cut off from the majority keeps answering clients§6.2, §4.2.3Config.CheckQuorum
ReadIndex, lease readsreads through the log cost a disk write each§6.4ReadOnlySafe, ReadOnlyLeaseBased
snapshots, log compactionthe log grows foreverchapter 5Snapshot, Compact
membership changeadding or removing servers without two majoritieschapter 4joint consensus, ConfChangeV2
learnersa new server must catch up before it counts in quorums§4.2.1learner (non-voting) members
batching, pipeliningone round trip and one fsync per entry is slow§10.2.2many entries per Ready, in-flight windows

PreVote. A server that was partitioned away keeps timing out and incrementing its term. When it rejoins, its high term forces the leader to step down by the common term rule (Definition 5.4), although nothing was wrong. With PreVote a server first asks “would you vote for me?” without incrementing its term. Servers answer yes only if they have not heard from a leader recently and the candidate’s log is up-to-date (Definition 6.3). A server that cannot win does not disturb the cluster. Safety is unaffected: the pre-vote changes no persistent state, and the real election that follows is the one of Module 5.

CheckQuorum. The stale leader of Figure 5.6 cannot commit anything (Proposition 5.12), but it can still accept client requests that then time out. With CheckQuorum a leader steps down if an election timeout passes without hearing from a majority. It also lets followers ignore vote requests while they hear from a live leader, which is the basis of lease reads below.

Snapshots. The state machine is periodically written out with the index and term of the last entry it includes, and the log before that index is discarded. A follower that is too far behind receives the snapshot (InstallSnapshot in the thesis) instead of the missing entries. The snapshot is just a compressed prefix of the committed log, so Log Matching and State Machine Safety carry over unchanged (Theorem 7.7).

Membership changes must never let an old-configuration majority and a new-configuration majority decide independently. The thesis gives two methods: changing one server at a time (any majority of the old set and any majority of the new set then intersect) and joint consensus, in which decisions need majorities of both configurations during the transition. etcd/raft supports both. Learners are members that receive the log but do not vote and do not count in quorums, so a new server can catch up before it joins a majority.

Batching and pipelining. A leader sends many entries per AppendEntries and keeps several requests in flight to one follower without waiting for each reply. One fsync then covers a whole batch (group commit). Pipelining relies on the idempotence and stale-reply results of Appendix A (Proposition A.10, Proposition A.11): replies may arrive out of order, and matchIndex must take the maximum.

ReadIndex: linearizable reads without a log write

The question is how a leader can answer a read without appending it to the log, and still return a value that is never stale. Module 6 stated the two precautions of the paper’s §8; we now turn them into the thesis’s ReadIndex procedure (§6.4) and prove it.

// Leader L of term t answers a read-only query q.
on receive Read(q):
    wait until L has committed an entry of term t   // the no-op of Module 6
    readIndex := commitIndex                        // remember the commit point
    send a heartbeat AppendEntries of term t to every server
    wait for replies carrying term t from a majority (L included)
        to heartbeats sent after readIndex was recorded
    // any reply with a higher term: step down, the read fails
    wait until lastApplied >= readIndex
    reply with the result of q on the state machine
LineWhy it is there
committed an entry of term a new leader’s commitIndex may lag behind what earlier leaders committed (Remark B.2)
readIndex := commitIndexthe read will reflect at least everything known committed now
fresh majority with term proves no newer leader had committed anything before this moment
lastApplied >= readIndexthe state machine has caught up with the commit point

To state what “never stale” means we use the definition of linearizability of Definition 3.18 in its equivalent form: a set of completed operations is linearizable if they can be put in one sequence that (i) respects real time (if completes before starts, comes first) and (ii) is legal for a key-value map (every read returns the value of the last preceding write to its key) (16). Writes are ordered by the log index at which they take effect; with the dedup table of §8 a retried command takes effect only at its first index. Module 6 explained why this order of writes respects real time. We add the reads.

Proposition B.1 (ReadIndex reads are linearizable).

Let leader of term answer a read by the procedure above. Let be the time at which it sets , and let when it evaluates , so that sees the state produced by . Then

  1. every entry that is committed at some time (in any term) has an index ;
  2. placing each read directly after the write at index of its evaluation (reads with the same ordered by completion time) gives a sequence of all writes and ReadIndex reads that respects real time and is legal.

Hence writes and ReadIndex reads together are linearizable.

Remark B.2 (Why a new leader must commit its no-op first).

commitIndex is volatile, so a new leader starts with whatever value it last learned as a follower. Suppose A, leader of term 1, commits at index 5 with the help of B and C, answers the client, and crashes before any heartbeat carries leaderCommit = 5. B wins term 2 (its log holds index 5, so it is up-to-date) with . If B served a read at once, and the read would return the old , although the client already saw its write succeed: a linearizability violation. B cannot even commit index 5 by counting replicas, because index 5 has term 1 (Remark 7.5). Once B commits its term-2 no-op at index 6, index 5 is committed with it, and every later readIndex is at least 6.

Lease reads. ReadIndex still costs one heartbeat round per read (or per batch of reads). A lease read skips it: after a heartbeat round that a majority answered, the leader assumes that no other leader can be elected for a while and serves reads from memory. This is etcd/raft’s ReadOnlyLeaseBased, which its documentation says can be affected by clock drift and which requires CheckQuorum. The assumption holds only if followers refuse to vote while they hear from the leader, and if the leader’s lease is shorter than the followers’ election timeout by a safety margin for clock drift. That margin is exactly the subject of the next section.

Leases, clocks and fencing

The question is how a process can hold a right (“I am the leader”, “I hold the lock on file F”) for a period of time without asking for permission at every step, and what goes wrong when it does.

A lease is a lock with an expiry time (13). A grantor (Chubby, ZooKeeper, etcd, or the Raft majority itself) gives a holder the right to act for a duration ; if the holder crashes or is cut off, the right lapses on its own, and nobody has to detect the crash. That is what makes leases attractive: they turn “is the holder still alive?”, which no failure detector can answer reliably (Proposition 5.2), into “has time passed?”. The price is that safety now depends on clocks.

Leases under bounded clock drift

We need a model of clocks. Clocks may show different times; what we bound is how fast they run.

Definition B.3 (Clocks with bounded drift).

Each process has a local clock , a function of real time that can read. For a constant with , the clocks have drift at most if for every process and all real times

Nothing is assumed about the offset between clocks. Processes measure durations on their own clock; no process ever compares its clock reading with another’s.

Real quartz oscillators drift by tens of parts per million, so is tiny. The model fails in other ways: a clock that is stepped (an NTP correction, an administrator, a virtual machine resumed after migration) violates the rate bound. Lease implementations therefore measure durations with a monotonic clock (CLOCK_MONOTONIC on Linux), never with wall-clock time.

The lease protocol for one grant:

  • Holder . It reads its clock, , at the real time at which it sends its request. After a grant arrives, it performs a guarded action at real time only if . The check and the action happen in one atomic step.
  • Grantor . It grants at real time , after receiving the request, and reads . It grants the same lease to anyone else only at a real time with .
Proposition B.4 (A lease is safe under bounded drift).

Assume clocks with drift at most (Definition B.3) and the protocol above. Then every guarded action that performs under this grant happens, in real time, strictly before the grantor’s next grant of the same lease. Consequently the guarded actions of different grants never overlap in real time: at every instant at most one holder acts.

The proof also assumes that the grantor remembers . A grantor that crashes and restarts has lost it, so after a restart it must wait for on its own clock before granting the lease to anyone, unless it records its grants on stable storage; a lock service that fails over to a new primary has the same obligation for every lease the old primary might have granted.

The proof used one assumption that real processes violate all the time: the check and the action happen in one atomic step. In a real program they are separate instructions, and the action is usually a message to someone else.

if lease_valid():          // check: passes at local time 9.9 s of a 10 s lease
    ...                    // stop-the-world GC pause, page fault, VM migration
    storage.write(data)    // act: arrives at the storage server at 40 s

Between the check and the moment the write reaches the storage server, the process can stall (a garbage-collection pause of tens of seconds is not unusual), and the message itself can be delayed by the network. Neither is bounded in the asynchronous or partially synchronous model (Definition 4.13). Proposition B.4 guarantees that the holders’ decisions do not overlap; it says nothing about when their effects arrive. Kleppmann’s essay (14) tells the standard story, which the next figure and widget replay: client C1 obtains the lease with token 33, pauses, the lease expires, C2 obtains it with token 34 and writes, and then C1 wakes up and writes as well, believing it still holds the lock.

Try it: in the “GC pause” scenario, with “storage checks fencing token” off, Step through the run: C1 gets token 33, decides to write and is paused; the lease ends at , C2 gets token 34 and writes; C1 resumes and its token-33 write arrives at . The storage ends with “x=C1”, and the checks “storage token never decreases” and “no stale holder’s write applied” turn red. Switch “storage checks fencing token” on: the same run ends with the token-33 write rejected (✗), “x=C2”, and both checks green. The “Clock drift” scenario needs no pause: with “clock drift (C1 slow)” at 30%, C1’s clock shows only 4.9 of its 6 ticks used at , so C1 still believes it holds the lease and writes after C2 got token 34. Lower the slider to 10% and C1 notices its lease is over in time; raise it again and only fencing saves the storage. The “Sandbox” scenario lets you request leases, write, pause and resume each client yourself.

client C1 lock client C2 storage token 33 C1 paused (GC) 33 expires token 34 write(34) max = 34 write(33) no fencing: applied, stale fencing: 33 < 34, rejected
Figure 2. The lease and fencing scenario. C1 holds the lease with token 33 and is paused. Its lease expires, the lock service grants token 34 to C2, and C2 writes. When C1 wakes it still believes it holds the lease and writes with token 33 (dashed). Without fencing the storage applies the stale write; with fencing it remembers that it has seen token 34 and rejects token 33.

Fencing tokens

The fix moves the check from the holder, which cannot know that it is stale, to the resource, which sees every write. The lock service attaches to each grant a fencing token, a number that grows with every grant; the holder sends its token with every request; the storage remembers the largest token it has seen and refuses anything older.

// Storage server. maxToken is on stable storage.
maxToken := 0                            // below every token ever issued
 
on receive Write(token, data):           // requests handled one at a time
    if token >= maxToken:
        maxToken := token
        apply data
        reply ok
    else:
        reply rejected(maxToken)         // a newer holder exists
Proposition B.5 (Fencing tokens stop stale writes).

Assume that

  1. the lock service gives its -th grant the token , with over all grants;
  2. every write a holder sends carries the token of the grant under which it is sent;
  3. the storage server runs the code above, handling one request at a time, with on stable storage and initially smaller than .

Then, in every execution, whatever the clocks, pauses and message delays:

  1. never decreases;
  2. once a write with token has been applied, no write with a token is applied afterwards;
  3. in the order in which the storage applies them, the writes come in contiguous blocks, one block per grant, and the blocks appear in the order of the grants. In particular, once a write of a later grant has been applied, every write of an earlier grant is rejected.

Three details of the proposition deserve a second look.

  • , not . A holder normally writes several times under one grant, all with the same token. With a strict test its second write would be rejected. The non-strict test is safe because tokens are strictly increasing over grants: equal tokens can only come from the same grant, the same holder.
  • Strictly increasing tokens need consensus. Assumption 1 is a statement about the lock service, and it is the reason the lock service runs consensus. ZooKeeper’s zxid or a znode’s version, etcd’s revision and Chubby’s sequencer (which includes a lock generation number) are such counters, each assigned through the replicated log. A lock service that could hand out the same token twice, for example after failing over to a replica that missed the last grant, breaks the proposition.
  • What fencing does not order. A stale write that reaches the storage before any request of the newer holder is still applied. The storage then sees it as if it had happened during the old lease, which is consistent with claim 3. If the new holder reads before it writes, it should send its token with the read as well, so that the storage raises before the new holder relies on what it read.
Remark B.6 (Fencing needs the resource to participate).

The proposition is about a storage server that runs the check. Three consequences.

  • A resource that cannot check cannot be fenced. Sending an email or calling an external payment API while holding a lock is protected only by the lease, so only under Proposition B.4’s assumptions.
  • Several storage servers. If a holder writes to servers and , each keeps its own . A stale holder’s update can be rejected by , which has already seen token 34, and accepted by , which has not: a partial update. The fix is to make the check and the write one step of a single linearizable object, for example a conditional write (“apply if the stored token is at most mine”) executed through the storage’s own replicated log, or a transaction across both servers.
  • A replicated storage server must treat as part of its replicated state: the check runs when the write is applied, in log order, not when a replica first receives the request. Otherwise two replicas could decide differently.

Exam trap: a lease alone makes the lock safe

“The lock has a 10-second lease and the client checks that its lease is valid before every write, so two clients can never write at the same time.” Wrong on two counts. First, Proposition B.4 guarantees non-overlapping checks, not non-overlapping effects: a process can pause for longer than its lease between the check and the write, and the write message can be delayed in the network, so the write can reach the storage after another client has been granted the lease. Second, even the guarantee about checks rests on bounded clock drift (Definition B.3), which a stepped clock or a resumed virtual machine violates. The safe design is a lease plus a fencing token checked by the resource (Proposition B.5), whose safety does not depend on time at all; the lease then only provides liveness (a crashed holder’s lock eventually becomes free).

Clocks in production

The question is what clocks real systems have and how they use them, given that consensus never needs them for safety.

  • NTP synchronizes a machine’s wall clock with time servers; it bounds offset to roughly milliseconds on a good network but may step the clock. Fine for logs, wrong for measuring lease durations (use a monotonic clock).
  • PTP (Precision Time Protocol) with hardware timestamping reaches sub-microsecond offsets inside a data centre. Better clocks shrink margins; they do not remove the pause problem above.
  • TrueTime in Spanner returns an interval guaranteed to contain real time, kept small (a few milliseconds) by GPS receivers and atomic clocks in every data centre (5). A transaction gets a commit timestamp no smaller than at commit time, and its effects become visible only after TrueTime guarantees that real time has passed (commit wait). Then timestamp order agrees with real-time order, which gives external consistency (linearizability for transactions) at the cost of waiting out the uncertainty. Spanner replicates each shard with Paxos and uses leader leases; it is Multi-Paxos (Module 9) plus a very good clock.
  • Hybrid logical clocks (HLC) pair a physical part, the largest physical time seen so far, with a logical counter that breaks ties exactly as a Lamport clock does (10). They satisfy the clock condition of Lamport clocks (if then ) and stay within the clock offset of physical time, so timestamps are both causal and readable. CockroachDB uses HLC timestamps with a configured maximum clock offset; a read that finds a value with a timestamp inside its uncertainty window restarts at a higher timestamp, and a node that detects its clock too far from its peers’ stops itself (11).

The pattern is the same everywhere: clocks are used for performance (lease reads, fewer round trips, readable timestamps), and either a proof under a stated clock bound (TrueTime, Proposition B.4) or a time-free mechanism (Raft terms, fencing tokens) carries safety.

Membership and failure detection

The question is how a large cluster knows which nodes are alive, given that a perfect failure detector does not exist (Proposition 5.2).

Raft’s election timeout is a failure detector for one node, the leader, watched by a handful of followers. A cluster of thousands of nodes needs every node watched, and all-to-all heartbeats cost messages per period. SWIM (9) separates detection from dissemination:

  1. Probe. Each period, every member pings one member chosen at random. No ack within a timeout: it asks other members to ping the target on its behalf (indirect probe), which avoids blaming the target for a bad link between two nodes.
  2. Suspect. No ack at all: the target is marked suspected, not dead. A suspected member that hears this refutes it by announcing a higher incarnation number, a counter only it may increase.
  3. Confirm. If no refutation arrives within a suspicion timeout, the member is declared failed.
  4. Disseminate. Membership changes are piggybacked on the ping and ack messages, so they spread like the gossip of Module 2 in a number of rounds logarithmic in .

Each member sends a constant number of messages per period, and the expected time to first detection does not grow with . hashicorp/memberlist implements SWIM with extensions (Lifeguard) that make slow members less likely to accuse healthy ones; Serf and Consul build on it.

In the terms of Definition 5.1, SWIM is a timeout-based detector. It has completeness (a crashed member stops answering every probe and is eventually confirmed failed), and it can have eventual accuracy only under partial synchrony, once timeouts exceed the real delays; before that it can wrongly declare live members dead. Two consequences:

  • Membership by gossip is not consensus. Different members may hold different views at the same moment (“weakly consistent” is in SWIM’s name). That is fine for routing and health checks, and wrong for anything that needs a majority of a fixed set. Consul illustrates the division: gossip tells servers which nodes are up; the catalog of services itself, and the set of Raft voters, change only through the Raft log.
  • A wrong suspicion must be harmless. A system that acts on “B is dead” (re-replicating its data, revoking its lease) must stay correct when B is alive, which is again the job of terms, epochs and fencing tokens.

Durability: write-ahead logs and fsync

The question is how “persist before replying” is implemented, and how it fails.

Every Raft server keeps two things on disk: the log with currentTerm and votedFor, and the state machine (or snapshots of it). The usual design is a write-ahead log (WAL): append the record to a file, call fsync, and only then act on it. In etcd the Raft log and the HardState go to WAL files with periodic snapshots, and the key-value state lives in bbolt, a B+-tree store in one file. CockroachDB stores both in Pebble, an LSM-tree engine written by Cockroach Labs and inspired by RocksDB; TiKV stores its key-value data in RocksDB.

Rule from the modulesHow it is implementedWhat breaks without it
persist vote before replying (M5)HardState{Term, Vote, Commit} in the WAL before Sendtwo votes in one term (Example 5.11)
persist entries before acknowledging (M6)wal.Save before Send in the Ready loopa “stored” entry vanishes, a committed entry falls below a majority
term and vote togetherone record, written atomicallyafter a crash between two writes, an old votedFor paired with a new term, or the reverse
bounded logsnapshot, then truncate the WALdisk fills; a slow follower can no longer be caught up from the log

Why currentTerm and votedFor form one record. Suppose they were two files. A server in term 4 receives a RequestVote for term 5 from B, writes votedFor = B and crashes before writing currentTerm = 5. It restarts with term 4 and a vote for B, which it reads as a vote cast in term 4. A RequestVote for term 5 from C then makes it adopt term 5, clear votedFor by the term rule, and vote for C. It has voted for both B and C in term 5, which breaks Lemma 5.9. Written in the other order, the crash can leave term 5 with a vote meant for term 4. Etcd/raft avoids both by persisting Term and Vote in a single HardState record.

fsync is slow, so it is batched. An fsync on a disk takes from tens of microseconds (good NVMe with power-loss protection) to milliseconds. Doing one per entry caps throughput at a few thousand entries per second. Group commit collects all entries that arrive while the previous fsync runs and covers them with the next one; the Ready loop does this naturally, since one Ready may carry many entries. The safety rule is unchanged: no acknowledgement leaves before the fsync that covers its entry has returned.

fsync can lie. The proofs assume that what was persisted survives. Real storage weakens this in several ways: disks with volatile write caches that acknowledge before the data is durable; file systems where a newly created file is not durable until its directory is also synced; and the discovery, in PostgreSQL’s case in 2018, that on Linux a failed fsync may mark the dirty pages clean, so that retrying the fsync succeeds while the data is lost. A Raft server that keeps running after an fsync error may then reply as if an entry were stored. The safe reaction is to crash and recover from what is actually on disk, and the same applies to data corruption: a corrupted log entry must not be served, which is why storage engines checksum their records.

Logs and messaging systems

The question is how the broadcast classes of Module 1 appear in the messaging systems engineers actually deploy.

Kafka. A Kafka topic is split into partitions; each partition is an append-only log with one leader replica, and every consumer reads a partition in the same order (8). A partition is therefore FIFO-total order broadcast (Definition 1.11) to its consumers; a topic with many partitions has no order across them, so producers pick a key and Kafka sends all messages with the same key to the same partition. FIFO order per producer additionally needs the idempotent producer described below, since a retried batch could otherwise overtake its successor.

Kafka’s replication of a partition is not a majority quorum. The leader keeps an in-sync replica set (ISR) of followers that are caught up, and a message counts as committed when every replica currently in the ISR has it. A follower that lags is removed from the ISR, so a commit never waits for a slow node. With replicas this tolerates failures, where a majority quorum would need . The catch is that the ISR is itself a decision someone must make consistently: whoever shrinks it and chooses the next leader from it must not disagree with another such decider. In Kafka that is the controller, and the controller’s metadata is replicated by consensus. Since Kafka 4.0 this is KRaft only: ZooKeeper mode has been removed, and a quorum of controllers replicates the metadata log with a Raft variant in which followers fetch from the leader. So Kafka is the “outsource the quorum” design: cheap replication for data, consensus only for membership of the replica sets.

Exactly once in Kafka. An idempotent producer gets a producer id from the broker and numbers its messages per partition; the broker drops a message whose sequence number it has already appended. That is the reply cache of Appendix A (Proposition A.8), with the producer id as client id. Transactions extend it to atomic writes across partitions, together with the consumer’s offsets, so a read-process-write pipeline takes effect once.

Other systems.

  • Apache Pulsar stores messages in Apache BookKeeper. A BookKeeper ledger has a single writer that sends each entry to an ensemble of storage nodes and waits for a configured ack quorum; when another process takes over (for example a new Pulsar broker for the topic), it first opens the old ledger in recovery mode, which fences it, so that later appends by the old writer fail, and then closes it. This is Proposition B.5 built into storage.
  • NATS JetStream replicates each stream, and each consumer, as its own Raft group; writes to a stream are linearizable according to its documentation.
  • RabbitMQ quorum queues are replicated FIFO queues based on Raft (RabbitMQ’s Ra library), with a leader and followers per queue.
SystemOrder unitBroadcast class (M1)Replication
Kafka partitionone partitionFIFO-total per partitionISR; controllers use KRaft
Kafka topicnone across partitionsper-key FIFO via partitioningas above
ZooKeeperall writesFIFO-total (primary order)Zab
NATS JetStream streamone streamtotal order per streamRaft per stream
RabbitMQ quorum queueone queueFIFO per queueRaft per queue
Cassandranoneno order; LWW convergencegossip, tunable quorums

Cassandra and Dynamo-style stores are Module 3 in production. Dynamo (6) and Cassandra (7) replicate each key on nodes chosen by consistent hashing, and a request chooses its consistency level (one, a quorum, or all replicas), that is, its and (Definition 3.13). Conflicting writes are resolved by last-writer-wins on timestamps in Cassandra (Definition 3.9) and by vector clocks with application-level merging in Dynamo; replicas converge by read repair (Definition 3.17) and by anti-entropy with Merkle trees. Dynamo also uses a sloppy quorum: when home replicas are unreachable, a write goes to other nodes with a hint to hand it back later, which keeps the system writable but breaks the intersection argument of Theorem 3.16 until the hints are delivered. None of this is linearizable, by Proposition 3.19. Cassandra adds a Paxos-based compare-and-set (lightweight transactions) for the operations that need it.

Testing and verification

The question is how production teams find the bugs that the proofs in these notes would catch, in code that nobody has proved.

TechniqueWhat it checksBugs it findsExamples
TLA+ specification + model checkinga design, on small configurations, exhaustivelyprotocol bugs: a missing term check, a wrong commit ruleAWS (S3, DynamoDB), the Raft TLA+ spec
Jepsen + Elle / Knossosreal binaries under partitions, crashes, clock skew; then the recorded historylinearizability and isolation violations in shipped systemsreports on etcd, ZooKeeper, Kafka, Cassandra and many more
Porcupinea recorded history against a sequential modellinearizability violations in testsMIT 6.824-style KV tests, the course project
deterministic simulationthe real code, with network, disk and clock simulated from a seedrare interleavings, reproducible from the seedFoundationDB, TigerBeetle
chaos engineeringa running deployment, with injected failuresoperational gaps: missing timeouts, unsafe failoverNetflix’s Chaos Monkey and successors

TLA+. Newcombe and colleagues report that engineers at AWS wrote TLA+ specifications for core parts of S3, DynamoDB and other services, and that model checking found subtle bugs that reviews and tests had missed, including one requiring a trace of 35 steps (15). A TLA+ specification is the level of the pseudocode in these notes: the proofs of Module 7 are the kind of invariant TLC checks on small instances.

Jepsen and Elle. Jepsen runs a real cluster, injects partitions, crashes and clock changes, records every client operation with its start and end time, and then checks the history. For single objects it searches for a linearization (Knossos); Elle infers transactional anomalies from the dependencies between operations. This is Definition 3.18 used as a test oracle.

Porcupine for the course project. Porcupine is a fast linearizability checker in Go: you give it a sequential model of the object (for a KV store: a map with put, get, append) and a concurrent history of calls with invocation and response times, and it decides whether the history is linearizable. Logging every Put and Get of a test run, including the ones that timed out (their response time is “unknown”, which Porcupine handles as possibly taking effect any time later), turns a flaky “the value looks wrong” into a definite counterexample.

Deterministic simulation. FoundationDB runs the whole cluster in one thread on a simulated network, disk and clock, driven by a random seed, and injects failures far more often than reality does (12). Every failure is reproducible from its seed. The Ready design of etcd/raft supports the same style: since the library does no I/O and no clock reads of its own, a test can drive several nodes deterministically.

Deep dive: one Put end to end

The question is what happens, layer by layer, when a client of the course project calls put("x", "8"), and which result from the notes each step relies on.

We take a three-server cluster A, B, C with A leader of term 2 and all logs equal up to index 6 (A’s no-op of term 2 is at index 6 and committed). The client has clientId 7; its previous call had requestId 41.

client leader A A's WAL B C 1 Put(x, 8, client 7, req 42) deadline, same ids on retry: App. A fsync 2 append at index 7, fsync persist before send: M5 3 AppendEntries(prev 6, [7]) consistency check: M6, Log Matching 4 B fsyncs, replies match 7 C's reply lost: App. A commit 7 5 A and B: majority, term 2 commit rule: M6, M7 apply 7 6 42 > 41: run, record 42 dedup at apply: M6, App. A 7 reply ok to the client after apply: linearizable
Figure 3. One Put through the course project's stack. Each numbered step on the right names the module or appendix result it depends on. The dashed lane is A's own disk. C's reply is lost (cross), which does not delay the commit because A and B already form a majority.
StepWhat happensLayer and toolRelies onIf skipped
1client stub sends KeyValue(x, 8, 7, 42) with a 0.5 s deadlinegRPC stub, HTTP/2Proposition A.1, retry semantics Definition 3.2no deadline: a call to a dead leader hangs; new id per retry: x written twice for a non-idempotent op
2A appends (term 2, put x 8, 7, 42) at index 7 and fsyncs its WALReady step 1, WALFigure 2’s persistence; Leader Append-Only (Proposition 6.7)A crashes, restarts without index 7, yet B counted it: the majority A, B is fictitious
3A sends AppendEntries(term 2, prev 6, term 2, [entry 7], commit 6)Ready step 2, gRPCconsistency check (Lemma 6.5), Log Matching (Theorem 7.3)no check: B could append 7 after a different 6
4B passes the check, fsyncs, replies success; A sets matchIndex[B] = max(6, 7)B’s Ready looppersist before reply; Proposition A.11B replies before fsync: a crash loses an acknowledged entry
5index 7 is on A and B, has term 2 = currentTerm: commitIndex := 7Raft corecommit rule (Definition 6.8), Leader Completeness (Theorem 7.4)counting an old-term entry: the Figure 8 trap (Figure 7.2)
6A applies 7: request 42 > 41, so run x := 8, record (7, 42, ok)Ready step 3, state machineState Machine Safety (Theorem 7.7); Proposition A.8dedup at receive time instead: a retry appended at index 8 would run again
7servicer replies with success=TruegRPC servicerlinearizability of writes (Module 6)replying at step 2: the client sees success for an entry a new leader may erase

Three variations, each checkable against the table.

  • The reply of step 7 is lost. The client times out and re-sends request 42, perhaps to B after A crashed. B, if elected, holds index 7 (Leader Completeness), commits its own no-op, and appends the retried command at a new index. When it applies that entry, the dedup table already says “client 7: 42”, so x := 8 does not run again, and B returns the recorded reply. The client cannot tell whether its first or second attempt took effect, and need not.
  • A is a stale leader. If A had been partitioned and B elected in term 3, A’s AppendEntries of term 2 gets replies with term 3; A steps down and never reaches step 5 (Proposition 5.12). The client’s deadline expires and it retries elsewhere.
  • A Get(x) right after step 7. If A serves it by ReadIndex, part 1 of Proposition B.1 gives , so the read returns 8. If A served it from memory without the heartbeat round, it could be a deposed leader returning an older value.

Choosing a tool

The question is which of these tools to reach for. A rough decision procedure:

What do you need?
 |
 +-- a lock, leader election or small config shared by services?
 |      -> call a coordination service: etcd, ZooKeeper, Consul
 |         (and fence every resource the lock protects)
 |
 +-- your own service must replicate its own state consistently?
 |      -> embed a Raft library: etcd/raft, hashicorp/raft,
 |         Ratis (JVM), raft-rs or openraft (Rust)
 |
 +-- a high-throughput, replayable event log between services?
 |      -> Kafka (or Pulsar, NATS JetStream); order only per partition
 |
 +-- a key-value store that stays writable during partitions?
 |      -> Cassandra / Dynamo-style quorums; accept LWW or merge conflicts
 |
 +-- SQL transactions across regions?
        -> Spanner, CockroachDB, or similar: consensus per range
           plus a transaction protocol and careful clocks

The first branch deserves emphasis: most systems that “need consensus” need it only for a small amount of coordination state, and calling a service is far less work than embedding a library. Embedding is for the case where the replicated state is the product (a database, a queue, a configuration store).

What breaks

  • Code outside the log. The safety theorems of Modules 5 to 9 cover only operations that go through the replicated log. A read answered from a leader’s memory without ReadIndex, a lease used without fencing, or an action on an external system taken “while holding the lock” falls outside them and needs its own argument (Proposition B.1, Proposition B.5).
  • Clocks. Lease reads and leases in general rest on Definition B.3. A stepped clock, a virtual machine paused and resumed, or a process paused between check and action breaks them. Fencing tokens and Raft terms do not depend on clocks; everything else does.
  • Storage that lies. An fsync that returns before the data is durable, or a failed fsync that is retried and ignored, silently removes a vote or an acknowledged entry; the protocol then runs on false premises.
  • Gossip treated as consensus. Membership views from SWIM may differ between members. Using them to decide quorums or ownership without a consensus step can produce two owners.
  • Non-majority replication. Kafka’s ISR, Dynamo’s sloppy quorums and Cassandra’s consistency level ONE trade the intersection argument for availability or latency. They are correct designs only together with their extra mechanism (a consensus-backed controller, hinted handoff, read repair), and only for the guarantee they actually promise.
  • Byzantine faults. Every tool in this appendix assumes crash faults. A buggy or compromised member that lies about terms, tokens or stored data is outside all of these guarantees.

Why it matters

The modules proved that a handful of rules (one vote per term, the consistency check, the current-term commit rule, persist before reply, deduplicate at apply) make a replicated log safe. This appendix showed where those rules live in real code: in the order of the four steps of an etcd/raft Ready loop, in clientId and requestId of a protobuf message, in a HardState record, in a Kafka producer’s sequence numbers. It also showed the three places where production systems step outside the log and need new arguments: reads (ReadIndex, proved linearizable from Leader Completeness), leases (safe only under a clock model and only for decisions), and fencing (safe under any timing, because it replaces time by a counter that consensus keeps increasing). With these, the theory of the course is enough to read the design documents of etcd, ZooKeeper, Kafka, Spanner and CockroachDB, and to know which of their claims rest on proofs and which on clocks.

Further reading

  • Ongaro’s thesis, chapter 4 (membership changes), chapter 5 (log compaction), chapter 6 (clients, §6.4 on ReadIndex and lease reads), §9.6 (PreVote) and chapter 10 (implementation and performance) (1).
  • The Chubby paper, especially its sections on sequencers and lock-delay, the original production treatment of stale lock holders (2); Kleppmann’s essay on distributed locking for the fencing-token argument (14); Gray and Cheriton for leases (13).
  • ZooKeeper (3) and Zab (4) for a coordination service built on total order broadcast.
  • Spanner (5) and CockroachDB (11) for consensus per range with clocks; the hybrid logical clocks paper (10).
  • Dynamo (6), Cassandra (7) and Kafka (8) for the systems that do not use a majority quorum for their data; SWIM (9) for membership.
  • Newcombe and colleagues on TLA+ at AWS (15); the FoundationDB paper on deterministic simulation testing (12). Documentation worth reading next to this appendix: the README of go.etcd.io/raft/v3 (the Ready contract), the etcd API guarantees page, the Kafka design documentation (replication and the ISR), and the Jepsen analyses at jepsen.io.
1.
Ongaro D. Consensus: Bridging Theory and Practice [phdthesis]. Stanford University; 2014.
2.
Burrows M. The Chubby Lock Service for Loosely-Coupled Distributed Systems. In: Proceedings of the 7th USENIX Symposium on Operating Systems Design and Implementation (OSDI). 2006. p. 335–50.
3.
Hunt P, Konar M, Junqueira FP, Reed B. ZooKeeper: Wait-free Coordination for Internet-scale Systems. In: Proceedings of the 2010 USENIX Annual Technical Conference (USENIX ATC). 2010.
4.
Junqueira FP, Reed BC, Serafini M. Zab: High-performance Broadcast for Primary-backup Systems. In: Proceedings of the 41st IEEE/IFIP International Conference on Dependable Systems and Networks (DSN). 2011. p. 245–56.
5.
Corbett JC, Dean J, Epstein M, Fikes A, Frost C, Furman JJ, et al. Spanner: Google’s Globally-Distributed Database. In: Proceedings of the 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI). 2012. p. 251–64.
6.
DeCandia G, Hastorun D, Jampani M, Kakulapati G, Lakshman A, Pilchin A, et al. Dynamo: Amazon’s Highly Available Key-value Store. In: Proceedings of the 21st ACM Symposium on Operating Systems Principles (SOSP). 2007. p. 205–20.
7.
Lakshman A, Malik P. Cassandra: A Decentralized Structured Storage System. ACM SIGOPS Operating Systems Review. 2010;44(2):35–40.
8.
Kreps J, Narkhede N, Rao J. Kafka: A Distributed Messaging System for Log Processing. In: Proceedings of the 6th International Workshop on Networking Meets Databases (NetDB). 2011.
9.
Das A, Gupta I, Motivala A. SWIM: Scalable Weakly-consistent Infection-style Process Group Membership Protocol. In: Proceedings of the International Conference on Dependable Systems and Networks (DSN). 2002. p. 303–12.
10.
Kulkarni SS, Demirbas M, Madappa D, Avva B, Leone M. Logical Physical Clocks. In: Principles of Distributed Systems (OPODIS 2014). Springer; 2014. p. 17–32. (Lecture Notes in Computer Science; vol. 8878).
11.
Taft R, Sharif I, Matei A, VanBenschoten N, Lewis J, Grieger T, et al. CockroachDB: The Resilient Geo-Distributed SQL Database. In: Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data. 2020. p. 1493–509.
12.
Zhou J, Xu M, Shraer A, Namasivayam B, Miller A, Tschannen E, et al. FoundationDB: A Distributed Unbundled Transactional Key Value Store. In: Proceedings of the 2021 International Conference on Management of Data (SIGMOD). 2021. p. 2653–66.
13.
Gray CG, Cheriton DR. Leases: An Efficient Fault-Tolerant Mechanism for Distributed File Cache Consistency. In: Proceedings of the 12th ACM Symposium on Operating Systems Principles (SOSP). 1989. p. 202–10.
14.
Kleppmann M. How to do distributed locking [Internet]. Blog post; 2016. Available from: https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html
15.
Newcombe C, Rath T, Zhang F, Munteanu B, Brooker M, Deardeuff M. How Amazon Web Services Uses Formal Methods. Communications of the ACM. 2015;58(4):66–73.
16.
Herlihy MP, Wing JM. Linearizability: A Correctness Condition for Concurrent Objects. ACM Transactions on Programming Languages and Systems. 1990;12(3):463–92.