interrupt icon indicating copy to clipboard operation
interrupt copied to clipboard

Re: embedded databases

Open jaskij opened this issue 1 year ago • 0 comments

Having read your article, while it was nothing new to me, it's a very nice summary.

Personally, I have found that for simpler devices, it's often enough to have a version field, some form of checksum, and two copies. Simple, safeguards against failures, and expandable.

First, a minor nitpick: I am currently working on a project with STM32H7, and while the page is 32 bytes, you must erase whole sectors, which are 128k. That hurts.

Now to the meat of my comment:

SQLite

Have you considered it? It's probably a bit too massive for your simpler devices, but it has a few nice features to consider. Porting it also does not take long, speaking from experience.

Pros:

  • robust, battle-tested code that's been around for a long time
  • full-featured SQL engine
  • easy to port (once you get through the documentation)
  • stable file format which can serve as data exchange with other systems Cons:
  • as far as I know, it requires dynamic memory allocation, which is not always available
  • large, both in code size and RAM

jaskij avatar Jul 24 '24 22:07 jaskij