The use of Lua in Redis
In his original 2011 blog post about the addition of server-side scripting to Redis, Salvatore Sanfilippo lists three reasons why:
Scripting increases the speed of Redis for some tasks by reducing the bandwidth between the server and client, that is separate calls are sent to Redis to read a value, apply some client-side computing to the value, and then add the value back to Redis
As most workflows in Redis tend to be I/O bound and not CPU bound, scripting provides a better balance between the two
Scripting allows the Redis server code base to remain fast and lean for general abstractions, while giving users the ability to add specific server-side functionalities
Note
The entire post can be found here: http://oldblog.antirez.com/post/redis-and-scripting.html.
Later, server-side scripting was officially added to Redis using the Lua programming language in version 2.6. Lua is a fast and lightweight-programming language designed to be embedded into programs or added as a scripting...