04 / 25 · Reliability

Fault tolerance

Fault tolerance is the ability to keep required behavior correct when specified components fail. Name the failure you tolerate and the degraded behavior you allow. It is not a claim of immunity to every possible fault.

What you will practise

  • Name the tolerated fault
  • choose safe degradation
  • handle unknown write outcomes

Before you start: Timeout, request deadline and side effect.

About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand fault tolerance. A bicycle with a spare light can still be seen when the main light breaks. But that spare light cannot fix a broken frame. A useful plan names the fault and the remaining safe behavior. A website might keep showing events when its recommendation feature fails while refusing to sell a seat it cannot confirm. Fault tolerance is the ability to keep required behavior correct when specified components fail. Name the failure you tolerate and the degraded behavior you allow. It is not a claim of immunity to every possible fault.

Follow the normal path. The event page needs correct booking information, but recommendations are optional. Give these paths different deadlines and resource budgets. Recommendations stop responding. Without a boundary, waiting calls can consume all connections or workers and affect otherwise healthy operations. A slow optional recommendation service should not use every request thread and prevent checkout. SeatSpot isolates optional work and keeps a safe core path instead of treating every dependency as equally critical.

Now change one condition. The timeout guard ends waiting for optional work. This protects local resources but does not prove a remote write was cancelled or never happened. A common misunderstanding is this: A timeout means the remote action did not happen. A timeout describes your observation, not the remote side effect. Think about this. A payment call times out. Is it safe to retry with a fresh order ID? Pause the video and make your prediction. No. The first charge may have succeeded. Reuse a stable idempotency identity and reconcile the unknown outcome.

Let us reason with a concrete example. A page fans out to three optional services with an overall 800 ms deadline. One dependency stalls for ten seconds. A 200 ms dependency timeout can preserve some page budget, but sequential calls, retries and rendering time must also fit inside 800 ms. Timeouts are not independent free budgets. Return the essential event page without recommendations; keep seat reservations and payment outcomes authoritative. Isolate resource pools so optional failures cannot consume core capacity. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. Render the essential page without suggestions. Do not turn an uncertain payment outcome into a success message just to make the page appear healthy. If a retry is appropriate, limit attempts and use backoff with jitter. Preserve one operation identity for side effects so retries do not create duplicate business actions. When you try the practice task, look for this result. Recommendations can be omitted; a confirmed payment must not be invented.

Check your understanding. Inject a slow response and a lost reply in a safe test environment. Verify core capacity and user-visible correctness rather than only testing a clean server shutdown. Here is a challenge. The payment provider times out after you send a charge. What should the booking UI say and what should the backend do? Pause before the answer. Show a pending/unknown outcome rather than success or automatic failure. Reconcile by the same idempotency key/provider reference and update the order state. Avoid issuing a new independent charge. For an interview, bound retries, cancellation and concurrency independently. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A bicycle with a spare light can still be seen when the main light breaks. But that spare light cannot fix a broken frame. A useful plan names the fault and the remaining safe behavior. A website might keep showing events when its recommendation feature fails while refusing to sell a seat it cannot confirm.

Why SeatSpot needs this

A slow optional recommendation service should not use every request thread and prevent checkout. SeatSpot isolates optional work and keeps a safe core path instead of treating every dependency as equally critical.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

Event pageCore bookingRecommendationsTimeout guardFallback view

Step 1 of 6 · Classify critical dependencies

Separate essential work

The event page needs correct booking information, but recommendations are optional. Give these paths different deadlines and resource budgets.

Read all six mechanism steps
  1. Separate essential work

    The event page needs correct booking information, but recommendations are optional. Give these paths different deadlines and resource budgets.

  2. An optional call stalls

    Recommendations stop responding. Without a boundary, waiting calls can consume all connections or workers and affect otherwise healthy operations.

  3. Enforce a deadline

    The timeout guard ends waiting for optional work. This protects local resources but does not prove a remote write was cancelled or never happened.

  4. Degrade honestly

    Render the essential page without suggestions. Do not turn an uncertain payment outcome into a success message just to make the page appear healthy.

  5. Bound retries

    If a retry is appropriate, limit attempts and use backoff with jitter. Preserve one operation identity for side effects so retries do not create duplicate business actions.

  6. Test partial failure

    Inject a slow response and a lost reply in a safe test environment. Verify core capacity and user-visible correctness rather than only testing a clean server shutdown.

Pause and make a prediction

A payment call times out. Is it safe to retry with a fresh order ID?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: A timeout means the remote action did not happen.

Better explanation: A timeout describes your observation, not the remote side effect.

Classify failure responses

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. List event browsing, recommendations and seat purchase.
  2. Give each an explicit acceptable degraded behavior.
  3. Fit dependency timeouts and bounded retries inside one request deadline.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

The payment provider times out after you send a charge. What should the booking UI say and what should the backend do?

Check one key idea

A timed-out charge means:

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.