redis
Redis as a pipeline substrate: streams, sorted sets, pub/sub and their limits.
-
Turning Alertmanager Webhooks Into Retained MQTT State
Alertmanager's webhook delivers an event to whoever happens to be listening at the moment it fires, which is no help to a system that connects later and wants to know what is currently active. This builds a small bridge that keeps current alert state in Redis and republishes it to MQTT as retained messages, with a complete setup that runs on a laptop.
-
MQTT Persistent Sessions and Retained Messages for Offline Subscribers
A subscriber that drops off the network for a minute can miss every message published in that window, and a newly-connecting client sees nothing at all until the next publish. Persistent sessions and retained messages fix both, and this walks through the broker configuration and the client flags that make it work, plus a small Redis-backed cache for consumers that never speak MQTT at all.
-
Migrating Redis Consumers from Python to C++ on Constrained Hardware
A dozen Python processes each blocked on a Redis stream look harmless until you add up their idle cost on a small device. Here is how to replace just that consume loop with a C++ equivalent, built and run through Docker so you can measure the trade-off yourself instead of taking anyone's word for it.
-
Sizing Redis maxmemory Against a Stream Trim Threshold
Redis Streams trim themselves as a side effect of XADD, and XADD is refused once maxmemory is reached under the default eviction policy. That leaves a gap where a stream can hit the memory ceiling before it ever gets trimmed down, and stay stuck there. Here is how to reproduce that state, why maxmemory-policy will not save you, and how to size and sequence trimming so it cannot happen.
-
A Single-Writer Rule for Configuration Held in Redis
When several services can write the same Redis key, a read after a write can return someone else's value and nobody owns the truth. This walks through a lease-and-version pattern that makes one process the only writer, with a complete Python example a reader can run on a laptop.
-
Chaining Single-Purpose Redis Consumers into a Processing Pipeline
A single service that detects, tracks, calibrates and computes statistics over the same data becomes impossible to test or scale in isolation. This splits that service into four single-purpose consumers chained through Redis Streams, using consumer groups for at-least-once delivery and XAUTOCLAIM for crash recovery, in a complete example a reader can run against a local Redis container.
-
Tracking Moving Objects with Redis Sorted Sets and an Atomic Lua Tick
Tracking several objects moving along a line at once needs two guarantees at every step: a consistent view of where everything currently is, and a clean way to detect what has left the tracked range. This builds that on a Redis sorted set with a single atomic Lua script, and shows both guarantees holding under a real docker-based Redis instance.