5 ms·
When would you actually need a relational database running on such a small platform, today? I understand programming in general and microcontrollers; I was pai
by listic 11y ago
When would you actually need a relational database running on such a small platform, today?
I understand programming in general and microcontrollers; I was paid to program one. Still, surely nowadays a system with a tiny 8-bit microcontroller is probably considered as auxillary to some kind of larger machine, which should be way better equipped to do the heavy lifting such as SQL databases?
- Sanddancer 11y agoThere are still lots of uses for tiny microcontrollers that don't connect to a larger machine, or only do so on occasion. By having a database backend, you make it a lot easier to query the microcontroller out in the field for a specific subset of data, instead of it needing to dump everything out, wasting time and battery life.
- niutech 11y agoYou can easily get just part of your data using a binary tree or a hashtable and simple C functions like for, while, if. In most cases there is no need for a full-blown SQL engine.
- teraflop 11y agoOn the other hand, microcontrollers typically have ample Flash storage for code, but very limited amounts of RAM. Instead of making everyone rewrite their own memory-efficient data structures, it might well make sense to have a single, general-purpose implementation -- even if some of the code goes unused in a particular application.
- listic 11y agoWell, if you can really make SQL work well within such constraints and be convenient to use - I see no harm in it.
- niutech 11y agoKeep in mind that the Flash storage has a limited number of writes, so keeping frequently changing data in memory and choosing a right data structure can be crucial for your data's life span. SQL is not an universal solution for all use cases.
- geedy 11y agoYou are not wrong, but consider that the problem may be handled a number of ways. Once I move to storing everything through IonDB, you will be able to choose key-value stores that could wear level, should one be implemented. Such algorithms have been suggested in other works. Furthermore, if the device supports a storage API that already does wear levelling, you than a SQL layer on top should not hurt.
- geedy 11y agoIf all you need is a key-value store, consider IonDB: https://github.com/iondbproject/iondb https://github.com/iondbproject/iondb