Hard-won lessons after processing 6.7T events through Postgre queues
summary
RudderStack details running PostgreSQL as a queue at 100,000 events/sec and 6.7T total events, using 100k-row data sets and a cron compaction that prefers drop table over delete to eliminate bloat. Key tactics: switch from row INSERTs to copy bulk load, use recursive CTEs for loose index scans to cut a 145ms query to 1ms, cache empty-pipeline checks to eliminate 95% of pointless queries, and tune Postgres (auto‑vacuum frequency, random_page_cost=1.1, max_wal_size=2GB, wal_buffers=64MB).
AI-written summary · about
chapters (9)
- 0:00Introduction and context
- 3:57Why Postgres over Kafka
- 6:25Query performance and indexing issues
- 9:54Bulk inserts and retry storms
- 15:14Empty queue penalty and caching
- 17:41Driver optimizations and data transfer
- 20:48Shared buffers and IOPS limits
- 22:12Postgres configuration tuning
- 23:35Key takeaways and summary
related talks
02h 00mTutorial
51mScaling Postgres to the next level at OpenAI
50mScaling Postgres With Some Help from Redis
52mBulk data processing and PostgreSQL thingy
43mTuning PostgreSQL for High Write Workloads
37mPostgres at Any Scale
48mHow to Tame A Mastodon: Lessons for PostgreSQL at Scale
46mHow we made PG Fitter, Happier, More Productive
