Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate alternative datastore for embedded js-ipfs #786

Closed
2 tasks
lidel opened this issue Oct 9, 2019 · 1 comment
Closed
2 tasks

Evaluate alternative datastore for embedded js-ipfs #786

lidel opened this issue Oct 9, 2019 · 1 comment
Labels
area/brave Issues related to Brave Browser area/chromium Issues related to Chromium-based browsers help wanted Seeking public contribution on this issue

Comments

@lidel
Copy link
Member

lidel commented Oct 9, 2019

Background

  • js-ipfs embedded in Brave (Embedded JS-IPFS in Brave (experiment) #716) stores data in datastore-level (js-ipfs-repo/src/default-options-browser.js#L7-L10), which afaik uses level-js backed by IndexedDB on extension's background page.
    • This is exactly the same datastore as in js-ipfs embedded on a regular webpage
  • Both Firefox and Chromium provide browser.storage.local to WebExtensions
    • API is asynchronous with bulk read and write operations (batching)
    • ipfs-companion already asks for unlimitedStorage permission, so there won't be any action required from the user
  • WebExtension-specific datastore may produce better performance (or not, its backed by IndexedDB in Firefox.. needs benchmarking)

Candidates

  • datastore-level - (current) leveldb wrapper on top of IndexedDB
  • datastore-<idb-batch> - new datastore on top of IndexedDB with batching
  • datastore-<webext-storage> - new datastore created on top of chrome.storage API

Out of scope:

  • chrome.fileSystem – With this API, Chrome Apps can read and write to a user-selected location, but it prompts user to pick directory/file, which makes it not feasible here.

TODO

  • benchmark
    • create simple WebExtension that
    • opens tabs with embedded js-ipfs, each configured with different datastore
      • caveat: batching (bulk writes) may produce the biggest gains, so make sure both versions either batch or not when testing.
    • runs ipfs.add / ipfs.cat on files 1k 100k 1M/10/50/100MB
  • make the decision

References

@lidel lidel added help wanted Seeking public contribution on this issue area/brave Issues related to Brave Browser area/chromium Issues related to Chromium-based browsers labels Oct 9, 2019
@galargh galargh moved this to To do in IPFS-GUI (PL EngRes) Sep 22, 2022
@lidel
Copy link
Member Author

lidel commented Aug 26, 2024

No longer relevant, js-ipfs was sunset, and 5 years later we have other toys, like https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system
Modern Helia and its datastores will be tracked in #1284

@lidel lidel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/brave Issues related to Brave Browser area/chromium Issues related to Chromium-based browsers help wanted Seeking public contribution on this issue
Projects
No open projects
Status: Needs Grooming
Development

No branches or pull requests

1 participant