Skip to content

Consistency & Time

Once data is copied to several nodes, “what does a read return?” stops having a single answer. It depends on what the system promises, on whether the network is working, and on whose clock you ask. This module is about the promises, what they cost, and why a timestamp from another machine cannot be trusted to say what came first.

You will work with a partition simulator in two modes: one where you cut the network between two nodes and choose how each answers, and one where you skew a clock and compare physical timestamps with Lamport and vector clocks.

  1. Consistency models: what a read may return (18 min). Linearizable, sequential, causal, read-your-writes and eventual consistency, and a sorting exercise.
  2. CAP stated precisely, and PACELC (24 min). What the theorem says, the three ways a node can answer during a cut, and the latency price when nothing is broken.
  3. Physical clocks and clock skew (18 min). Why timestamps from different machines mislead, and what last write wins loses.
  4. Logical clocks: Lamport and vector clocks (22 min). Ordering by cause and effect, and telling a cause from a concurrent event.
  5. Recap and quiz (12 min). The module in one page, a checklist, and a quiz.
  • Name the weakest consistency model that keeps a feature correct.
  • State CAP with its definitions, and say what a system gives up during a cut.
  • Predict when sorting by timestamp puts an effect before its cause.
  • Read a Lamport clock and a vector clock, and tell a cause from a concurrent event.

All the numbers in the labs are illustrative. They are for comparing choices, not for forecasting any real product.

Built by GhaziAlibi.

© ShardCraft. All rights reserved.