2 ms·
I'd argue that the other aspect is that it abstracts out serialization. I have a small hobby project (a frontend for a TV tuner device) that originally held ch
by hakfoo 3y ago
I'd argue that the other aspect is that it abstracts out serialization.
I have a small hobby project (a frontend for a TV tuner device) that originally held channel and EPG data in a few python dicts.
This was clunky because I had to manually JSON-encode them and write them out, and saying "rewrite an entire 500kb config file when just 10 bytes had changed" always felt wrong. (Although, as I gather it, on an SSD, rewriting one byte may as well be the same as the whole file).
I replaced the guts with SQLite in part for that. I figured it's used enough for "we changed one row of 5,000" use cases that it would be optimized for that case. It also made cross-references simpler-- multiple table scans can be chained in a single statement, rather than having to nest queries and pass intermediary results from scan to scan. (For example, some program-guide data is more sensibly cross-referenced by physical channel number, and some by "display" channels, so being able to join in a table that maps the two streamlines stuff)