Redis Implemented With Node
Nedis is a (partial) redis implementation written with node. Primarily for fun, however as our team grows larger, and as we add more non-technical team members over at LearnBoost I figured it would be nice help prevent the need for compiling development dependencies.
Nedis is an old side project I had going, and is no where near complete, but it does work, so I figured I would open-source it. Currently Nedis implements the unified Redis protocol which is an brilliantly simple binary-safe protocol that is human and machine friendly.
Using Existing Tools
Currently we use Redis for sessions in our app, so having a drop-in replacement is a great way to get session support for your app without booting up
redis-server. For example the nodejs module connect-redis can utilize Matt Ranney’s fantastic redis client without change.
Another neat side-effect is that you can use existing redis tools such as
redis-cli to interact with Nedis. First let’s start Nedis with
Now we can play with the cli, interacting with node
$ redis-cli redis> hmset users:tj email firstname.lastname@example.org age 23 OK redis> hgetall users:tj 1) "email" 2) "email@example.com" 3) "age" 4) "23" redis> keys users:* 1) "users:tj"
nedis-server basically consists of no more than the line of js below, so it’s easy to boot from within your process if desired.
Below is a list of the commands currently supported by Nedis
I have yet to do any kind of profiling, heavy optimization, or stress testing. If nothing more hopefully Nedis will help you guys explore Redis, or how you can prototype basic databases with node. Head over to the GitHub repo for installation instructions etc.