LearnastraTHE DESIGN COURSE

Understand the building blocks / CHAPTER 18

PACELC: normal-operation latency trade-offs

Compare what reads and writes wait for during normal communication, then define their behavior when communication fails.

Advanced1h of deliberate study10 questions

Builds on CAP: consistency and availability during partitions, Redundancy and replication.

By the end, you can
  • Read PACELC as two conditional questions.
  • Trace local and coordinated replicated operations.
  • Avoid treating PACELC labels as complete product specifications.

01Ask a second question while the network works

Nia changes her public display name at East. West has not received the change yet, even though the network is working. Should a West read wait, or may it briefly show the earlier name?

CAP addresses a limit during broken communication. PACELC adds a question about ordinary operation:

  1. If there is a Partition, ask which operations can remain Available and which Consistency promise they keep.
  2. Else, while communication works, ask how the required Consistency changes Latency: the elapsed time before the caller gets a result.

The letters form a discussion framework, not a complete database specification. Name the operation and follow its messages. A database label supplies neither its exact delay nor every configuration’s guarantee.

For this example, Nia’s change produces profile version 8; West still has version 7. For this exercise, a public avatar copy may be reused for 30 seconds after a successful refresh from East. Private-document reads instead check the saved access grant; a completed revocation must be reflected by that check.

  • West can return its avatar copy while that refresh age is within 30 seconds. Once it expires, West refreshes from East or returns an unavailable response.
  • Before returning private bytes, the service reads the account’s grant through the permission store’s linearizable read. That read must reflect completed revocations; a cached older grant cannot replace it.
  • Some operations can combine independent changes without the same coordination as an exclusive claim. Do not assume every stronger guarantee has one universal communication cost.

02Trace a normal update before discussing failure

Assume a cross-region round trip takes 80 ms for this exercise. That is a planning input, not a production measurement.

Trace local acceptance:

  1. East safely saves version 8.
  2. East reports success before West receives it.
  3. A West read can still return 7 if its stated freshness rule allows that result.

Trace a more coordinated path:

  1. In this one-writer example, East accepts profile changes and sends version 8 to West.
  2. West saves and applies 8, then replies with that applied version. Merely receiving bytes would not make its normal queries show the change.
  3. East waits for that reply before acknowledging the update. A subsequent West query can now observe 8; the client paid the remote waiting cost to obtain this read-after-write behavior.
  4. Count the actual exchanges, processing, and queueing. The assumed 80 ms round trip does not mean every coordinated operation adds exactly 80 ms, or that this short trace implements every rule needed for global linearizability.

A request can also require a minimum version without demanding a globally current read for every user:

  1. East’s update response gives Nia version 8.
  2. Nia’s next read asks for “at least version 8.” This number is a freshness requirement, not permission to read private data.
  3. The read handler checks the replica’s applied version. If it is 7, wait within the caller’s deadline or route to a source whose applied version is at least 8. If neither is possible, return an unavailable response; do not return 7 as success.
  4. If another user later completes version 9, a minimum-8 request alone does not demand 9. The guarantee is narrower than one current order respected by every client.

For every path, state the source, the required state, the communication needed, and the failure response.

03Apply both branches to one user promise

Apply both branches to the two profile operations.

While communication works

  • West may reuse its public avatar copy for 30 seconds after the last successful refresh from East. Nia’s edit can therefore appear later at West.
  • A private-document read asks the permission store whether this account’s grant is active, using the linearizable read described above. Waiting for that answer adds delay and makes the permission store necessary for completion.
  • A minimum-version request must meet that explicit version even if an ordinary avatar read would allow an older one.

When communication fails

  1. Identify which source or permission check is unreachable.
  2. Serve West’s public avatar only while its last successful refresh is at most 30 seconds old. If the copy expires and East cannot be reached, return unavailable instead of reusing it indefinitely.
  3. If the permission-store read does not complete within the request’s deadline, refuse the protected read without returning bytes. An old cached grant does not answer whether access was revoked.
  4. If local updates may still complete, save them and define how conflicting accepted changes are combined or resolved after reconnection.

Verify ordinary delay as well as disconnection:

  • Inject delay into the actual coordination path, not only a local test endpoint.
  • Measure the entire user operation, including catching up, redirects, and retries.
  • Check the response when the required version does not arrive before the deadline.
  • Reconnect regions that accepted different changes and inspect the combined result.

PACELC is useful when it connects a promised observation to an actual request path and exposes what that path costs on a healthy network.

PACELC has a failure branch and a normal branch

