Run multi-step logic atomically on the server with EVAL and Lua. Pass keys safely, control execution time, cache scripts, and replace race-prone client sequences with small scripts.