Graceful degradation allows a system to continue operating with reduced functionality when components fail, rather than failing completely. A site with a failed recommendation engine still shows products. A service with a failed cache still queries the database (slower but functional). Requires identifying which features are optional.
Graceful degradation is the design principle that partial failure should not cause total failure. When a non-critical dependency becomes unavailable, the system continues serving its primary function with reduced features rather than returning 500 errors. Implementation requires classifying dependencies as critical (system cannot function without them: primary database, auth service) and non-critical (system works without them: analytics, recommendations, notifications, cache). Non-critical calls use: timeouts (do not wait forever), fallbacks (serve cached/default data on failure), circuit breakers (stop trying after repeated failures), and feature flags (disable degraded features entirely). Example: an e-commerce checkout page with a failed review service shows products without reviews rather than failing the entire page. Graceful degradation requires explicit architectural decisions – it does not happen accidentally. Every external call needs a defined fallback behavior.
Circuit Breaker
A circuit breaker stops calling a failing downstream service after a threshold of errors, preventing cascade failures. States: Closed (normal flow), Open (all calls fail-fast without attempting), Half-Open (limited test calls to check recovery). Prevents a slow/failing service from consuming all caller resources and propagating failure upstream.
Failover
Failover is the automatic transfer of traffic from a failed primary system to a standby replica. Database failover promotes a replica to primary. DNS failover routes to a backup IP. Load balancer failover removes failed backends. Recovery time (RTO) depends on detection speed and promotion mechanism – seconds for load balancer, minutes for database.
High Availability (HA)
High availability is a system design that minimizes downtime by eliminating single points of failure. Measured in 'nines' – 99.9% (8.7h downtime/year), 99.99% (52min/year), 99.999% (5min/year). Requires: redundant components, automatic failover, health monitoring, and tested recovery procedures.