Redis, the famous NoSQL DB, have a nice feature to improve performance and compute more complex logic: Lua. The database have native support to this language to execute scripts and commands.
Due for atomic nature of some operations, you can use it on high concurrency applications.