PlanetScale
PlanetScale logoPlanetScale · Feature trail

Postgres as a Real-time Messaging Backend

1 post · Feb 2026

What this trail covers

PlanetScale offers a managed Postgres service that can be used as a real-time message broker. This post explores using logical replication to stream data, such as video frames and audio, from database tables to connected clients. The implementation involves a SvelteKit frontend, a Node.js WebSocket server for relaying messages, and PostgreSQL for durable storage and real-time distribution. The post also discusses alternative approaches like LISTEN/NOTIFY and unlogged tables, and demonstrates how to manage accumulating rows with cleanup jobs and how to keep audio in sync with clamping.

All PlanetScale trails