Skip to content

Browser Using the File System Access API #332

@swiftyjam

Description

@swiftyjam

Description:

Currently, Helia uses IndexedDB-based blockstore/datastore (IDBBlockstore and IDBDatastore) in the browser. While these work, IndexedDB has limits on storage size and performance. I propose adding a new blockstore implementation for browsers that leverages the File System Access API. This would allow users to choose a local folder for storing blocks, offering:

  • Larger storage capacity: Bypassing some IndexedDB limitations.
  • Better persistence and backup: Data is saved as files on the local filesystem, making it easier to back up or transfer.
  • Potential performance improvements: Direct filesystem access might be faster for some operations.

Implementation:

  • Create a blockstore-FS that follows a similar interface to the Node.js blockstore-fs, but is adapted for the browser using the File System Access API.
  • Provide a fallback to IndexedDB if the File System Access API is not supported.

Open Questions:

I do not fully understand what limitations or trade-offs might arise with this approach. I would love to hear opinions and suggestions from the community on potential challenges, such as issues with cross-browser support, performance, or security. What do you think guys? 🤔

Potential Benefits:

  • More flexibility for apps with high storage needs.
  • Easier backup and transfer of stored data.
  • Improved user experience on supported browsers (e.g., Chrome, Edge).

Feedback and discussion on design details and potential limitations would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions