gzuidhof / zarr.js

Javascript implementation of Zarr
https://guido.io/zarr.js
Apache License 2.0
132 stars 23 forks source link

Supporting BrowserFS-based store #78

Open oeway opened 3 years ago

oeway commented 3 years ago

Hi, the Zarr-Python librarry can use fsspec for supporting different backend, I am wondering what you think about supporting BrowserFS based file system, so we can also easily swap between different storage backend.

manzt commented 3 years ago

I'm not very familiar with the library, but generally I'm hesitant to add this package as a dependency to Zarr.js for a couple reasons:

1.) The project appears to be mostly unmaintained and is only distributed as a UMD bundle. (Last commit was Jan 2020, and there were only three commits in 2019). Zarr.js is intentionally minimal and adds the "core" features of Zarr.

2.) Due to the various runtimes for JavaScript (web browsers, Node, Deno, etc), adding storage implementations that are platform-specific complicate bundling and the compatibility of Zarr.js in these different environments. BrowserFS relies on WebAPIs that would break in Node for example. It is for this reason that we don't implement a DirectoryStore, which would rely on Node builtins like fs https://github.com/zarr-developers/zarr_implementations/pull/21.

With that said, it should be straight forward to implement a valid Store interface around BrowserFS in an independent library that is browser specific. I'd be very excited to see npm libraries like zarr-storage-browser, zarr-storage-node, etc that can be composed with Zarr.js and reused by others in the community.