Postgres LISTEN/NOTIFY Actually Scales
Summary
The article challenges the belief that PostgreSQL LISTEN/NOTIFY cannot scale and explains the root cause of earlier bottleneck: a global exclusive lock during commit. It then describes an optimization that buffers NOTIFYs and batches them into a single transaction, plus a lightweight fallback polling, achieving up to 60K stream writes per second with 15-100 ms latency on a single Postgres server. The piece includes benchmark results and links to the GitHub repository with the benchmark code.