2

IndexedDB is often recommended for storing large amount of data in WebExtensions (or Chrome Extension). "unlimitedStorage" seems to apply to both IDB and Storage.

In case of non-tabular text data where the indexed searches are not needed, what is the benefit of using IndexedDB over Storage?

They both use object based architecture and there is a great performance overhead in case of IDB.

I tested parsing and saving 4mb data to storage which took less than 1 second while in case of IDB it hung the browser for minutes and I had to forcefully shut it down.

Reference: Chrome extension store large amounts of data

Only WebSQL, IndexedDB, chrome.storage.local and HTML5 File System (sandboxed file system) can grow past 5MB limit via "unlimitedStorage" permission.

manifest.json: "permissions": ["unlimitedStorage"]

Provides an unlimited quota for storing HTML5 client-side data, such as databases and local storage files. Without this permission, the extension or app is limited to 5 MB of local storage.

erosman
  • 7,094
  • 7
  • 27
  • 46
  • 1
    You can store blobs in IDB – Daniel Herr Nov 16 '17 at 17:39
  • The `unlimitedStorage` permission applies only to Web SQL Database and application cache. Refer to [crbug 58985](https://bugs.chromium.org/p/chromium/issues/detail?id=58985) – Denis L Nov 17 '17 at 11:48
  • @Deliaz Please check https://stackoverflow.com/questions/34060487/chrome-extension-store-large-amounts-of-data – erosman Nov 17 '17 at 12:09
  • "it hung the browser for minutes and I had to forcefully shut it down" sounds like you're doing it wrong, to be honest. Care to show sample code? – Xan Nov 17 '17 at 12:25
  • @xan Well that was not the question but try to parse and write a 4mb CSV file with 275+k records each with multiple properties to indexedDB and see. – erosman Nov 17 '17 at 12:40

0 Answers0