🛡️ System Design · System Building Blocks
Fault Tolerance
Continue or degrade safely when part of the system fails.
A single dependency should not unnecessarily take down everything.
If recommendations fail, the shopping cart can still work.
💡 Like a house with its lights on a separate fuse from the oven: if the oven trips, you are not left in the dark.
💡 Why it matters
In any real system, parts will fail: networks drop, services crash, databases slow down. Fault tolerance means a failure in one piece turns into a small, contained problem instead of a total outage. It is the difference between losing one feature for a moment and losing the whole product.
🛠️ How to achieve it
⚠️ Signs of trouble
- •One failing service takes the entire application down.
- •A slow dependency makes every request hang.
- •There is no fallback when a service is unavailable.
- •A retry storm makes a struggling service fail even harder.
🎯 Quick check
Score: 0/3Three questions to test the idea.
1. What does fault tolerance aim to do?
Answer: Keep working or degrade safely when a part fails
Failures are inevitable, so the goal is to contain them rather than let them become total outages.
2. The recommendations service fails. What is the fault-tolerant result?
Answer: The shopping cart still works without recommendations
A non-critical feature failing should be contained so the core experience keeps working.
3. Why set timeouts on calls to other services?
Answer: So a slow service does not make every request hang
A timeout caps the wait, so one struggling dependency cannot freeze the whole system.
