โ† Redis learning path
Redis ยท Module 8 of 10

Pub/Sub and Streams

Redis can pass messages between services in real time.

๐Ÿ“– Key ideas

  1. PUBLISH channel message sends to every current subscriber.
  2. SUBSCRIBE channel listens; offline subscribers miss messages.
  3. Streams (XADD, XREAD) store messages so they can be read later.
  4. Consumer groups (XREADGROUP) share stream work between workers.
  5. XACK confirms a message was processed.
๐Ÿ’ก Real-life example: Pub/Sub is a live radio broadcast; Streams are a recorded podcast you can play later.
PUBLISHSend a message to a channel
SUBSCRIBEListen to a channel
XADDAppend a message to a stream
XACKMark a stream message as processed