Menu

Post image 1
Post image 2
1 / 2
0

Postgres LISTEN/NOTIFY for Real-Time Video Metadata Invalidation Across Regions

DEV Community: php·ahmet gedik·2 days ago
#fpJD8QtF
#dev#region#payload#listener#coalescer#self
Reading 0:00
15s threshold

At TrendVidStream we discover streaming-platform titles across eight regions (US, GB, DE, JP, KR, BR, IN, AU) and surface them through a PHP 8.4 frontend backed by SQLite FTS5 read replicas. The discovery cron runs on a staggered schedule, FTP-deploys SQLite snapshots to edge nodes, and the public site reads from a local copy. That works beautifully for catalog data that changes hourly. It falls apart for the metadata that changes every few seconds: a title flipping from available to expiring_soon , a regional license being revoked at 03:14 UTC, a thumbnail being re-encoded, or a popularity score recalculated after a traffic spike. The naive fix is to poll. Every edge node hits a central endpoint every N seconds, asks "what changed?", and patches its local cache. We ran that for six months. It cost us roughly 4.2 million wasted HTTP requests per day across regions, and the staleness window was still 15-30 seconds because the poll interval couldn't go lower without melting the origin.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More