Recommendations for Key/Value-storages (Hashmap Libraries)

I need to store and manage some data on the STM32F1. Up to a few GB. I want to store the data on a SD Card.

So, I searched for some databases to use them within RIOT. Wasn’t that successful.

I could also just write one by myself. I thought about using a Hashmap for it.

So, I just wanted to ask you if you have some recommendation to how I could solve this.

Some recommendations for libraries or maybe even better approaches.

Thanks :slight_smile:

Hi,

I need to store and manage some data on the STM32F1. Up to a few GB. I want to store the data on a SD Card.

Why an STM32F1? The fact that you intend to fill multiple gigabytes show that power consumption doesn't really matter. The time to create the data, let alone write over the F1's SDIO interface, rule out a battery powered installation. At that point, just chose a more capable MCU.

So, I searched for some databases to use them within RIOT. Wasn't that successful.

I'd research how the available file systems implement their directory indexes. They might already use optimized datastructures for that. Then just use them with nested folders.

E.g., if your key is "foobar", hash that into "ABCDEFGFOOHASH" (always same hash length), then store it into "/AB/CD/EF/GF/OOHASH". Create folders as needed. Depending on the used indexing, nest deeper or less deep. To get a key, try to open the file belonging to the hashed key string. Let the file system do the work.

Kaspar