Monday, July 25, 2011

eredis: a Redis client in emacs lisp

I set up a google code project today for eredis. A Redis client in emacs lisp.

The program consists of a single emacs lisp file eredis.el

emacs lisp includes facilities for writing network applications. In my code I use `make-network-process' to open a connection to a specified redis server. Then the Redis api is exposed.

One nice feature of emacs I have used is org-table-mode. This lets you edit and manage the data in a Redis server in an org table. For example, you can grab all keys matching a pattern and create an org table from the key value pairs, then edit that table. You can then send it back to Redis with interactive commands that send either the whole table, or just the current row back to Redis using mset or set.

This work flow is not safe when working with multiple users, if you care about overwriting each others data. For example, I could store the last values you got from Redis in addition to your edited values. When you go to set a new value I first grab it from Redis, check if it has changed since you got it, and if so warn you (showing you the new value). For many work flows this would work well. For example the use case of a group of users editing a shared DB of configuration data.


Anonymous said...

eredis: nice! Couldn't stop smiling while looking at the screen casts. Thanks for sharing...

Justin said...

haha thanks!