Redis Lua scripts

Redis Lua scripting lets a client execute a script on the Redis server to perform multiple operations as one atomic unit. Scripts are useful when a rate-limiting decision requires reading state, checking conditions, and updating state without interleaving commands from other clients.

Learn this concept

Lesson 1.21 · Redis atomicity, transactions, Lua and failure handling

Used in exercises

Exercise 1.29 · Optional: Token bucket in Redis with Lua and EVALSHA Exercise 3.22 · POST /v1/auth/refresh: detect token reuse