PACELC has a failure branch and a normal branchName the read or write and what its caller must observe. While communication works, trace local and coordinated paths and measure their waiting. When communication fails, specify the allowed result or wait/refusal behavior. Numbered arrows correspond to the connection key below. All connections are directional.Network conditionFor one namedoperationPartitionedWhich requests canstill complete?CommunicatingWhat must requestswait for?Failure policyLocal completion ORrequired wait/rejectLocal pathAvatar copy: refreshage at most 30sCoordinated pathCheck applied versionor active grant12345PACELC has a failure branch and a normal branchName the read or write and what its caller must observe. While communication works, trace local and coordinated paths and measure their waiting. When communication fails, specify the allowed result or wait/refusal behavior. Numbered arrows correspond to the connection key below. All connections are directional.Network conditionFor one namedoperationPartitionedWhich requests canstill complete?CommunicatingWhat must requestswait for?Failure policyLocal completion ORrequired wait/rejectLocal pathAvatar copy: refreshage at most 30sCoordinated pathCheck applied versionor active grant12345PACELC has a failure branch and a normal branchName the read or write and what its caller must observe. While communication works, trace local and coordinated paths and measure their waiting. When communication fails, specify the allowed result or wait/refusal behavior. Numbered arrows correspond to the connection key below. All connections are directional.Network conditionFor one namedoperationPartitionedWhich requests canstill complete?CommunicatingWhat must requestswait for?Failure policyLocal completion ORrequired wait/rejectLocal pathAvatar copy: refreshage at most 30sCoordinated pathCheck applied versionor active grant12345

Follow the numbered arrows

  1. Network condition → Partitionedif required messages unavailable
  2. Network condition → Communicatingelse
  3. Partitioned → Failure policychoose behavior per promise
  4. Communicating → Local pathwhen contract permits
  5. Communicating → Coordinated pathwhen guarantee requires
First name one operation and its promised observation. While the network works, compare the local path with the messages required by a more coordinated path. When communication fails, state which operations complete and which wait or refuse.
Trace the diagram in words
  1. Name the read or write and what its caller must observe.
  2. While communication works, trace local and coordinated paths and measure their waiting.
  3. When communication fails, specify the allowed result or wait/refusal behavior.

DRAW. CALCULATE. EXPLAIN.

Compare avatar and revocation reads

20 minutes · guided practice

East saves profile version 8 while West still has 7. The link first becomes slow, then stops carrying required messages.

  1. Define a public-avatar policy that allows brief staleness.
  2. Define the behavior of a request explicitly requiring at least 8.
  3. Define a private-document read that must establish current permission.
Your self-check
Compare the worked solution
  1. Use the exercise’s 30-second reuse limit measured from the last successful refresh from East. West can return that copy within the limit; after expiry, it refreshes or returns unavailable. The choice permits some old avatar reads while avoiding remote waiting on every hit.
  2. A minimum-8 request checks the source’s applied version. Wait within the deadline for at least 8, route to another source known to have applied at least 8, or return unavailable; 7 is not a successful result.
  3. For the private document, read this account’s active grant through the permission store’s linearizable read. If that read is slow, wait only within the request deadline. If isolation prevents it from completing, return no protected bytes; a cached grant cannot substitute for a revocation-aware read.
  4. Measure each complete path, including version waiting and redirection. The number of copies alone establishes neither response time nor freshness.

The checkboxes record your own assessment. The worked solution gives you a way to check the reasoning.

RETRIEVE BEFORE YOU REVEAL

Keep the important ideas.

Say the answer aloud, then turn the card over.

CARD 01What does PACELC ask?
  1. During a partition, ask which requests complete and what consistency they retain.
  2. During normal communication, identify the messages needed for the promised observation.
  3. Measure how waiting for those messages changes the whole operation’s response time.
CARD 02What does a minimum-version token do?
  1. The update returns version 8.
  2. The next request asks for at least 8.
  3. Check the chosen replica’s applied version. At 7, wait or route to a replica that has applied at least 8; otherwise return unavailable before the deadline.

This does not automatically require every client to see the latest globally completed update.

CARD 03How do I choose per operation?
  • An older public avatar can be acceptable within its age limit.
  • An old access grant after revocation can disclose private bytes.

Choose the read source and failure behavior from that consequence, then measure the complete request.

Practise this topic in the revision deck ↗

CHECK THE REASONING

Can you explain the choice?

Answer every question, then finish for an immediate score and an explanation for each answer. Aim for 80%, then revisit any gaps.

1 / 10Nia writes version 8 locally; West remains at 7. What may an unconstrained West read return?
2 / 10A request carries minimum version 8 but the replica has 7. What satisfies the contract?
3 / 10Assume regional RTT 80 ms. What can you infer about a coordinated write?
4 / 10An isolated region cannot verify a revoked document grant. Which branch decision matters?
5 / 10What does PACELC’s else branch emphasize?
6 / 10Does read-after-write for Nia automatically imply global linearizability?
7 / 10Why can avatar and permission reads use different paths?
8 / 10Which missing specification would make a “low-latency PACELC” claim assessable?
9 / 10What should normal-operation tests include in addition to disconnection?
10 / 10Local updates continue on both sides of a partition. What must the design still define?
0 of 10 answered

CLOSE THE LOOP

Explain it without the page.

Summarise the mechanism, one trade-off, and one failure mode. Then mark this chapter complete.

Go to the source