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

Basic Design Principles for Relational Databases

Preface Over the years, I’ve noticed a strange phenomenon: whether it’s an experienced veteran or a junior programmer, people love to talk about AI, Big Data, Blockchain, and various frameworks, but very few focus on databases. I’m not sure if it’s because databases seem too “low-end” or if they are just too low-profile. Technology is like that: the areas you don’t focus on are the ones where you’re most likely to fall into a pit. So, I want to talk about how to avoid “pits” when using databases. ...

February 27, 2020 · 4 min