---
id: "pgbouncer"
type: "component"
kind: "database-proxy"
provider: "default"
category: "data"
docs: "https://www.pgbouncer.org/config.html"
url: "https://localhost:3000/catalogue/components/pgbouncer"
---

# PgBouncer

Lightweight PostgreSQL connection pooler.

| | |
|---|---|
| Provider | [default](https://localhost:3000/catalogue?provider=default) |
| Kind | [Database proxy](https://localhost:3000/catalogue/kinds/database-proxy) |
| Category | Data |
| Official docs | [https://www.pgbouncer.org/config.html](https://www.pgbouncer.org/config.html) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `defaultPoolSize` | integer | — | no | 20 | inherited |
| `hedging` (advanced) | boolean | — | no | false | inherited |
| `loadShedding` (advanced) | boolean | — | no | false | inherited |
| `managed` | boolean | — | no | false | inherited |
| `maxClientConn` | integer | — | no | 100 | inherited |
| `poolMode` | enum | `session`, `transaction`, `statement` | no | "session" | inherited |
| `poolSharded` (advanced) | boolean | — | no | false | inherited |
| `pooling` | boolean | — | no | true | **true** |
| `requestCoalescing` (advanced) | boolean | — | no | false | inherited |
| `routing` | enum | `none`, `shard-key`, `lookup` | no | "none" | **"none"** |
| `scatterGather` (advanced) | boolean | — | no | false | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 13

- [Amazon RDS Proxy](https://localhost:3000/catalogue/components/rds-proxy.md) `rds-proxy` — aws
- [Cloudflare Hyperdrive](https://localhost:3000/catalogue/components/cloudflare-hyperdrive.md) `cloudflare-hyperdrive` — cloudflare
- [Generic database proxy](https://localhost:3000/catalogue/components/database-proxy.md) `database-proxy` — default
- [MariaDB MaxScale](https://localhost:3000/catalogue/components/maxscale.md) `maxscale` — default
- [mongos](https://localhost:3000/catalogue/components/mongos.md) `mongos` — default
- [Odyssey](https://localhost:3000/catalogue/components/odyssey.md) `odyssey` — default
- [PgCat](https://localhost:3000/catalogue/components/pgcat.md) `pgcat` — default
- [Pgpool-II](https://localhost:3000/catalogue/components/pgpool.md) `pgpool` — default
- [ProxySQL](https://localhost:3000/catalogue/components/proxysql.md) `proxysql` — default
- [Supavisor](https://localhost:3000/catalogue/components/supavisor.md) `supavisor` — default
- [Vitess](https://localhost:3000/catalogue/components/vitess.md) `vitess` — default
- [Cloud SQL Auth Proxy](https://localhost:3000/catalogue/components/google-cloud-sql-auth-proxy.md) `google-cloud-sql-auth-proxy` — gcp
- [IBM Data Virtualization](https://localhost:3000/catalogue/components/ibm-data-virtualization.md) `ibm-data-virtualization` — ibm

## Use it in a design

```yaml
nodes:
  - { id: "pgbouncer", component: "pgbouncer" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# PgBouncer: lightweight PostgreSQL connection pooler; session pooling by default, no routing.
schemaVersion: "1"
type: "component"
id: "pgbouncer"
kind: "database-proxy"
provider: "default"
docs: "https://www.pgbouncer.org/config.html"
defaults:
  pooling: true
  routing: "none"
properties:
  poolMode:
    type: "enum"
    values: ["session", "transaction", "statement"]
    default: "session"
  maxClientConn:
    type: "integer"
    default: 100
  defaultPoolSize:
    type: "integer"
    default: 20
```

Human page: https://localhost:3000/catalogue/components/pgbouncer
