A while ago I posted on the C, IoT, and Embedded subreddits - as I was trying to find a way to store variable configuration information on a small / embedded device, with limited storage and RAM. You folks were awesome in suggesting possible solutions. A really popular solution was either keeping all the configuration in RAM and writing it to persistent storage, or alternatively using something like SQLite. But I kinda had an itch, there is a set of devices that fall somewhere in between, SQLite is too big, and keeping everything in RAM isn't possible. Is there something I could do that would sit in the middle?
Like any software developer, I kinda had "the itch", just to see if I could write something to do just that. The requirements were basically a simple object store, where the objects are strings or plain old C objects. So I had a go. The result is oStore, a very simple object storage solution. It comes with a command line tool to allow you to create and inspect oStore files, and an API / library which can be used in projects.
I've tried to make sure that the memory usage is small as possible, that all disk / persistent file system stores a live copy of the data.
Giving back is fun Github Link Here
I wanted to share this with you folks, it feels good to give something back, and I really appreciate all the feedback you've given me so far. Now, the oStore project is a good proof of concept, it needs some work to make it a bit more robust. I need to write some "recovery" code to restore a broken or corrupt store, and a small change to support commit's, where an object can be changed, and then "committed" to disk, both of these efforts would make the store more reliable in low power conditions.
Worth while continuing ?
As much as I love developing for the sake of it, I'm wondering if I should continue investing time on this. It has been fun, and I've some other ideas I'd like to work on too. So I'm hoping for a bit of feedback, let me know what you think? - Useful? I'm really in two minds - It has been fun to play with, I've got an itch, that says I should "finish" it, and add the extra items I'm thinking about, including a more easy to use API, but at the same time I'm also happy to park the idea ?
const TOStoreObjcID ID = 42; const char* STRING_TO_SAVE = "This was fun! Shall I park the idea? or clean up with API?"; uint32_t size = strlen(STRING_TO_SAVE) + 1; const uint32_t offsetWithinObject = 0; int error = ostore_write(store, ID, offsetWithinObject, STRING_TO_SAVE, size);
submitted by /u/mc_woods