Designing for fault tolerance: eliminating single points of failure, zone and region redundancy in Australia East/Southeast, timeouts, retries with backoff, circuit breakers, bulkheads, graceful degradation, RTO/RPO and choosing the right level of resilience.
Fault tolerance means the system keeps working, perhaps degraded, when parts fail. I design it in layers:
Then I prove it with chaos tests and failover drills. The trade-off is cost and complexity versus downtime: zone redundancy is cheap, multi-region active-active is expensive, so the availability target decides.
"I start with the diagram and ask of every box: what happens if this is slow, down, or returning errors? Anything whose failure takes the whole system down is a single point of failure, and I either remove it or accept it consciously. Then I match the resilience to the requirement β a 99.9% internal tool and a 99.99% payments service get very different designs.
The first layer is redundancy. Multiple app instances spread across availability zones in Australia East, and zone-redundant options for the data tier, like zone-redundant Azure SQL and Redis. That covers a datacentre failure at modest cost. Regional failover to Australia Southeast covers a whole-region outage, but it means geo-replication, a failover process and usually a non-zero RPO, so I only do it when the business can state an RTO and RPO that require it. For example, at [company] we [chose active-passive across regions for system X because of requirement Y].
The second layer is containing failure inside the code: a timeout on every outbound call, retries with exponential backoff and jitter only for idempotent operations, a circuit breaker so we stop hammering a dependency that's down, and bulkheads so one slow dependency can't use every thread or connection. In .NET that's
AddStandardResilienceHandlerfrom Microsoft.Extensions.Http.Resilience on top of Polly. The third layer is graceful degradation β show cached prices, hide recommendations, queue the order and confirm later. The mistake I see is retries without timeouts or jitter, which turn a brief blip into a retry storm. Resilience you haven't tested is a hope, not a design."
| Failure | Protection | Cost |
|---|---|---|
| Process crash, bad instance | Multiple instances, health checks | Low |
| Datacentre (zone) outage | Zone-redundant services across availability zones | Low to moderate |
| Region outage | Geo-replication and failover to the paired region | High |
| Dependency slow or down | Timeouts, circuit breaker, fallback | Low (code) |
| Bad deployment | Slots/revisions, canary, fast rollback | Low |
| Data corruption, deletion | Point-in-time restore, soft delete, immutable backups | Moderate |
| Pattern | Purpose | .NET |
|---|---|---|
| Timeout | Bound waiting | HttpClient + resilience pipeline, CancellationToken |
| Retry with jitter | Ride out transient faults | Polly retry strategy |
| Circuit breaker | Fail fast when dependency is down | Polly circuit breaker |
| Bulkhead | Isolate resources | Concurrency limiter, separate pools |
| Fallback | Degrade gracefully | Cached value, default response |
Azure Front Door (health probes)
/ \
Australia East (active) Australia Southeast (passive)
App x N across zones App (scaled down / warm)
Azure SQL (zone redundant)--> geo-replica (failover group)
Redis (zone redundant) Redis (empty, warms on failover)
| Target | Monthly downtime budget | Typical design |
|---|---|---|
| 99.9% | ~43 min | Single region, multiple instances |
| 99.95% | ~22 min | Zone redundant in one region |
| 99.99% | ~4 min | Zone redundant plus automated regional failover |
A pricing dependency started taking 30 seconds to respond. Without timeouts, the checkout API's requests piled up until thread pool starvation took the whole service down for 25 minutes. After adding a 2-second timeout, a circuit breaker and a fallback to the last known price (with a flag to re-price before payment), a repeat of the same dependency failure caused no checkout errors.
Checks whether the candidate can find single points of failure, apply the right redundancy level, contain failures in code and justify the cost.
Green flags
Red flags
At scale, something is always failing: an instance, a disk, a network link, a dependency. Fault tolerance accepts that and designs so that individual failures don't become user-visible outages. The two numbers that matter are how often users are affected and for how long (availability and MTTR).
Redundancy only helps if failures are independent. Two instances on the same host, or in the same zone, fail together. Availability zones are physically separate datacentres within a region with independent power, cooling and networking. Regions are hundreds of kilometres apart. Australia East and Australia Southeast are an Azure region pair, which affects platform update sequencing and some geo-replication defaults.
Asynchronous geo-replication means a non-zero RPO: writes committed in the primary region but not yet replicated are lost on forced failover. Zero RPO across regions needs synchronous replication, which adds latency to every write.
Without a timeout, a slow dependency holds a request, a thread or async continuation, a connection and memory for as long as it likes. Under load these pile up until the caller fails too β a cascading failure.
slow dependency -> requests wait -> pool exhausted -> caller fails
-> its callers wait -> ... -> whole system down
Retries help with transient faults but multiply load. Rules: retry only idempotent operations (or use idempotency keys), use exponential backoff with jitter so clients don't retry in sync, cap attempts, and have one layer own retries rather than every layer.
A circuit breaker counts failures; past a threshold it opens and fails fast for a break period, then lets a trial request through (half-open). This protects the dependency while it recovers and frees the caller from waiting.
Azure Chaos Studio can inject faults such as VM shutdowns, network latency and zone-down scenarios. Failover drills prove that the runbook and DNS/Front Door routing work and measure the real RTO.
AddStandardResilienceHandler to an HttpClient, point it at a WireMock.Net stub that delays 10 s, and observe the timeout and circuit breaker.Timeouts, retries with jitter and a circuit breaker for an outbound call, plus a fallback for graceful degradation.
// Program.cs β .NET 10, Microsoft.Extensions.Http.Resilience
using Microsoft.Extensions.Http.Resilience;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpClient<PricingClient>(c => c.BaseAddress = new Uri("https://pricing.internal"))
.AddStandardResilienceHandler(o =>
{
// Total budget for the call including retries.
o.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(3);
// Each attempt must give up quickly.
o.AttemptTimeout.Timeout = TimeSpan.FromSeconds(1);
o.Retry.MaxRetryAttempts = 2; // backoff with jitter by default
o.CircuitBreaker.FailureRatio = 0.5; // open at 50% failures...
o.CircuitBreaker.MinimumThroughput = 20; // ...once there is enough traffic
o.CircuitBreaker.BreakDuration = TimeSpan.FromSeconds(15);
});
builder.Services.AddMemoryCache();
var app = builder.Build();
app.MapGet("/prices/{sku}", async (string sku, PricingClient pricing, CancellationToken ct) =>
Results.Ok(await pricing.GetPriceAsync(sku, ct)));
app.Run();
public sealed record Price(string Sku, decimal Amount, bool IsStale);
public sealed class PricingClient(HttpClient http, Microsoft.Extensions.Caching.Memory.IMemoryCache cache, ILogger<PricingClient> logger)
{
public async Task<Price> GetPriceAsync(string sku, CancellationToken ct)
{
try
{
var price = await http.GetFromJsonAsync<Price>($"/prices/{sku}", ct)
?? throw new InvalidOperationException("Empty price response");
cache.Set(sku, price, TimeSpan.FromHours(1));
return price;
}
catch (Exception ex) when (ex is HttpRequestException or TimeoutException
or Polly.CircuitBreaker.BrokenCircuitException
or Polly.Timeout.TimeoutRejectedException)
{
// Graceful degradation: last known price, flagged so checkout re-prices before payment.
logger.LogWarning(ex, "Pricing unavailable for {Sku}; using cached price", sku);
return cache.TryGetValue(sku, out Price? cached) && cached is not null
? cached with { IsStale = true }
: throw;
}
}
}
Seniors size resilience to the cost of downtime, per service rather than per system. A checkout or payments path may justify regional failover, while the reporting service in the same product is fine with a single zone and a four-hour RTO. Each nine roughly multiplies cost and complexity, so they ask what an hour of outage costs and what the business will pay to avoid it. Zone redundancy is usually an easy yes; multi-region is a business decision with a price tag and a data-loss trade-off (RPO).
They also know where resilience can live. In-process libraries (Polly via Microsoft.Extensions.Http.Resilience) give fine control per call; on Kubernetes, a service mesh such as Istio or Linkerd can apply timeouts, retries and mTLS uniformly at the sidecar, but then retries must be owned by one layer, not both. And they look past infrastructure: most outages come from changes, so safe deployments (slots, canaries, feature flags, fast rollback) often add more availability than another region.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Multiple instances, one zone | Internal tools, 99.9% | Lowest | Customer-facing critical paths |
| Zone redundant (Australia East) | Most production systems, 99.95% | Small premium | Region outage must be survived |
| Active-passive regions | RTO minutesβhours, 99.99% | Standby cost, drills | No business case for regional loss |
| Active-active regions | Near-zero RTO, global users | Highest; conflict handling | Strongly consistent single-writer data |
| Where resilience lives | When it fits | Cost | When not to |
|---|---|---|---|
| In-process (Polly) | Per-call policies, fallbacks with business logic | Code in every service | Many languages, need uniform policy |
| Service mesh | Many services on Kubernetes, uniform mTLS and timeouts | Sidecar latency and operations | Small estate, App Service hosting |
You can't know. The request may have been lost, processed with the reply lost, or still be running. So the caller must treat a timeout as an unknown outcome: retry only operations that are idempotent, make others safe to retry by sending an idempotency key the server de-duplicates on, or check the outcome (status query, reconciliation) before acting again. Keep retries bounded and behind a circuit breaker, with a fallback for the user, so a slow dependency doesn't turn into a retry storm.
A health check is an automated decision: the orchestrator or load balancer acts on it, so it must answer exactly the question the actor asks. Liveness asks "is this process stuck?", so the answer is a restart. It never checks shared dependencies. Readiness asks "should this instance get traffic now?" It checks warm-up and local essentials, not something every instance shares. Startup probes give slow starts time before liveness applies.
The classic failure is a database check in liveness or readiness: one database blip makes every instance fail together. You get a fleet restart or zero healthy backends, which turns a partial outage into a total one. In ASP.NET Core I use tagged checks mapped to separate endpoints, keep them cheap and time-boxed, and keep detailed output internal. Dependency health goes to monitoring and alerts, where a human decides.
I build it in layers:
The trade-off is cost and complexity (private DNS, more resources) versus a much smaller attack surface and a tested recovery path.
How to tell it (STAR)
**S:** At [company], a slow release of the pricing service made every call take about [30] seconds, and our checkout API went down for [n] minutes. **T:** I led the fix so a dependency failure couldn't take checkout down again. **A:** I confirmed thread pool starvation with dotnet-counters and found our HttpClient had no timeout or circuit breaker. I added a resilience pipeline with a 1-second attempt timeout, a circuit breaker and a fallback to the last known price, flagged for re-pricing before payment, and added a Chaos Studio latency test to the release pipeline. **R:** When pricing failed again [weeks] later, checkout errors stayed at [near zero] and p95 stayed under [x] ms.
Last updated 23 Nov 2026.