For a project I'm currently working on I collect data from different sources (e.g. GPS Dongle, OBD-II, etc.) and displaying them on a small touchscreen display using PyGame and TSLIB. The whole projects run on a RPi3.

I wanted to make it a little failsafer so all sensors should have their own (Python-written) daemon which gets the data and writes them to a central storage. The UI can then go to this central storage and read the needed data from there. For the time being I'm using a MariaDB with a simple Key-Value table. The table looks something like this:

ItemKey          ItemValue
GPS.Latitude     123.4567890
GPS.Longitude    12.34567890
GPS.Altitude     152
GPS.Speed        9.124151

But I am not 100% satisfied with this solution.

My question therefore is: Is there a "DBMS" which can support multiple users reading from and (most importantly) writing to it and resides in memory (RAM) so I don't have to write stuff to Disk / SD Card?

Improvments to my concept are welcome as well.


Redis should serve you well. It will reside in memory but intermittedly writes back to disk for persistence. You can disable the persistence and set memory limits and the Python library from pip is pretty easy. Redis does a good job of serialising access too so multiple clients are no problem.

And now I've remembered what it's called...

If you wanted to run a smaller, lightweight Key/Value DB LevelDB might be worth a go. You need to wrap your own process around it to manage reading and writing from multiple sources / remotely but it has some Google pedigree and should be pretty performant. You may have to compile it yourself though.

| improve this answer | |
  • I hade a look at the Redis tutorial (try.redis.io) and it sounds very promissing. I will try this out but I'll leave the question open for more suggestions if there are any. – Raphael Guntersweiler Oct 24 '17 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.