A Postgres Alternative to Kafka
You don't need Kafka. There, I said it.
Before you close the tab: I'm not saying Kafka is bad. I'm saying most teams reach for it before they've exhausted what their existing database can actually do. And Postgres, specifically, can do a lot more than most people realize when it comes to real-time event streaming.
What Postgres Already Gives You
Postgres ships with two mechanisms that make real-time streaming genuinely viable without adding a single new piece of infrastructure.
LISTEN/NOTIFY is the simpler of the two. Any connected client can subscribe to a named channel, and any other session can push a notification to it. It's lightweight, it's fast enough for a huge range of use cases, and it takes about five minutes to wire up.
-- In one session, listen for events
LISTEN order_created;
-- In another session, fire an event
NOTIFY order_created, '{"order_id": 1234, "status": "pending"}';
Your application subscribes to the channel, receives the payload, and reacts. No brokers, no consumers, no topic configuration, no Zookeeper.
Logical replication goes further. It lets you stream a change feed directly from the write-ahead log (WAL), capturing every insert, update, and delete as it happens. Tools like pg_recvlogical or libraries such as pgoutput give you a structured stream of row-level changes that you can consume from any downstream service.
This is real change data capture (CDC), built into the database you're probably already running.
The Actual Tradeoff
None of this means Postgres replaces Kafka in every scenario. The honest tradeoff looks like this:
Postgres wins on:
- Operational simplicity (one fewer system to run, monitor, and tune)
- Cost (no additional infrastructure, no managed broker fees)
- Familiarity (your team already knows it)
- Transactional consistency (events are tied directly to your data)
Kafka wins on:
- Sustained high throughput at serious scale (millions of events per second)
- Long-term message retention and replay across multiple consumers
- Decoupling producers and consumers at the architectural level
- Fan-out to many independent downstream systems
The scale ceiling for Postgres-based streaming is real. If you're processing hundreds of thousands of events per second across dozens of consumers, you will eventually hit limits that Kafka handles more gracefully. But that scale is also much further away than most teams assume when they're architecting their first event-driven feature.
Where Teams Go Wrong
The pattern I see most often: a team decides they need "real-time" something, an event-driven architecture gets proposed, someone with Kafka experience advocates for it, and suddenly a three-person startup is running a Kafka cluster to handle a few thousand events per day.
The operational overhead is not trivial. Kafka requires careful tuning of partition counts, replication factors, consumer group offsets, and retention policies. Debugging a consumer lag issue at 2am is a different experience than looking at a Postgres WAL stream.
The complexity Kafka introduces is worth it at scale. It is often actively harmful below a certain threshold, because it pulls engineering attention away from the product and toward the infrastructure.
A More Practical Approach
Start with Postgres. Use LISTEN/NOTIFY for lightweight event broadcasting between services. Set up logical replication if you need a proper change feed or want to sync data to a downstream store. Monitor your event volume and latency over time.
When you hit the ceiling, you'll know it. Replication lag will grow, NOTIFY delivery will become unreliable under load, and your use case will have matured enough that you actually understand the Kafka configuration you need. That's the right time to migrate, not before.
If you want production-grade streaming without that migration pain, tools like Turboline are built specifically to bridge this gap: giving teams the reliability and delivery guarantees of a proper streaming platform while keeping the operational surface small and the Postgres integration tight.
The concrete takeaway: most teams are not at Kafka scale, and running Postgres-based event streaming as long as it serves you is not a shortcut or a compromise. It's a reasonable engineering decision that keeps your stack lean and your team focused on the problem that actually matters.
Top comments (0)