Skip to content
Glossary · System design

Connection pooling

Also called connection pool, database pooler.

Definition

Keeping a set of open database connections and sharing them across requests, instead of opening a new connection for each one.

Last updated

What it is.

Opening a database connection takes time and memory on the database server, and databases allow only so many at once. A pool keeps some connections open and lends one to each request, then takes it back. The pool can live inside the app or in a separate pooler service in front of the database.

Poolers often work in different modes, such as one connection per transaction or per session. The mode decides which database features, like session settings or prepared statements, still work.

Why it matters

Without pooling, a traffic spike or a burst of serverless instances can open more connections than the database allows, and the whole app goes down. Pooling keeps the database steady and cuts the time each request spends waiting.

In a product build

We size the pool to what the database can handle, not what the app might want, use a pooler for serverless and autoscaling apps, and set timeouts so a stuck query cannot hold a connection forever. Pool usage is a dashboard metric from the start.

Watch out

Common mistakes.

  1. 01

    Each app instance opening a large pool, so the total exceeds the database limit.

  2. 02

    Using session features in transaction mode and getting odd bugs.

  3. 03

    Long-running transactions that keep connections out of the pool.

Related

Related terms.

Building something with this? Ask an engineer.

OceanLab designs and builds production software. Tell us what you are planning and we will reply with how we would approach it.

OceanLab

Enterprise Software Engineering - Human + AI

Languages

Locations

Global Headquarters

21 Merchant Road, 3rd Floor, Singapore 058267

Main corporate office and leadership operations

North America Office

548 Market Street, PMB 12472, San Francisco, CA 94104

Client operations and business development

India Office

402 Shivalik Shilp II, SG Highway, Ahmedabad 380015

Engineering and delivery center

© 2026 - Copyright. All Rights reserved OceanLab