Building Redis-Modules with JavaScript using Cthulhu
Cthulhu is an interesting project. It allows you to code custom redis-modules in JavaScript . This is very interesting because JS is very productive and easy to write code. You might be wondering how they made this efficient? Well, the secret is a project called Duktape which is an efficient JS engine written in C. So Cthulhu + Duktape will pre-compile your javascript function and run it on C which will be efficient and will be able to talk with redis core. Unfortunately, not all functions are available -- you can check the ones that are available here: List of available APIS . You can so a simple comparison with a module In C I wrote some time ago in this blog post . C is way more powerful but also way more error-prone and might take more time to write if you are not used to it. So for this Blog Post, I will how to download and compile Cthulhu and they install in Redis 4 and code some custom function in JavaScript. Let's get started.