3 ms·
Although SQLite's memory overhead is tiny by the standards of modern desktops/servers/phones, it's still much too big for 8-bit microcontrollers like the Arduin
by teraflop 11y ago
Although SQLite's memory overhead is tiny by the standards of modern desktops/servers/phones, it's still much too big for 8-bit microcontrollers like the Arduino. If you want to build something that costs tens of cents instead of tens of dollars, SQLite is way too big.
For example, https://www.sqlite.org/about.html https://www.sqlite.org/about.html claims that SQLite can run in "very little heap (100KiB)"; this project targets an Atmel ATmega2560 which has only 8KiB of RAM.
(I doubt "5 times smaller than SQLite" is a useful comparison; the limiting factor is probably RAM consumption, as opposed to executable code which can be stored in cheaper non-volatile memory.)
- pfalcon 11y agoI thought hard what to put in the subject (limited length, you know) - code size or working RAM size, but figured if I write "can run queries in 1KB", people won't get it ;-).
- rattray 11y agoConsider putting some comparisons on the readme!
- pfalcon 11y agoThat's what I'm telling LittleD's author too! I posted here on HN just to show him that it's not my whim, and other people think the same ;-).
- dang 11y agoSince the size comparison to SQLite in the title has made the thread mostly be an argument about size comparisons and SQLite, let's try the other phrase and see if we fare better. (Submitted title was "LittleD – SQL database for IoT, 5 times smaller than SQLite").
- collinmanderson 11y agoI actually saw the new title without SQLite, and I my first question was still how it compared to SQLite. :)
- tkinom 11y agoIMHO, for that kind of 8bit device/size, the app storage requirements is most likely limited. define a few C structs with standard read() write() function call are most likely be enough and it is easy to design/test/debug. One has a lot more control on RAM/ROM/Code space with that approach. You can easily find out where/how every single byte/bit of memory is used.
- pfalcon 11y ago128K/256K of builtin flash is a midline for microcontrollers now. A 16Mb SPI flash chip costs $0.5, and many newer devices have some external flash. Of course, nobody precludes you to manage all that space manually, bit by bit.
- geedy 11y agoIn our lab, we have used both SD-cards and flash chips built in to devices to make storage a possibility. When you need or want to do anything complicated, such as a projection or a join, IImplementedItDB tends to become a headache.