---
title: "Why we built yet another Postgres connection pooler"
description: "PgDog is a Rust Postgres proxy whose connection pooler avoids the leaky abstractions of PgBouncer and RDS Proxy."
url: "https://swe.quest/articles/why-we-built-yet-another-postgres-connection-pooler-daf218b5177e95f8"
canonical: "https://pgdog.dev/blog/why-yet-another-connection-pooler"
source: "PgDog"
published: "2026-07-06"
difficulty: "medium"
kind: "Opinion"
reading_minutes: 4
tags: ["postgres","rust","concurrency","databases"]
---

# Why we built yet another Postgres connection pooler

A post on [PgDog](https://swe.quest/sources/pgdog.md), published 2026-07-06, 4 min read, Opinion. Original: [https://pgdog.dev/blog/why-yet-another-connection-pooler](https://pgdog.dev/blog/why-yet-another-connection-pooler)

## Summary

PgDog is a Rust Postgres proxy whose connection pooler avoids the leaky abstractions of PgBouncer and RDS Proxy. Its built-in SQL parser tracks per-client SET state and resyncs server connections with pipelined SET statements, so session variables and RLS policies keep working. LISTEN/NOTIFY is proxied through Tokio broadcast channels within a process and a dedicated Postgres connection across processes. Multithreading on Tokio lets one process serve more clients with fewer server connections than sharded pools under SO\_REUSEPORT or autoscaling. PgDog has been in production for over a year at 2M queries per second.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Concurrency](https://swe.quest/tags/concurrency.md) (Compilers & runtimes)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- Postgres connection pooling ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- PgBouncer transaction mode
- Postgres session variables ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

PgDog, PgBouncer, RDS Proxy, Tokio, LISTEN/NOTIFY, Row Level Security, SO\_REUSEPORT

## Related posts

- [PgDog vs. RDS Proxy](https://swe.quest/articles/pgdog-vs-rds-proxy-54748e0d30fc5847.md): PgDog · 2026-08-17 · Medium · 5 min read · PostgreSQL, Load balancing, Scaling, Cloud platforms, Performance engineering
  PgDog avoids RDS Proxy's connection pinning, which silently disables transaction pooling when apps use SET, temporary tables, advisory locks, or queries over 16 KB, and can exhaust Postgres connections.
- [PGKeeper: Building the bouncer we needed for Postgres](https://swe.quest/articles/pgkeeper-building-the-bouncer-we-needed-for-postgres-b0a410376e101175.md): Figma · 2026-05-04 · Medium · 19 min read · PostgreSQL, Resilience, Go, Databases, Scaling
  Figma replaced PgBouncer with PGKeeper, a Go service built on PGX that sits between its DBProxy router and each Postgres instance.
- [PgBouncer is now available in Supabase](https://swe.quest/articles/pgbouncer-is-now-available-in-supabase-7611d240679e4c4c.md): Supabase · 2021-04-02 · Medium · 4 min read · PostgreSQL, Serverless, Scaling
  Supabase now bundles PgBouncer, co-located on the same server as each new project's Postgres, so serverless functions that open a connection per request don't overwhelm the database.
- [Supavisor: Scaling Postgres to 1 Million Connections](https://swe.quest/articles/supavisor-scaling-postgres-to-1-million-connections-8585e4b9712f0334.md): Supabase · 2023-08-11 · Medium · 7 min read · PostgreSQL, Elixir & Erlang, Scaling, Multi-tenancy, Performance engineering
  Supavisor is a multi-tenant Postgres connection pooler written in Elixir that Supabase built to replace single-threaded PgBouncer.
- [Supavisor 1.0: a scalable connection pooler for Postgres](https://swe.quest/articles/supavisor-1-0-a-scalable-connection-pooler-for-postgres-561015cc29e3cac0.md): Supabase · 2023-12-13 · Medium · 3 min read · PostgreSQL, Elixir & Erlang, Load balancing, Replication
  Supavisor 1.0, Supabase's Elixir-based Postgres connection pooler, is production-ready and adds query load balancing, named prepared statement support in transaction mode, and query cancelation.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
