0Pricing
Redis Caching & Messaging (Pub/Sub, Streams) · Lesson

Channels vs Keyspace Notifications

Understand the difference between explicit Pub/Sub channels and Redis keyspace notifications, and when to reach for each.

Two Ways to Get Notified

So far you have published to explicit channels with PUBLISH. Redis also offers keyspace notifications, which automatically emit events when keys change. Both deliver messages to subscribers, but the source differs.

Recap: Explicit Channels

With explicit channels, your application decides what to publish and when. The channel name is arbitrary text.

PUBLISH news.sports "Match ended 2-1"
SUBSCRIBE news.sports

All lessons in this course

  1. Introduction to Pub/Sub
  2. Redis Pub/Sub Mechanics
  3. Broadcasting Simple Messages
  4. Channels vs Keyspace Notifications
← Back to Redis Caching & Messaging (Pub/Sub, Streams)