Redis › Streams
How do you add a new entry to a Redis Stream, and how do you read entries back from it?
BeginnerAnswer
You use XADD to add a new entry, providing a set of field value pairs representing the message data, and XRANGE to read a range of entries from the stream, specifying starting and ending id boundaries, letting you retrieve all or a specific portion of the stream's stored history.
XADD orders '*' orderId '1001' status 'created'
XRANGE orders - +Real-world example An order processing system adds a new stream entry every time an order's status changes, and a monitoring dashboard reads the full history of status changes for a specific order using XRANGE.