aradotso avatar

Pgque Postgres Queue

If you need a Postgres-based queue that won't bloat your database with dead tuples, this is the move. It's a pure PL/pgSQL implementation of Skype's battle-tested PgQ architecture, using snapshot-based batching and table rotation instead of row-level locks. That means you can run high-throughput queues on managed Postgres (RDS, Supabase, Neon) without vacuum becoming a nightmare. The tradeoff is latency: delivery takes about one to two seconds because nothing ships until a tick fires. Native fan-out is built in, so multiple consumers each get their own copy of every event. If you need sub-second messaging, look elsewhere. If you need reliable queuing that won't degrade your database over weeks of sustained load, this nails it.

skills.sh installs
296
GitHub stars
26
last updated
Jun 3, 2026

Install

$ npx -y skills add aradotso/trending-skills --skill pgque-postgres-queue --agent claude-code

Installs into .claude/skills of the current project.

Files

PgQue – Zero-Bloat Postgres Queue

Skill by ara.so — Daily 2026 Skills collection.

PgQue is a pure PL/pgSQL reimplementation of the battle-tested PgQ (Skype/Postgres) architecture. It uses snapshot-based batching and TRUNCATE-based table rotation instead of row-level locking, delivering zero dead-tuple bloat, predictable performance under sustained load, and native fan-out — all from a single SQL file on any Postgres 14+ instance including managed providers (RDS, Aurora, Cloud SQL, Supabase, Neon).

Key Concepts

  • Tick: A periodic snapshot that closes a batch of events. Nothing is delivered until a tick fires.
  • Batch: A group of events captured in one tick, consumed atomically by a subscriber.
  • Subscriber/Consumer: A named cursor on the event log. Multiple consumers get independent copies of every batch (fan-out).
  • Zero bloat: Events are stored in rotating tables and cleared via TRUNCATE, never DELETE. No dead tuples.
  • Latency trade-off: End-to-end delivery is ~1–2 s (one tick interval + poll). Per-call function latency is microseconds.

Installation

Sponsors

Details

Repository
github.com/aradotso/trending-skills
Categories
Backend & APIs, Databases
First seen
Jun 3, 2026

More from aradotso/trending-skills

All 251
1aradotso avatarfreebuff2api-openai-proxyaradotso/trending-skillsfreebuff2api openai proxy289skills.sh installs
2davila7 avatargwas-databasedavila7/claude-code-templatesQuery NHGRI-EBI GWAS Catalog for SNP-trait associations. Search variants by rs ID, disease/trait, gene, retrieve p-values and summary statistics, for genetic ep289skills.sh installs
3davila7 avatarpdb-databasedavila7/claude-code-templatesAccess RCSB PDB for 3D protein/nucleic acid structures. Search by text/sequence/structure, download coordinates (PDB/mmCIF), retrieve metadata, for structural b281skills.sh installs
4aradotso avatargpt2api-openai-gatewayaradotso/trending-skillsgpt2api openai gateway276skills.sh installs
5patricio0312rev avatarmcp-server-builderpatricio0312rev/skillsBuilds Model Context Protocol (MCP) servers for Claude with tools, resources, and prompts. Use when users request "create MCP server", "build Claude tool", "MCP265skills.sh installs
6neondatabase avatarneon-authneondatabase/ai-rulesneon auth264skills.sh installs