LESSON 09 · Operate the system

Test the promises under failure

Routing, convergence, and durability must remain observable under stress.

SYSTEM VIEW

The storage path

Diagram view
Quorum ops—
Hint backlog—
Rack load—

Watch a fault drill on three racks show what keeps working, what slows down and what fails loudly.

  1. Clients send peak traffic, 60% of each rack’s capacity. Each second Monitoring writes a canary key through the Coordinator and reads it back from every rack: all three return it 1 s old. A green get() latency chart could hide a rack that hasn’t converged.

    Canary
    written each second
    Read back
    from all 3 racks
    Also watch
    p99, hints, repair age

    What changed

    • Canary key each second
    • Canary age per rack: 1 s
  2. The drill stops Rack 1 at peak. With N = 3 and W = R = 2, Racks 2 and 3 still answer every read and write, though tail latency (p99) may rise. The Coordinator keeps hints for Rack 1, so the hint backlog grows.

    Acks
    2 of 3: W = 2 met
    Expect
    ok · slower p99 · hints
    Also drill
    partitions, membership, DC loss

    What changed

    • Rack 1 stopped
    • Hints for Rack 1
    • Quorum ops still ok
  3. While Rack 1 is stopped, its share of the traffic moves to Racks 2 and 3, so each carries 1.5 times its load: 60% becomes 90%. That holds. A rack running above about 66% would pass 100% during the drill and overload.

    Before
    60% a rack
    After
    60% × 1.5 = 90%
    Overloads above
    about 66%

    What changed

    • Racks 2 and 3: 60% → 90%
  4. Rack 1 returns behind the others. The Coordinator replays the hints it kept and repair catches up on anything they missed, until Rack 1’s canary is 1 s old again. The hint backlog drains to 0 and load falls back to 60% a rack.

    Hint backlog
    drains to 0
    Rack 1 canary
    1 s old again

    What changed

    • Rack 1 back
    • Hints for Rack 1
    • Load back to 60%
  5. Now the drill stops Racks 1 and 2. A write reaches only Rack 3, one ack where W = 2 needs two, so the Coordinator returns a clear error. It must not quietly accept fewer acks and tell the Clients ok.

    Acks
    1 of 3: W = 2 not met
    Expect
    clear errors, not W = 1

    What changed

    • Racks 1 and 2 stopped
    • Quorum ops fail
    • Clear error to Clients
  6. Racks 1 and 2 are back. A put applies but its reply times out, so the Clients retry with the same request ID, and the Coordinator doesn’t apply it twice. A cache-like value can accept eventual convergence; money and inventory need stronger coordination.

    Retry
    same request ID
    Cache-like value
    eventual is fine
    Money, inventory
    stronger coordination

    What changed

    • Racks 1 and 2 back
    • Retry with request ID 7
    • Put applied once

Space plays · ← → step · Home resets

THE IDEA

How it works

Measure tail latency (the slow end of the distribution, such as p99), unavailable operations, hot ranges, replica lag, hint backlog, repair age, compaction pressure, and capacity by failure domain. A green get() latency chart can hide a replica that has not converged, so measure freshness directly: for example, write a canary key each second and read it back from each replica.

Then test node loss, network partitions, membership changes, and data-center loss against the declared W/R policy. Take an example drill on N = 3, W = R = 2 across three racks. Stop one rack at peak. Reads and writes should keep succeeding, tail latency may rise, and the hint backlog should grow. Restore it, and the backlog should drain while repair catches up. Stop two racks, and quorum operations should fail with clear errors rather than quietly weaken. Capacity matters too: losing one of three racks gives each survivor 1.5 times its traffic, so racks running above about 66% utilization overload during the drill. Jepsen is a well-known tool for testing consistency claims under partitions.

Choose a policy for a real workload. A low-risk cache-like value may accept eventual convergence. Inventory reservations and money movement require stronger coordination and business invariants. Document retries and idempotency too: a timed-out put may still have applied, so a client that retries needs a request ID or conditional write to avoid duplicating the operation.

DECISION POINT

Normal latency is low but hint backlog grows for days. Is the system healthy?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Verify behavior during partitions and recovery, not only healthy throughput.
  • Tie consistency and durability to specific product invariants.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 2
DiagnoseQUESTION 01

A rack returned from a six-hour outage. Latency and error charts look normal, but some reads are stale. What should operators check first?

Choose an answer. You’ll see the explanation once you get it right.

Design a session store for a global website

Apply key-value replication to short-lived data where reads dominate and a logout must not be undone by replication.

The brief

A global website keeps a session record for each signed-in browser: user ID, roles, and expiry. Every authenticated request reads it. Sessions expire after inactivity, and a logout must take effect in every region within seconds. Losing a session is an annoyance, since the person signs in again; honoring a revoked one is a security problem. Keep password checks, multi-factor login, and account recovery outside this exercise.

  • 30 million people sign in each day. Each makes 200 authenticated requests a day, and each request needs its session once. Use decimal units and 86,400 seconds per day.
  • Peak traffic is 3 times the daily average. There are 3 regions, and the busiest carries 50% of traffic at peak.
  • Each person creates one session a day, and a session's expiry is refreshed at most once every 10 minutes while in use, about 6 refreshes per person per day. There are 10 million logouts a day.
  • A session expires 24 hours after its last use, giving about 1.5 live sessions per daily user. A session is 1 KB and a revocation record is 100 bytes. Plan 3 copies in each region. A store node holds 32 GB of session data and serves 100,000 reads per second.
  • Session checks must finish within 10 ms at p99 in the local region, and the farthest regions are 150 ms apart. A logout must take effect everywhere within 5 seconds in normal operation.

Reading a design isn’t the same as producing one under a clock. Try it timed: the requirement change stays hidden until partway through.

Loading your draft…

State your scope. Estimate average and peak session checks, the busiest region's peak, peak writes, live-session storage per region with copies, and the size of a day of revocation records. Keep units visible.

0 / 4,000 characters

Name the components and what each stores. Trace a sign-in, an authenticated request, and a logout. Choose W and R within a region, and say how data crosses regions.

0 / 4,000 characters

Explain what stops a delayed expiry refresh from undoing a logout, and how long deletion records must be kept. If a network partition cuts off a region, say whether it keeps accepting sessions it cannot check, and for how long.

0 / 4,000 characters

Respond to the log-out-everywhere change below. Name the data you add, what each request now does, and one cost of your approach.

The requirement changesAfter a password reset or suspected account takeover, security now requires revoking all of a person's sessions in every region within 5 seconds. Most people have one or two sessions, but some have dozens. Sessions are keyed by session ID, so the store cannot list a person's sessions. What do you add, and what does it cost on each request?

0 / 4,000 characters

Write an initial response in all four sections to unlock the checklist and two worked approaches.

0 of 2 checkpoints answered correctly to complete this lesson.