Overview of Redis Streams in FastStream
mainRedis Streams (introduced in Redis 5.0) are a data structure used for reliable and scalable data streaming, similar to Apache Kafka. They store an ordered sequence of messages, where each entry has a unique ID (including a timestamp) and key-value pairs.
Key features include:
- Persistence: Data is persisted and can be replayed by new consumers.
- Consumer Groups: Enables concurrent consumption and acknowledgment of entries by multiple consumers for partitioned processing.
- Range Queries: Allows querying data within specific ID ranges.
When using Redis Cluster, all stream operations (such as xadd, xreadgroup, xautoclaim, and xack) are automatically routed to the correct node by the RedisClusterBroker based on the key's hash slot.