FCALL update_if_newer 1 user:42 17. One round trip, a name instead of a SHA, and it survives a restart. Redis 7 came out last week, and Functions are the feature I care about. Everything EVAL scripts should have been.

The problem they solve is real. Take compare-and-update: set a value only if the stored version is older. From PHP it is three round trips and a race between them. WATCH/MULTI works but is ugly and retries under contention. A Lua script does it atomically in one trip, and that is why we all wrote Lua scripts. But scripts are anonymous blobs. The application carries the source, sends it on every deploy, and debugging starts with “which SHA is this”. Functions fix the operational part: the library lives in Redis, has a name, has a version.

So the mechanics improved. The rule did not change. Redis runs your logic on the same single thread that serves everyone else. A function that loops over a big hash blocks every client in the instance. Nobody sees it on the laptop. Everybody sees it at peak traffic.

My limit for server-side logic stays where it was in the EVAL years. A few commands around one key or a small key group, done in microseconds. Compare-and-set, rate limiter token math, atomic move between two structures. That is all. The moment a function wants a loop over unknown size, or a business decision, the logic goes back to PHP and the atomicity gets designed differently.

Redis is fast because it does almost nothing per command. Named, versioned, persistent logic makes it easier to put more in there. That is the part I am watching in myself.