redis

  • A Redis Lua script is atomic and blocks everything

    A script runs to completion with nothing interleaved, which is exactly why it is useful and exactly why a slow one is an outage. The atomicity removes the…

  • The cache that returned stale data for eleven days

    A price change that took eleven days to reach one page. Three caches, and only one of them was being cleared.

  • Redis 6.2 GETDEL, for the one-shot token

    Reading a key and deleting it was two commands and a race, and 6.2 made it one. The race matters for anything single-use — a password reset token,…

  • SINTERCARD counts without materialising

    Counting the intersection of two large sets meant building the intersection first, which allocates a set you immediately discard. The LIMIT is the part that changes what is…

  • COPY, and the key you no longer DUMP and RESTORE

    Duplicating a key used to mean serialising it out and back in, which moved the whole value through the client for no reason. Staying server-side matters for a…

  • ZRANGESTORE, and the sorted set you were rebuilding

    Taking a slice of a sorted set into a new key required reading it into the client and writing it back, which is O(n) over the network. The…

  • A stream id is a timestamp, and ranges over it are free

    Redis stream ids are a millisecond timestamp plus a sequence number, which means a time range is a key range and needs no secondary index. Constructing an id…

  • XPENDING with IDLE finds a dead consumer’s work

    An entry delivered to a consumer and never acknowledged stays in the pending list indefinitely, which is what makes recovery possible and what leaks if nothing sweeps it.…

  • Compose in CI, and the service the tests need

    The tests need MySQL and Redis, and CI gives you an empty machine. Service containers, where they differ from compose, and the readiness nothing does for you.

  • The keyspace pattern, which is where the mistake is

    The command permissions get the attention and the key pattern is where the actual isolation lives, because a service with write access to every key is not isolated…