Circuit breaker
Make a service your API depends on fail or hang. Watch threads pile up — and how a circuit breaker keeps the rest of the API alive.
How it works
- 1Every call to another service holds a thread until it answers. If that service hangs, threads run out and the whole API stops — even endpoints that never call it.
- 2A circuit breaker counts recent failures. Past a threshold it opens, and calls fail at once instead of waiting.
- 3After a pause it lets a few trial calls through. If they work, it closes again.
Read the post: How to build an API for 100,000 requests a second
More demos
All demosQueryLite: a SQL database
A SQL database written from scratch — parser, B+ tree indexes, a query planner, joins and transactions — running live on 22,000 rows in your browser.
Raft consensus, live
The algorithm that keeps etcd and Kubernetes consistent. Five servers elect a leader and replicate a log — crash them and split the network while it runs.
Live collaborative editor
Real-time editing with no server. Three devices share a note — take one offline, edit everywhere, reconnect, and they merge. Open a second tab and it syncs live.