Quick revision
The short answer
Pub/sub and keyspace notifications are fire-and-forget: no persistence, no acknowledgement, no replay, so they are fine for live hints such as refreshing a screen or invalidating a cache, but not for business events. Business events between teams should go through a durable log such as Kafka, written through an outbox, with reconciliation to catch silent loss. I would inventory the current uses, move the order flow first, and make the rule part of design review with a named owner for the event platform.
What to remember
In this answer, we saw that the incident came from using a fire-and-forget transport for business events. We set a rule based on what a lost message costs, sent business events through a durable log fed by an outbox, migrated the order flow first while keeping pub/sub as a latency signal where it helps, added reconciliation so loss is found in hours, and made the rule part of design review with an owner.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Pub/sub and keyspace notifications are fire-and-forget: no persistence, no acknowledgement, no replay, so they are fine for live hints such as refreshing a screen or invalidating a cache, but not for business events. Business events between teams should go through a durable log such as Kafka, written through an outbox, with reconciliation to catch silent loss. I would inventory the current uses, move the order flow first, and make the rule part of design review with a named owner for the event platform.
Why this question is asked
This is a question about what a senior technical leader does after an incident that was not caused by one bad line of code but by a pattern that spread. Fifteen services quietly made Redis pub/sub their event bus because it was already there and fast. A failover then dropped messages, which pub/sub is designed to do, and nobody noticed for two days because nothing checked. Interviewers want to see that we can name the real property that failed (delivery guarantees), set a rule people can apply on their own, plan a migration without stopping the business, and add the detection that was missing. In this answer, we will recap what Redis actually guarantees, set the guidance, plan the migration, add reconciliation, and make the rule stick.
1What Redis Pub/Sub Actually Promises
Redis pub/sub delivers a message to the clients that are subscribed at the moment it is published, and to nobody else. There is no log, no acknowledgement and no way to ask for a message again. Keyspace notifications, the events Redis publishes when keys change (for example __keyevent@0__:expired), use the same mechanism and inherit the same limits. They are also disabled by default and must be switched on with notify-keyspace-events.
So a message is lost whenever a subscriber is disconnected: during a deploy, during a network blip, when Redis closes a slow client for its output buffer, and during a failover, when clients reconnect to the new primary after a gap of seconds. With async replication, a failover can even lose the write that would have triggered a keyspace notification. Nothing in this incident was a bug in Redis. The design asked pub/sub for a guarantee it never offered.
2Setting the Rule by Delivery Need
The guidance I would publish is short enough to remember: choose the transport by what happens if a message is lost. If a lost message only means a screen refreshes a little later or a cache entry lives until its TTL, pub/sub is fine and pleasantly simple. If a lost message means an order is not shipped, a payment not recorded or another team's data silently diverges, the event needs a durable log.
For business events between teams, that log is a broker with retention, consumer offsets and replay, for example Kafka. Consumers then track their own position, a consumer that was down for an hour continues where it stopped, and a team can replay a week of events after a bug. Events should come from the source of truth through the transactional outbox pattern: the service writes the order change and an outbox row in one database transaction, and a relay (or change data capture such as Debezium) publishes the row to Kafka. That way an event exists if and only if the change was committed.
| Need | Example | Transport |
|---|---|---|
| Lost message is harmless | refresh a dashboard, invalidate a cache | Redis pub/sub or keyspace events |
| Ordered work inside one team, modest volume | background jobs of one service | Redis Streams with consumer groups |
| Business event between teams | order created, payment captured | Kafka via an outbox |
| Low latency hint next to a durable event | push a UI update for an order | Kafka event plus a pub/sub signal |
3Migrating the Critical Flows
First, inventory. We list every channel and every keyspace notification in use, which we can find from PUBSUB CHANNELS, client names in CLIENT LIST, and a search of the code. For each one we record publisher, subscribers, volume and the impact of a lost message. Ranking by impact usually shows a few critical flows and many harmless ones.
The order updates go first, because they already failed. The publishing service adds an outbox and a Kafka topic, consumers move one by one while the old pub/sub message is still sent, and each consumer switches when it has proven it processes the Kafka events correctly. Where a consumer needs very low latency, the pub/sub message can remain as a signal that says look now, while the Kafka event remains the record that is processed. Harmless uses stay on pub/sub, so we do not spend a quarter migrating cache invalidations.
4Finding Silent Loss in Hours, Not Days
Even a durable log does not prove that the consumer applied every event correctly. So every critical flow gets reconciliation: a periodic job compares the source of truth with the consumer's state, for example the orders updated in the last hour in the order service against what fulfilment holds, and alerts on differences. Combined with consumer lag alerts in Kafka, a gap shows up within an hour instead of two days.
I would also ask the teams to add a simple end-to-end freshness metric, such as the age of the newest order each consumer has seen. If it stops moving while orders are being created, someone is paged.
5Making the Rule Stick
Guidance that lives in one email decays. I would name an owner for the event platform, publish a short page of approved patterns (pub/sub for hints, streams within a team, Kafka with an outbox between teams) and add one question to design review: what happens if this message is lost? New uses of pub/sub for business events then need an explicit, written exception. A quarterly look at the inventory keeps it current as teams change.
6Follow-up questions
How do you keep low latency for UI updates after moving to a log-based broker?
Kafka itself delivers in tens of milliseconds when producers and consumers are tuned for it, which is enough for most screens. The UI does not read Kafka directly: a small gateway service consumes the topic and pushes changes to browsers over WebSocket or server-sent events. If a flow truly needs single-digit milliseconds, the publisher can also send a pub/sub signal, and the gateway uses it only to fetch fresh state early, while the Kafka event remains the record. Either way, the browser can recover on reconnect by fetching the current state.
Why not simply use Redis Streams for everything?
Streams fix replay and acknowledgement inside Redis, and they are a good choice within one team. But Redis replication is asynchronous, so a failover can still lose acknowledged entries, retention is limited by memory, and the tooling for schemas, cross-team access and long retention is weaker than in Kafka. For business events between teams, those gaps matter.
What if a team says Kafka is too heavy for their small flow?
I would listen, because the rule is about delivery need, not a product. A small internal flow can use a stream or even a database table polled every few seconds. What is not negotiable is that a business event between teams survives a restart and can be replayed or reconciled.
7Conclusion
In this answer, we saw that the incident came from using a fire-and-forget transport for business events. We set a rule based on what a lost message costs, sent business events through a durable log fed by an outbox, migrated the order flow first while keeping pub/sub as a latency signal where it helps, added reconciliation so loss is found in hours, and made the rule part of design review with an owner.
Open with
I would start by naming what failed: Redis pub/sub and keyspace notifications have no persistence, no acknowledgement and no replay, so a failover, a deploy or a slow client loses messages by design.
Then, if they want more
That is fine for live hints, like refreshing a screen or invalidating a cache, and not fine for business events. So my rule is to choose by the cost of a lost message.
Business events between teams go through a durable log with retention and consumer offsets, typically Kafka, and are written through a transactional outbox so an event exists exactly when the change is committed.
Then I would inventory all fifteen services' uses, rank them by the impact of loss, and move the order flow first, running both paths in parallel until each consumer has proven itself. Where a screen needs very low latency, pub/sub can stay as a signal next to the durable event.
Because two days of silence was the real damage, every critical flow gets reconciliation, a job comparing source and consumer state every hour, plus lag and freshness alerts. Finally I would make it stick: an owner for the event platform, a short page of approved patterns, and a design review question asking what happens if this message is lost.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Redis documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "As the senior technical leader, what guidance do you set for when Redis pub/sub is...": https://scrivio-interview-library.netlify.app/databases/redis-patterns/4c9bfa1aaf/