There's more...
You may wonder how to choose between Lua and Redis transactions in Redis, since both are capable of executing a group of operations as a whole. Generally speaking, it's better to choose Lua rather than transactions when you need a complex logical judgment or a processing loop for your business scenario.
Similar to Redis transactions, attention must also be paid to the execution time of your Lua script. The Redis Server won't process any commands when executing a Lua program. So, we must make sure that the Lua script can be executed as soon as possible. Once the execution time of a Lua script exceeds 5 seconds by default (set lua-time-limit in the Redis configuration to change it), you can call SCRIPT KILL to kill it. If any ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access