CLOUD CONCEPT

Fault Tolerance

Fault tolerance is the ability of a system to continue performing its intended function when one or more components fail.

Cloud Concepts Hub →

What is Fault Tolerance

Fault-tolerant systems use redundancy, failure isolation, and automated handling of faults to keep component failures from becoming service failures. In the cloud, this capability also determines which workloads can safely use interruptible compute capacity and which need a more predictable capacity strategy.

Fault tolerance means designing a system to continue operating despite specified component failures. The failure might affect a process, virtual machine, network connection, or an entire availability zone. The design must state which failures it can tolerate and what behavior remains acceptable. Running two servers does not establish fault tolerance if both depend on a single database, share the same failure domain, or lack enough remaining capacity when one fails.

Cloud architectures commonly implement fault tolerance by distributing redundant components across independent failure domains, routing requests only to healthy instances, and keeping important state outside replaceable compute instances. For example, a web application can run across multiple availability zones behind a load balancer. If an instance fails, healthy instances continue serving requests while automation replaces it. The surviving capacity must be sufficient for the expected load; replacement alone may be too slow to prevent an outage.

Compute purchasing decisions are an important application of this concept. Amazon EC2 Spot Instances use spare capacity at discounted prices, but AWS can interrupt them when that capacity is needed elsewhere. They suit interruption-tolerant workloads such as batch processing, distributed data analysis, rendering, and queue-based workers. A worker can checkpoint progress to durable storage, process tasks idempotently, and allow unfinished tasks to be retried elsewhere. A Spot interruption notice typically provides approximately two minutes of warning before stopping or terminating an instance, but applications must not depend on receiving that warning; hibernation can begin immediately.

A practical batch-processing design stores input and checkpoints durably and uses a queue to distribute tasks across workers. If a worker disappears before acknowledging completion, its task becomes available for another worker after the visibility timeout. Duplicate processing remains possible, so task handlers must prevent repeated side effects. Diversifying Spot capacity across suitable instance types and availability zones reduces exposure to a shortage in one capacity pool, but it does not guarantee capacity or uninterrupted execution.

On-Demand Instances are appropriate for short-term, unpredictable, or interruption-sensitive workloads that do not justify a usage commitment. They avoid Spot-specific reclamation, but they can still experience infrastructure failures. Reserved Instances and Savings Plans reduce costs in exchange for commitments; neither makes application code fault tolerant. Savings Plans do not reserve capacity. Zonal Reserved Instances can include a capacity reservation in a specified availability zone, whereas Regional Reserved Instances do not. On-Demand Capacity Reservations address capacity availability in a particular availability zone, not application continuity. Dedicated Hosts primarily address physical-server placement, licensing, and isolation requirements rather than fault tolerance.

A customer-facing application can combine an On-Demand baseline with additional Spot capacity when losing the Spot portion will not violate its service objectives. Predictable eligible baseline usage may benefit from Reserved Instances or Savings Plans. Conversely, a non-checkpointable, single-node job with a strict deadline is usually a poor Spot candidate. In exam scenarios, interruption tolerance is the key purchasing clue: flexible, restartable work favors Spot, while unpredictable work requiring non-Spot execution commonly favors On-Demand.

Fault tolerance has costs: redundant capacity, replicated storage, cross-zone communication, and more complex operations. Retries require limits, backoff, and idempotency to avoid duplicate actions or cascading overload. High availability emphasizes uptime and may include brief recovery interruptions; fault tolerance emphasizes continued operation during the failures covered by the design. Backups and disaster recovery support recovery after disruption but do not, by themselves, provide uninterrupted service. Test failure scenarios under load rather than assuming that redundancy or a purchasing commitment guarantees continuity.

Key aspects of Fault Tolerance

Fault tolerance combines failure-aware architecture, redundant capacity, restartable work, and tested automation, while keeping compute pricing decisions separate from continuity guarantees.

Explicit failure scope

Define whether the system must tolerate instance, dependency, availability-zone, or regional failures. A design that survives one instance failure does not automatically survive a zone outage.

Redundancy and failure isolation

Distribute sufficient capacity across independent failure domains and remove shared single points of failure. Ensure surviving components can support the required workload.

Interruption-tolerant execution

Make work restartable through durable checkpoints, queues, and idempotent processing. These capabilities make interruptible compute options such as Spot practical without treating instance lifetime as guaranteed.

Purchasing model alignment

Choose Spot for work that can withstand interruption and On-Demand for flexible usage that should avoid Spot reclamation. Use Reserved Instances or Savings Plans for eligible predictable usage, recognizing that pricing commitments do not provide application fault tolerance.

Automated fault handling

Use health checks, traffic rerouting, bounded retries, and instance replacement to handle failures without waiting for manual intervention. Keep enough healthy capacity available while replacements start.

Validation and cost control

Test component loss and capacity shortages under realistic load. Balance redundancy and operational complexity against the business impact of interrupted service.

Cloud services for Fault Tolerance

EC2 supplies application and worker capacity, while EC2 Auto Scaling maintains the fleet across availability zones and replaces failed instances. Elastic Load Balancing routes incoming requests to healthy targets. SQS preserves queued work independently of worker lifetime, making restartable workers a practical fit for Spot Instances. RDS Multi-AZ adds database redundancy, although applications must handle connection interruptions during failover. Together, these services support fault-tolerant designs only when capacity, state management, retries, and dependencies are configured appropriately. Purchasing discounts reduce compute costs; they do not replace redundancy or failure testing.

Amazon EC2 image Amazon EC2

EC2 provides the compute instances and purchasing options around which interruption handling must be designed. Spot suits restartable work, while On-Demand, Reserved Instances, and Savings Plans address different usage and pricing needs without eliminating infrastructure failures.

Open Amazon EC2 →
Amazon EC2 Auto Scaling image Amazon EC2 Auto Scaling

Auto Scaling can maintain desired instance capacity, replace unhealthy instances, and distribute a group across availability zones. Mixed instances groups can combine On-Demand and Spot capacity, but replacement still depends on available capacity and instance startup time.

Open Amazon EC2 Auto Scaling →
Amazon RDS image Amazon RDS

RDS Multi-AZ deployments provide database redundancy and automated failover for supported failure scenarios. Failover can interrupt connections, so applications still need reconnection and safe retry logic; Multi-AZ does not mean every database request proceeds without interruption.

Open Amazon RDS →