Nick Van Wiggeren | February 27, 2026Yesterday on X, SpacetimeDB tweeted that they had done "the world's first video call over a database" and, in their own way, invited anyone else to give it a try.Credit to them - it's a cool idea! In short, they built a frontend that captures audio and video from the browser's media APIs, encodes them into compact frames (PCM16LE audio, JPEG video), sends them to a database that acts as a real-time message broker, and streams them back out to the other participant's browser for playback.Fortunately, the implementation is open sourced (https://github.com/Lethalchip/SpaceChatDB), so I figured I'd see what it looked like for PostgreSQL, the world's most popular open source database, to host the world's second video call over a database.How it worksIn my implementation, I started with the same SvelteKit frontend, added a small Node.js WebSocket server (pg-relay) in the middle, and $5 PlanetScale PostgreSQL as the database.When you're on a video call:Your browser captures a camera frame, encodes it as a JPEG, and sends it as a binary WebSocket message to pg-relay.pg-relay validates that you're in an active call, then runs:INSERT INTO video_frames (session_id, from_id, to_id, seq, width, height, jpeg)
Video Conferencing with Postgres — PlanetScale
Stream real time video and audio through PostgreSQL on PlanetScale.
1,257 words~6 min read






