A practical breakdown of three resilience patterns for backend services: timeouts, retries with backoff and jitter, and circuit breakers. Using a real-world cascading failure caused by a slow payment provider, the post explains why unbounded waiting kills services, how each pattern bounds a different type of damage, and the correct order to stack them (circuit breaker → retry → timeout → call). Includes Node.js code examples using AbortController, guidance on when to retry (idempotent ops only, not 4xx errors), full jitter vs. naive jitter, and a decision table for which patterns to apply to different call types. Also covers library options like cockatiel and opossum.
Table of contents
Your AI shouldn’t grade its own homework (Partner)Why one slow dependency takes you downBound the wait → TimeoutRecover from error blips → Retry (carefully)Bound the blast radius → Circuit breakerStacking them (the order matters)Not everything needs all threeBuild it or grab a library?📌 TL;DR1.5K Impressions