What if your favorite app never crashed, even when something went wrong behind the scenes?
Why Redundancy and fault tolerance in HLD? - Purpose & Use Cases
Imagine running a busy online store where a single server handles all customer orders. If that server crashes, the whole store goes offline, and customers can't buy anything.
Relying on just one server means if it fails, the entire system stops working. Fixing it takes time, causing lost sales and unhappy customers. Manually switching to backups is slow and error-prone.
Redundancy and fault tolerance add backup servers and smart systems that automatically take over if one fails. This keeps the store running smoothly without interruptions, even during failures.
single_server = Server() process_orders(single_server)
servers = [Server(), Server()] active_server = choose_active(servers) process_orders(active_server)
It enables systems to keep working seamlessly, even when parts fail, ensuring users never notice a problem.
Big websites like Amazon use multiple servers worldwide so if one data center has issues, others handle the traffic without downtime.
Single points of failure cause big problems.
Redundancy adds backups to prevent downtime.
Fault tolerance ensures smooth automatic recovery.
Practice
Solution
Step 1: Understand redundancy concept
Redundancy means having extra components or backups so if one fails, the system still works.Step 2: Identify the main goal of redundancy
The goal is to avoid single points of failure by having backups ready.Final Answer:
To have backup components to avoid single points of failure -> Option CQuick Check:
Redundancy = Backup components [OK]
- Confusing redundancy with performance improvement
- Thinking redundancy reduces cost
- Assuming redundancy simplifies architecture
Solution
Step 1: Identify fault tolerance features
Fault tolerance means the system can keep working even if some parts fail.Step 2: Evaluate options for fault tolerance
A load balancer sends traffic to multiple servers, so if one fails, others handle requests.Final Answer:
A load balancer distributing traffic to multiple servers -> Option AQuick Check:
Fault tolerance = multiple servers with load balancer [OK]
- Choosing single server as fault tolerant
- Ignoring replication or backups
- Confusing fault tolerance with error shutdown
Solution
Step 1: Understand active-active mode
In active-active, both servers handle requests simultaneously to share load and provide backup.Step 2: Analyze failure impact
If one server fails, the other continues handling all requests without interruption.Final Answer:
Requests are automatically handled by the remaining active server -> Option DQuick Check:
Active-active means failover to active server [OK]
- Thinking requests are lost on failure
- Assuming system queues requests indefinitely
- Believing system shuts down on failure
Solution
Step 1: Identify fault tolerance problem
Fault tolerance requires backups or replicas to continue working if one fails.Step 2: Analyze the system setup
Single database without replication means no backup exists to handle failure.Final Answer:
No backup database to take over on failure -> Option BQuick Check:
No replication = no fault tolerance backup [OK]
- Confusing replication with too many replicas
- Blaming load balancer for database crash
- Thinking redundancy causes delays here
Solution
Step 1: Understand availability requirement
The service must stay available even if one entire data center fails.Step 2: Evaluate design options for fault tolerance
Deploying in two separate data centers with data replication ensures if one fails, the other serves requests.Step 3: Compare other options
Single data center or single server cannot handle full data center failure; daily backups do not provide immediate availability.Final Answer:
Deploy the service in two geographically separate data centers with data replication -> Option AQuick Check:
Geo-redundancy + replication = high availability [OK]
- Relying on single data center for fault tolerance
- Confusing backup power with data center failure protection
- Thinking daily backups ensure immediate availability
Ready to prove it?
Pass the test and this pattern moves unknown
