Skip to content

Reliability: recap and quiz

  1. Timeouts and retries. A timeout is the caller’s limit on waiting and does not say whether the work was done; a retry cures a brief failure and, in an outage, only adds load.
  2. Backoff and jitter. Waiting longer after each failure spaces the retries out, and jitter stops the clients that failed together from retrying together, without reducing the number of retries.
  3. Retry amplification and budgets. Retries at every layer multiply, up to 64 attempts for three layers of four, and a retry budget caps them at the price of requests that fail early.
  4. Circuit breakers. After enough failures in a row the breaker opens and fails calls at once, then lets one probe through to learn when the dependency is back.
  5. Bulkheads. A pool for each dependency keeps a silent one from using up the connections that the healthy ones need.
  6. Failover. When a component is lost another takes the work, after a detection delay, with enough spare capacity, and with care about state.
Idea What breaks What you see What helps
Timeout Too long, or too short Calls held for ever, or answers thrown away A limit read from a latency percentile
Retry Retried in an outage, or not safe to repeat Several times the traffic, or work done twice A limit, transient failures only, idempotent calls
Backoff Everyone waits the same time Waves of retries Jitter
Layers Every layer retries Attempts multiplied: 4 × 4 × 4 = 64 Retry at one point, and a retry budget
Breaker A bad threshold, or one breaker for several parts Healthy calls blocked, or no protection A threshold and a pause that fit the dependency, one breaker for each part
Bulkhead A pool that is too small, or none Refused calls, or one dependency using up the rest Sizing with Little’s Law, a timeout in each pool
Failover Slow to notice, or no spare capacity Failed requests, then overloaded survivors Faster checks, capacity for the loss of one, a rehearsal
  1. What is the timeout, and where does it come from? A percentile of the dependency’s latency, and the time the user has left. (Timeouts and retries)
  2. Is the failure transient, and is the call safe to repeat? If not, do not retry. (Timeouts and retries)
  3. How long does a retry wait, and is the wait random? Capped exponential backoff with jitter. (Backoff and jitter)
  4. How many layers retry? Multiply their attempts, and prefer one. (Retry amplification and budgets)
  5. What caps the retries as a whole? A budget, and what the caller does when it is empty. (Retry amplification and budgets)
  6. What happens after five failures in a row? A breaker, its pause, and what the caller returns while it is open. (Circuit breakers)
  7. What else does this dependency share with the others? A pool, threads, an instance: give each its own share. (Bulkheads)
  8. What takes over when it is lost, and how long does that take to notice? And can the survivors carry the load? (Failover)

Nine questions cover the whole module. Every option is explained, whether it is right or wrong.

Reliability: module quiz

This quiz needs JavaScript to check your answers.

Question 1 of 9

A client sends a payment request and hears nothing within its 2-second timeout.

What does the client know when the timeout runs out?

Choose one answer.

Question 2 of 9

Thirty requests a second call a dependency that has gone silent. The caller waits 3 s before it gives up and does not retry.

About how many requests are waiting at once, once the situation has settled?

Enter a number and choose its unit.

requests
Question 3 of 9

Three hundred clients lose their connection at the same moment. Each one retries after 1 s, then 2 s, then 4 s.

What does adding jitter to these waits change?

Choose one answer.

Question 4 of 9

A gateway, a service and a database client each make up to 5 attempts for the call below them (the first one and 4 retries), and a failed call is retried at once.

At most how many attempts at the database can one user request cause?

Enter a number and choose its unit.

attempts
Question 5 of 9

A circuit breaker is open. When its pause is over it lets one call through, and that call fails.

Which state does the breaker go to?

Choose one answer.

Question 6 of 9

A service allows itself at most 8 calls at once to a recommendations dependency. The dependency goes silent, and each call waits its 2 s timeout before it fails.

At most how many calls a second can start while the dependency is silent?

Enter a number and choose its unit.

calls a second
Question 7 of 9

Three servers share the load equally and each runs at 70% utilisation. One fails, and the load balancer stops sending it requests.

At what utilisation does each of the two that remain run, in per cent?

Enter a number and choose its unit.

%
Question 8 of 9

Calls to a dependency have failed ten times in a row, each after a full 5 s timeout, and 200 requests a second still go to it.

Which protection stops the wasted waiting first?

Choose one answer.

Question 9 of 9

A POST that creates an order times out, and the client library retries POST requests.

What makes the retry safe?

Choose one answer.

These protections limit the damage of one failure. The next module, failure engineering, looks at how failures spread from one component to the next, at overload and load shedding, and at how to test your protections on purpose. Rate limiting is the other side of the retry budget: a server saying how much it will accept. Ask this module’s questions first when you meet them: how long to wait, how many times to try, and what the caller does when the answer is no.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.