Posts

Showing posts with the label Redis-Modules

Debugging Redis Module

Image
Lately, I'm working with custom redis-modules and I need to say: redis-modules kick ass. I started working with Cthulu and coding modules with javascript which was nice and very productive but given some of my current use cases I had to go to C. I recommend you take a look at my previous posts here:   -  Building Redis-Modules with JavaScript using Cthulhu   -  Dispatching Custom Commands with Lettuce and Redis-Modules Today I want to you how to do proper debug with Redis modules written in C language. I will be using eclipse Oxygen CPP in order to debug redis module and redis 4. Here there is a video which I recorded with a simple live demo about how to debug a redis-module project and redis. The source code is available on my GitHub . I hope this is useful for you.

Dispatching Custom Commands with Lettuce and Redis-Modules

Image
Lettuce is a very efficient and extensible Redis client for Java.  Lettuce is interesting for many reasons but one of the big ones is the fact that provides an Observable / Flux API. So you can very efficient reactive programming with RxJava or Reactive-Streams power by Reactor . I'm using lettuce in production in the last 2 years and have been really great. For this blog post, I will how to dispatch custom commands to redis-modules via Lettuce.

Building Redis-Modules with JavaScript using Cthulhu

Image
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.

Extending Redis with Redis-Modules

Image
Redis is a great K/V store written in C. Redis can accomplish a lot for a single thread process. There are many applications for redis like for instance:  - Frontend Database - Real-time Counters - Ad Serving - Message Queue - Geo and TimeSeries DB - Session State - Cache That's all great but let's say I want more, how can we customize redis? There are some options like a Lua Script , Fork Redis, Tak to @Antirez or Create your own NoSQL database based on redis or not. Redis provided another solution - Redis added support for external modules in 2016.