PGKeeper: Building the bouncer we needed for Postgres
8 hours ago
- #Database Reliability
- #Connection Pooling
- #PostgreSQL
- Figma built PGKeeper to replace PgBouncer due to scalability, load management, connection management, and extensibility limitations.
- PGKeeper is a Go-based service with a gRPC interface, using PGX for PostgreSQL connection management and implementing custom load control.
- Key features include admission control with priority-based and fair-sharing algorithms, connection pool management with rate limiting, and mechanisms to avoid connection churn.
- It ensures reliability through pool warming, bounded exhaust, auto rollback, and context cancellation handling.
- Safe rollout involved disaster readiness testing, incremental deployment, and automatic error detection to switch back to PgBouncer if needed.
- Since full deployment, PGKeeper has maintained high database SLOs and prevented multiple potential outages.