wtf( )unctionsystem design, drawn
← all problemsMicroservicesHard

One slow dependency, every endpoint down

The service has one connection pool and one worker pool, shared by every endpoint. One downstream dependency — used by a single reporting endpoint — starts taking thirty seconds instead of thirty milliseconds.

Requests to that endpoint occupy a worker for thirty seconds each. Within a minute every worker is holding one, and requests to endpoints that never touch that dependency are queued behind them. The slow thing did not fail. It just took up all the room.

Give the risky dependency its own bounded share, so exhausting it cannot exhaust everything.
Components — tap one, then tap a slot on the diagram
!A reporting dependency got slow. The login endpoint, which never calls it, stopped responding.

Boundaries, outermost first: One service: Shared worker pool (one pool for all; FAILED: all held by reports), an empty slot for the in-flight calls to the slow one, an empty slot for the capacity the slow path cannot reach Outside every boundary: Auth store (fast, healthy), Login requests (never touch it), Reporting dep (30 seconds; FAILED: slow, not down), Report requests (a few per minute) Connections: Login requests calls Shared worker pool (step 1) Report requests calls Shared worker pool (step 2) Shared worker pool calls Reporting dep — 30s each (step 3) Shared worker pool calls Auth store (step 4) in-flight calls to the slow one controls Reporting dep — at most N (step 5) capacity the slow path cannot reach controls Shared worker pool (step 6)

Auth storefast, healthy
Login requestsnever touch it
Shared worker poolone pool for allall held by reports
Reporting dep30 secondsslow, not down
Report requestsa few per minute