awesome-everything RU
↑ Back to the climb

Backend Architecture

Pooling: free-recall review

Crux Free-recall prompts across the pooling unit. Answer each in your own words first, then reveal the model answer and compare.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the material stick.

Goal

Reconstruct the unit’s core mechanisms — why a pool exists, how to size it, what the acquisition timeout defends, why connections go stale, how leaks drain a pool, and why fan-in forces a multiplexer — without looking back at the lessons.

Recall before you leave
  1. 01
    Why is opening a database connection expensive, and what two jobs does a pool do about it?
  2. 02
    Why does raising the pool size past a small number reduce throughput, and what is the HikariCP sizing formula?
  3. 03
    What happens when a request needs a connection but all are busy, and how should the acquisition timeout be set?
  4. 04
    Why can a pooled connection be dead while the pool thinks it is open, and what three controls keep the pool fresh?
  5. 05
    What is a connection leak, why is a bigger pool a poor fix, and what is the related hoarding trap?
  6. 06
    Why does a horizontally scaled fleet overflow one database, and how does PgBouncer transaction pooling solve it — at what cost?
Recap

If you could reconstruct each answer from memory, you hold the unit’s spine: a pool amortises expensive setup and bounds concurrency; its size is small and derived from cores, not guessed large; the acquisition timeout decides fail-fast vs thread starvation; connections go stale behind the pool’s back and must be rotated by maxLifetime (under the DB timeout) and validated on borrow; the most common outage is a leak or a hoard, fixed by guaranteeing the return rather than enlarging the pool; and at scale many pools fan into one max_connections, forcing a transaction-pooling multiplexer that trades session state for the ratio. The connection is a hard, shared, expensive resource — bound it deliberately at every layer.

Continue the climb ↑Pooling: code and config reading
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.