in-memory key-value lightweight database

For my little project i3-change.py I need lightweight in-memory database. My first idea was to use Redis (I have some experience with it) but it requires some library to control it. I need something more lightweight. I think using linux named pipes is elegant way how communicate with a database. Here is the full source of my lightweight in-memory database: https://github.com/petrposvic/in-memory-storage.

You can create a database instance with starting the daemon (only argument is where will be named pipe created):

./in_memory_storage_daemon.py /tmp/ims

Then you can put and get values with echo command:

$ echo "test=abc" > /tmp/ims && cat /tmp/ims
[ok]

$ echo "test" > /tmp/ims && cat /tmp/ims
abc

Leave a Reply

Your email address will not be published. Required fields are marked *