use IndexedDB for storing structured data
In all WebExtension guides the
storage API was presented as the thing to use. I thought all other storage mechanisms are either unavailable or non-persistent when used from WebExtension. Now, after almost a year of fighting the
storage.local, I realized IndexedDB is also available and will remain so even in ManifestV3. It supports transactions, so no routing of storage writes/reads to background scripts will be needed :)
The only thing IndexedDB lacks is observability.
storage.local might still be useful to notify different contexts of changes in the db. It would then be used in parallel with IndexedDB and we'd reset it on every browser startup.