Theory of Intelligence
BACKEND ENGINEERING•Databases Concurrency And Caching•Database Performance•2.2 Connection Pooling

2.2.1 Connection Pooling

Subtopics: Connection Pooling.

lightbulb

Book reference: Beyond the books. Original notes kept below; rewrite them in your own words.

2.2.1 Connection Pooling

Opening a TCP + TLS + auth handshake to Postgres on every query is slow. A pool keeps N ready connections and lends them out.

Why it matters

Databases cap connections (often a few hundred). A thousand app workers without a pool will exhaust that limit.

How it is used

Size the pool per instance so instances × pool stays under the DB max. Use a pooler (PgBouncer) in front of Postgres at scale. Return connections promptly — do not hold one across a slow HTTP call.

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!