This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
What is the key difference between Redis pub/sub and Redis Streams for event messaging?
Pub/sub delivers messages to active subscribers only, while Streams persist messages for consumer groups to process at their own pace
Pub/sub can handle more messages per second than Streams
Streams are only for string data while pub/sub works with any data type
When building a processing pipeline with multiple services that need automatic retry on failure, which pattern should you use?
Redis Streams with consumer groups for reliable task coordination and built-in retry handling
Redis pub/sub for real-time distribution of work items
A simple Redis List with LPUSH and RPOP
Which Redis command is used to add a new message to a Stream?
XADD
LPUSH
PUBLISH
Which scenario is best suited for Redis pub/sub messaging?
Broadcasting real-time status updates to multiple connected clients or services that are currently listening
Storing messages that arrive when subscribers are offline and delivering them when subscribers reconnect
Implementing a reliable work queue where tasks must be processed exactly once
How would you coordinate multiple AI workers processing documents from a Stream to ensure no document is processed by more than one worker simultaneously?
Use XREADGROUP to pull tasks from a consumer group, which automatically assigns unacknowledged tasks to different workers
Use XREAD to have each worker independently read from the Stream without coordination
Use pub/sub channels with one channel per worker
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?