Hacker News new | ask | show | jobs
by scwoodal 3617 days ago
My thought was the complexity would be worth it if you have a non-trivial number of users.

Additionally some third party API's have rules where they expect you to back off exponentially if there are errors. You'll get your account suspended if you don't play by the rules.

2 comments

Another good trick is to melt the fuse if the request is merely slow. This can often back off before the timeout scenario occurs. I used this to great advantage when I crawled all duels of Quake Live years ago. If the site became slow, I would cease crawling for 15 minutes, and fuse handled that nicely.
I think the key is you need a backup for the system you are gating off. If your db breaks you blow a fuse and show errors... Not sure you gained much.
There is a subtle but important difference:

In a timeout situation, you know relatively little.

If the circuit tells you it is broken, you know that the backend system is deemed down and trying again right now is probably futile.

Each client for a server (on which the fuse runs) will be rather blind to the experiences of other clients. But the server, and thus the fuse, will know what happens to all the clients. This allows you to act globally on the server side. But this in turn empowers each client locally since it now also has global information.

So making a fuse global, say throwing it in your db, now means you can't have a fuse about the DB. Which may be okay, but seems in some ways less good than a local fuse.