redis

  • A cache stampede on a single hot key

    A cached value expiring under load means every request that arrives in the next few hundred milliseconds recomputes it simultaneously — so the moment of highest cost is…

  • withoutOverlapping on a scheduled command

    A scheduled task that occasionally runs longer than its interval will be started again while the first is still going, which for an import means two processes writing…

  • Find the biggest key in Redis by memory

  • The DEL that blocked the server, and UNLINK

    A 400ms pause on every request, once an hour, caused by a cache cleanup nobody thought of as expensive. Redis is single-threaded, and freeing memory is work.

  • Probabilistic early expiry beats a lock

    Rather than coordinating who recomputes, let each reader decide independently with a probability that rises as the expiry approaches — so one request refreshes early and the rest…

  • Redis 4.0 UNLINK frees in the background

    Redis is single-threaded, so DEL on a structure with a million members blocks every other client for as long as freeing it takes — which is milliseconds for…

  • Queues, workers and the jobs that fail twice

    The email that arrived four times and the charge that arrived twice. What makes a job safe to run again, and keeping workers alive without them serving stale…

  • Redis beyond caching: locks, counters and rate limits

    The cache server was already there doing one job out of four. A lock that expires, a release that checks it still owns the lock, and a sliding-window…

  • RDB and AOF answer different questions

    Redis has two persistence mechanisms and the documentation presents them as a choice, which invites picking one. They fail differently, and on anything that matters both are usually…

  • Redis 3.2 added geospatial commands

    Finding the nearest branch used to mean a bounding-box query in SQL with a Haversine formula in the ORDER BY, which cannot use an index and gets slower…