Urgent.News

What's breaking now, across hundreds of outlets.

Tech

System Design, Plainly — Season 2, Part 10: Timeouts, Retries & Circuit Breakers

Season 2 closes with the three patterns that decide whether one slow dependency takes your whole system down with it. Parts 1–9 gave you the machinery for agreeing (leader election, consensus), coordinating (transactions, sagas), and finding each other (gossip, service discovery, locking). This part is about what happens when the machinery is slow — and the season's benchmark hook is the ugliest…

Season 2 of the series concludes with the three patterns that determine whether a single slow dependency can bring an entire system down. Parts 1-9 have provided the essential building blocks: leader election, consensus, coordination (transactions, sagas), and discovery and communication mechanisms (gossip, service discovery, locking). This part focuses on what happens when these building blocks become slow, culminating in a benchmark where five layers of retries multiply one user request into 243 downstream calls.

The key patterns are individually straightforward, but when used incorrectly, they can cause a system outage. The source provides data from a simulated 20,000 requests with a dependency latency of 50 ms (median), 5% transient 503s, and a slowdown where 20% of requests take 3 seconds. The results show that naive retries only add 4 points of success at a cost of 1.44x load; however, a 10% retry budget can maintain that gain at 1.10x load.

A circuit breaker, on the other hand, cuts wasted calls during a 60-second outage from 6,000 to just 618.

To understand these concepts more simply, a timeout is a promise to yourself that you will wait a certain amount of time before giving up on a slow dependency. Without a timeout, a slow dependency can hold up your entire thread, connection, and memory, causing a cascade of failures as other services queue behind it. A retry is a second chance; if the initial request fails, perhaps it was just a temporary blip, try again.

The problem with retries is that they multiply. If you retry three times and the service you called retries three times, and the service it called retries three times, a single user request can turn into 27 calls to the database, tripling its load at the worst possible moment.

A circuit breaker acts as a fuse box in this scenario. When failure rates exceed a certain threshold, the breaker opens, preventing any further calls to the problematic dependency. This allows the dependency to recover quietly, while callers receive an immediate error instead of waiting for a timeout. The circuit breaker is the only pattern that reduces load during an outage rather than adding to it.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

TechCrunch Mobility: Uber and Nuro enter Waymo’s turf

Welcome back to TechCrunch Mobility, your hub for the future of transportation and, now more than ever, the role AI is playing in it.

  • Uber and Nuro testing Lucid Gravity SUVs in San Francisco
  • Waymo faces software recall affecting 4,400 robotaxis
  • Waymo suspends services in San Francisco before storms

Document Intake: Presigned Browser Uploads Balance CORS Limits and Storage Retention

TL;DR For private course submissions, use presigned browser uploads when large files and application-server bandwidth dominate the cost model; use a server upload when inspection must happen before…

  • Presigned browser uploads ideal for large files, high server costs
  • Server uploads preferred for document inspection before storage
  • Cost analysis includes storage, uploads, downloads, delivery, compute

More from Sunday, 29 November 2026 →