โ Redis learning pathRedis ยท Module 8 of 10
Pub/Sub and Streams
Redis can pass messages between services in real time.
๐ Key ideas
- PUBLISH channel message sends to every current subscriber.
- SUBSCRIBE channel listens; offline subscribers miss messages.
- Streams (XADD, XREAD) store messages so they can be read later.
- Consumer groups (XREADGROUP) share stream work between workers.
- 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