liveBook · Manning

Fault tolerance

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

Fault tolerance is the ability of a system to continue providing acceptable service when some components fail.

Fault tolerance keeps a distributed application providing acceptable service when components fail. Microservices can contain individual crashes within the cluster, shielding customers from their effects. section 11.4 section 11.6

Build fault tolerance with complementary operational techniques:

  • Run multiple replicas behind a load balancer so another instance can serve requests while a failed instance restarts. section 11.1
  • Configure Kubernetes health checks to detect and automatically restart failed microservices. section 11.6
  • Set request timeouts so hung internal or external calls abort instead of leaving customers waiting indefinitely. section 11.4.6
  • Retry failed network requests, preserve essential work with a job queue, and use a circuit breaker for more advanced protection. section 11.6
  • Use logging, error handling, health checks, and observability to diagnose failures and understand interactions between services. section 11.1 section 11.6

Fail-fast HTTP requests

Axios requests wait forever by default unless configured otherwise. Set a 2,500-millisecond default timeout, then retry a failed operation up to three times with a five-millisecond wait between attempts. section 11.4.6

Figure 11.1 Infrastructure for a healthy microservice in production

Use the production infrastructure diagram to connect replicas, load balancing, service instances, and telemetry in one fault-tolerant deployment. section 11.1

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains replicas, health checks, timeouts, retries, queues, and circuit breakers, with JavaScript and Axios examples but limited internals.
Examples
Uses Kubernetes replicas, Axios timeouts and retries, internal services, and a Dropbox integration as concrete failure scenarios.
What it assumes
Assumes microservices and HTTP requests, while introducing failure handling, telemetry, health checks, and recovery practices.
What you can do after
Build it from scratch using replicas, health checks, timeouts, retries, queues, and circuit breakers.
How it connects
Connects microservices with load balancing, observability, health checks, error handling, retries, job queues, and circuit breakers.

Also explained in

Compare how 5 books explain fault tolerance →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.