Redis allows you to write server-side Lua scripts, essentially embedding scripts in your Redis instance to execute more complex operations. Redis maintains a script cache, so that you don't have to reload your scripts for each use.
It is important to note that Lua scripts have a 5-second time limit (by default) before being terminated. This limit exists to protect your Redis instance from long-running scripts, as Lua scripts are blocking due to Redis' single-threaded nature.