Scaling PostgreSQL: Horizontal vs. Vertical
summary
Compares concrete tuning and replication choices: tune shared_buffers 25–40% (can be higher), set work_mem is per session and multiplies (e.g., raising work_mem to 1 GB halves sort time for that session), and use maintenance_work_mem to speed index builds (500× memory gave ~2× faster index create in an example). Recommends pgBouncer for thousands of connections, HAProxy and Patroni for failover, pg_backrest for backups, and notes replication tradeoffs: physical replicas are read-only; logical replication is table-level only and lacks built-in conflict resolution, so use extensions for multi-master.
AI-written summary · about
chapters (13)
- 0:00PostgreSQL scaling strategies
- 1:23Vertical scalability in PostgreSQL
- 8:15PostgreSQL architecture & memory
- 13:16Vertical scaling parameters
- 23:59Indexing for performance
- 29:46Horizontal scalability in PostgreSQL
- 33:27Replication methods
- 37:01Logical replication limits
- 41:57High availability clusters
- 47:14Load balancing & failover
- 50:01Backup strategies
- 51:04PG Bouncer pooling
- 52:28Combining scaling approaches
related talks
58mScaling Postgres
57mPostgreSQL When It's Not Your Job
43mPostgres Performance: From Slow to Pro
34mTuning PostgreSQL to work even better
33mTuning PostgreSQL to work even better
48mPractical Memory Tuning for PostgreSQL
48mHow to Tame A Mastodon: Lessons for PostgreSQL at Scale
46mHow we made PG Fitter, Happier, More Productive
