# Postgres LISTEN/NOTIFY Proven Scalable

Global locking issue overcome to achieve 60K writes per second

- **Source:** [Hacker News](https://news.ycombinator.com)
- **Published:** 2026-07-24
- **Topic:** [Software & Engineering](https://brifing.si/c/engineering)
- **Original article:** <https://www.dbos.dev/blog/postgres-listen-notify-scalability>
- **On Brifing:** https://brifing.si/s/563505cf-b6a3-4d0e-aef9-1672be1fa065

## Postgres NOTIFY's bad reputation

Postgres's LISTEN/NOTIFY feature was infamous for not scaling due to global locking. While this perception spread through a popular blog post, it's now proven that with proper optimizations, the system can deliver high performance. This is particularly crucial for applications requiring real-time data streaming.

## Core challenge in stream-based architecture

The main difficulty in data streams is how to alert readers when new data arrives. Continuous polling consumes resources and causes latency. LISTEN/NOTIFY offers a more efficient solution but introduces its own performance barriers that need addressing.

## Impact of global locking

Postgres uses a global mutex that locks the entire system during NOTIFY operations. This creates severe bottlenecks in high-volume write scenarios. Benchmarks showed it was impossible to exceed 2,900 write operations per second due to this lock.

## Notification buffering solution

The developed solution buffers NOTIFY notifications in memory and processes them in batches periodically. This approach reduces the global lock's impact by 90%, enabling 60,000 write operations per second. Buffering also allows leveraging Postgres's group commit feature.

## Maintaining order guarantees

The buffering method maintains notification order guarantees while improving performance. For crash resilience, it integrates with WAL (Write-Ahead Logging) mechanism. This achieves high throughput without data loss risks.

## Game-changer for real-time systems

This optimization makes Postgres viable for various real-time applications from chat platforms to financial transaction monitoring. It enables low-latency streams while preserving the database's durability and consistency advantages.

## Sources covering this story

- https://www.dbos.dev/blog/postgres-listen-notify-scalability — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
