embedded database example?

phatpaul
Posts: 48
Joined: Fri Aug 24, 2018 1:14 pm

embedded database example?

Postby phatpaul » Thu Sep 06, 2018 11:15 pm

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.

phatpaul
Posts: 48
Joined: Fri Aug 24, 2018 1:14 pm

Re: embedded database example?

Postby phatpaul » Tue Sep 25, 2018 2:06 pm

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?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: embedded database example?

Postby kolban » Wed Sep 26, 2018 3:27 am

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: Bing [Bot] and 28 guests