HeadlinesBriefing favicon HeadlinesBriefing.com

PgQue Revives Skype's PgQ Queue for Modern Postgres

Hacker News •
×

A new open-source Postgres queue called PgQue brings back the battle-tested PgQ architecture originally built at Skype for messaging hundreds of millions of users. Unlike the original PgQ which required C extensions and external daemons, PgQue is written entirely in PL/pgSQL and runs on any Postgres 14+ including managed providers like AWS RDS, Aurora, and Supabase.

Most Postgres queues rely on SKIP LOCKED operations that create dead tuples and bloat under sustained load. PgQue solves this with snapshot-based batching and TRUNCATE-based table rotation, eliminating dead tuples entirely. The result is a queue that maintains predictable performance even after months of heavy use, with zero bloat by design. The trade-off is delivery latency of 1-2 seconds, though this can be tuned or forced lower for specific use cases.

PgQue is designed for event-driven fan-out scenarios where multiple consumers independently process the same event stream. It's not intended for job queues requiring sub-millisecond latency or per-job priorities. Installation requires just one SQL file and a periodic ticker call, with pg_cron providing the recommended scheduling mechanism. The project includes client libraries and benchmarks, positioning it as a zero-maintenance alternative for high-throughput messaging on modern Postgres deployments.