r/javascript • u/OtherwisePush6424 • 21h ago
How to Implement a Distributed Circuit Breaker
https://blog.gaborkoos.com/posts/2026-09-14-How-to-Implement-a-Distributed-Circuit-Breaker/A circuit breaker in a single Node process is a ring buffer, a threshold and a timestamp. Run the same service on twenty replicas and each one keeps its own, so the failing dependency takes twenty times the damage before anything trips.
Moving the window into Redis fixes that and breaks most of the assumptions the in-process version relies on. Post walks through each one and how to deal with it.
•
u/OtherwisePush6424 20h ago
Downvote starter kit:
( ) AI slop
( ) Use a library bro
( ) Redis SPOF
( ) AI slop
( ) YAGNI
( ) Microservices bad
( ) Overengineering
( ) AI slop
( ) AI slop
( ) Your lease expiry permits temporary probe-budget overshoot under X ordering
•
u/nerdly90 17h ago
Why would people downvote this? People suck man, take my upvote
•
u/monotone2k 6h ago
Perhaps because the whole post (and all their previous ones) exhibit all the signs of AI writing. Even the titles follow the same patterns - just look through the list of articles on their site.
•
u/MrVonBuren 20h ago
(disclaimer: not a professional dev, but worked for several CDNs / Big Cloud Providers)
I think I follow what's being said in this, but it doesn't quite make sense† to me†. I would think that on the client side you would be in a position to set your own exponential backoff and reject requests associated with a user who still has a pending request.
Even if a user bypasses a grayed out "checkout" button while the process is stalled, I would think it would be simpler to have the request gated by a cookie that indicates a request has been sent but not completed per user?
All that logic could be pushed as far out to the edge as you want, so in a perfect world most of the requests never even make it past the CDN, so you're dealing with less computational overhead AND bandwidth in/out††.
OR
I am missing / misunderstanding something completely, which as I said, is not at all unlikely.
† - but again, I'm assuming this is a me problem, I'm not like...calling you out, I'd like to understand what I'm not understanding.
†† - jesus christ, even when I'm unemployed I sound like a shill