Skip to content

Failure engineering: recap and quiz

  1. Cascading failures. A failure that makes more failures likely: lose one of three instances at 900 requests a second and the two that remain are at 113%, the queue outgrows the clients’ patience, and 71% of the requests fail.
  2. Overload, backpressure and load shedding. Only capacity raises how much succeeds; shedding and backpressure choose which work is refused and keep the rest timely, and adding capacity at the first bottleneck moves the bottleneck.
  3. Dependency failures. A dead component fails the requests whose path goes through it, 26% in the shop, and a cache, a replica or a default turns some of those paths into paths that do not.
  4. Gray failures. A dependency that is slow and not dead passes its health check, keeps its callers waiting and multiplies the calls to it, so it does more damage than a dead one.
  5. Disaster recovery. The recovery time objective and the recovery point objective are separate numbers, each bought with money or latency, and a plan that has not been exercised has guessed numbers.
  6. Failure injection and chaos experiments. Cause the failure on purpose, with a hypothesis, a small blast radius and a stop condition, and measure enough to see what you are losing.
Idea How it goes wrong What you see What helps
Cascade The survivors cannot carry the load, and the queue holds requests longer than clients wait Work spent on answers nobody reads, and failures near 100% Spare capacity for the failures you expect, cheaper work, a deadline
Overload More work than capacity, and the only response is to wait A long queue and late answers Shed early, throttle senders, add capacity along the whole path
Dependency A hard dependency with no way round The requests that need it fail A replica, more caching, a defined core function
Gray failure The check sees healthy while the callers see slow The same failures as a dead dependency, with long waits and doubled load Measure what callers feel, bound the wait, limit the retries
Disaster recovery Unstated or untested objectives A recovery slower or lossier than anyone expected Set RTO and RPO per system, back up, exercise the restore
Chaos experiment A steady state that does not measure what matters A green dashboard on a system that is losing data A small blast radius, a stop condition, more measures

A checklist for reviewing a design against failure

Section titled “A checklist for reviewing a design against failure”

Each question points back to the lesson that answers it.

  1. If one instance, zone or node is lost, can the rest carry the traffic? Divide the capacity that remains by the load. (Cascading failures)
  2. How long can a request wait in your queues, and how long will the client? A queue longer than the client’s patience turns an overload into wasted work. (Cascading failures)
  3. When more arrives than you can serve, what is refused, by whom, and what do the senders do? (Overload, backpressure and load shedding)
  4. If you scale the first component, which one is next? (Overload, backpressure and load shedding)
  5. Which share of requests depends on each component, and what is the core function without it? (Dependency failures)
  6. Does each timeout exceed the latency you can see in a bad hour, and what does each retry add to the load? (Gray failures)
  7. Does a health check measure what the callers experience? (Gray failures)
  8. What are the RTO and RPO of each system, and when did you last restore a backup or run the failover? (Disaster recovery)
  9. For the next experiment, what are the steady state, the hypothesis, the blast radius and the stop condition? (Failure injection and chaos experiments)

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

Failure engineering: module quiz

This quiz needs JavaScript to check your answers.

Question 1 of 8

A service has 5 instances that each serve 300 requests a second. 1,100 requests a second arrive. One instance dies.

At what percentage of its capacity do the remaining instances run?

Enter a number and choose its unit.

%
Question 2 of 8

A service is at 113% of its capacity. Its queue grows until a request waits longer than its client's timeout of 1 s, and the service keeps serving the queue in order.

What is the effect?

Choose one answer.

Question 3 of 8

The traffic is five times the capacity of the API. A team adds a deadline that drops any request that would wait more than 200 ms.

What changes the most?

Choose one answer.

Question 4 of 8

10% of a service's requests are writes that always need the database. The other 90% are reads that a cache answers 90% of the time, going to the database on a miss.

The database dies. What share of the requests fails?

Enter a number and choose its unit.

%
Question 5 of 8

A database takes 800 ms for queries that used to take 80 ms. Its health check, which opens a connection, passes. The callers wait 300 ms and give up.

What kind of failure is this?

Choose one answer.

Question 6 of 8

A load balancer waits 400 ms for an API instance and retries once. A network fault adds 500 ms to the link. The API answers every request correctly.

What happens?

Choose one answer.

Question 7 of 8

In a failover test the primary is killed. Writes fail for 30 seconds, and 23 writes that were acknowledged are missing from the promoted replica.

Which figure is the recovery time and which is the recovery point?

Choose one answer.

Question 8 of 8

A chaos experiment cuts the link between a primary and its replicas for 30 seconds. The steady state is the error rate, and no request fails.

What should the team conclude?

Choose one answer.

The reliability module before this one gives the tools a service uses to protect itself from a failing dependency: timeouts, retries with backoff and jitter, circuit breakers and bulkheads. This module measured what happens without them, in a lab that has none. The next module takes the failure of a whole region and the data and traffic questions that come with running in several.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.