Redis Stream: A Better Message Queue

Requires Redis 5.0.0+ Overview Redis Stream is a powerful log-like data structure. While Redis already had Lists and Sets, Stream was built specifically for high-throughput, persistent messaging with features like Consumer Groups and Acknowledged delivery. Core Commands XADD: Appending Data XADD my-stream * name "John" age 30 * tells Redis to auto-generate the ID. Returns an ID like 1681138020163-0 (Timestamp-Sequence). XLEN: Getting Length Returns the number of messages in the stream. ...

April 17, 2023 · 2 min