On 1/18/22 12:52 PM, Kai Engert wrote:
> Are there strong reasons why either SQLite or IndexedDB should be
> preferred?
I assume that the storage will be used mainly from JS, in that case
IndexedDB might be a better option, because you can store JS objects in
it easily (it's called structured cloning). Even DOM blob objects can be
easily stored in IndexedDB.
> I see that IndexedDB doesn't guarantee that data will remain
> available, rather the browser/platform may decide at any time to
> delete it when storage is slow.
If you use IndexedDB from chrome (using the system principal), the
stored data won't ever be automatically deleted by the browser. I can
provide you more details about that if you are interested.
> Also it seems that IndexedDB gets mapped to raw sqlite storage? If
> true, then IndexedDB could be seen as an unnecessary layer.
Yes, IndexedDB uses SQLite internally, but that should be considered as
an implementation detail only.
I would recommend direct use of SQLite only for highly optimized storage
and queries (full control over the underlying database system).
> However, the argument has been brought up that in general, it could be
> seen as a best practice for Thunderbird to prefer the use of
> standardized web technologies, as it's less likely to get
> deprecated/removed from the platform.
IndexeDB was the primary storage for Firefox OS (IIRC, almost for all
system and app code), that is probably still true in KaiOS.
Lastly, it would be good for our IndexedDB implementation itself if we
had a consumer which is closely tight with mozilla-central.
Please let me know if you have any questions.
Jan