Chapter 11. Scripting Redis with Lua

This chapter covers

  • Adding functionality without writing C
  • Rewriting locks and semaphores with Lua
  • Doing away with WATCH/MULTI/EXEC
  • Sharding LISTs with Lua

Over the last several chapters, you’ve built up a collection of tools that you can use in existing applications, while also encountering techniques you can use to solve a variety of problems. This chapter does much of the same, but will turn some of your expectations on their heads. As of Redis 2.6, Redis includes server-side scripting with the Lua programming language. This lets you perform a variety of operations inside Redis, which can both simplify your code and increase performance.

In this chapter, we’ll start by discussing some of the advantages ...

Get Redis in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.