Database / REDIS
What is a Redis Stream?
A Stream is an append-only log data structure, similar in spirit to a Kafka topic, where each entry gets a unique, time-ordered ID and holds a set of field-value pairs. Unlike Pub/Sub, entries persist in the stream and can be read by multiple independent readers at their own pace, including readers that connect after an entry was added.
XADD events * sensor "temp-1" reading "72.5" XRANGE events - + # read all entries XLEN events # entry count
Each entry ID (like 1691425200000-0) encodes a millisecond timestamp plus a sequence number, which is what gives Streams their strict, gap-free ordering. Streams support both simple sequential reading and, through consumer groups, coordinated parallel processing across multiple readers — making them Redis's answer to durable, replayable event log use cases that a Set, List, or Pub/Sub channel isn't designed to handle well on its own.
More Related questions...
