Under load the service exhausts its database connections. The pool config looks right.
Context, code, logs and metrics, the same material you would have in production, with nobody pointing at the problem.
No multiple choice and no single right answer: you write what you think is happening, what you would do and what it costs.
The moment you submit, the written solution opens next to your answers, and stays open for you to reread whenever you want.
checkout-api is an HTTP service running as six replicas, talking to a single PostgreSQL instance (max_connections = 200) through a connection pool. The budget was reviewed at launch and written down in the runbook:
pool_max = 10 (per pool, from the connection string)
replicas = 6
--------------------------------------
checkout-api = 60 connections at full stretch
headroom = ~140 of max_connections = 200Three weeks ago compliance asked for an audit trail — who called which endpoint and with what status. A middleware was added for it, writing to an audit schema on the same database. It shipped on a Tuesday and nothing happened for three weeks.
> The code is in TypeScript because some language had to be picked. The bug > exists unchanged in any language.
Locked
Opening a challenge costs 1 credit. A new account starts with 3, no card.