Page 1 of 1

embedded database example?

Posted: Thu Sep 06, 2018 11:15 pm
by phatpaul
I want to embed a small database in the ESP32.
I'm using the WROVER module with 4.5M RAM / 16M Flash.

It will be the central data store to save and sync the state of a html/js APP.
Multiple APP clients will connect concurrently (use websockets?) and need to be notified of any changes to the database immediately.
It will hold user settings and state information. (some of it is volatile, some non-volatile -does/doesn't need to be preserved after a reboot)
  • * I estimate needing around 3 tables with 10~20 fields and 10~50 entries each.
    * I don't need to change schema or add tables at run-time, just add/remove/change entries.
    * It should be accessible by the http-server process. (Im currently using libesphttpd)
    * It should be resilient to power interruption.
    * I guess it should be a relational database (i.e. tables), but I'm not sure if that's a requirement.
    * It should allow concurrent? read and write access by multiple http clients. (or sequential?)
Does something like SQLite make sense? Is it portable to the ESP32?
Or is there something far simpler that would make sense?

I'd appreciate any examples of local data storage on the ESP32.

Re: embedded database example?

Posted: Tue Sep 25, 2018 2:06 pm
by phatpaul
any examples of local data storage on the ESP32??

I know of the NVS driver, but is there an equivalent for RAM-backed volatile key-value storage?

Re: embedded database example?

Posted: Wed Sep 26, 2018 3:27 am
by kolban
Maybe look at the following:

https://docs.espressif.com/projects/esp ... index.html

I'd suggest looking at the FAT Filesystem. Using this, you can create files that are backed by flash storage.