Publish–Subscribe messaging model
Fire-and-forget:
Good for:
- Real-time notifications
- Chat messages
- Cache invalidation
- Live dashboards
- WebSocket triggers
Publisher → Channel → Subscribers
How Redis Pub/Sub works
- Service A publishes message
- Service B, C, D (even in different instances) receive instantly
- Messages are not persisted, if subscriber is offline, message is lost