Repository navigation
Description
there are quite a few changes I'd like make to the Store API, based on experience with our existing API and also lessons from libraries like tensorstore, zarrs, and zarrista
- formally separate sync stores from async stores. stores that benefit from asyncio (e.g., http) would use async. stores that don't benefit from it (memory) would not. this change would remove tech debt accrued as part of the
FusedCodecPipelinedevelopment process, where we added synchronous store methods after the fact to some stores. see fully separate sync and async internal APIs #4217 - associate IO operations with return values that include information about the IO operation itself. e.g., instead of
store.getreturning raw bytes or None, it returns someIOResulttype that contains the raw bytes (or absence) as well as information like etag, timestamp, etc. this will make caching much easier. - caching in all stores by default (e.g., folding
CacheStoreinto the base store class) - first-class support for conditional IO operations, gated by platform support
- type-level distinction between read-only stores and stores that support mutation
- debugging / consistency / deduplication. there are many inconsistencies between our store classes today that are a constant source of bugs, mostly in path handling. we have also mirrored our store API in two classes:
StoreandStorePath. a rationalization effort will get us a much lower rate of bug reports.
etc, there are probably many more fixes / improvements I'm not listing here.
I don't think it's practical to make these changes as a sequence of gradual alterations to our existing Store API. It would take forever, and friction would jump to infinity with the first breaking change. So I have a different idea:
- define a
zarr_storagesubpackage atpackages/zarr-storage - copy + paste our existing
Storeapi inzarr_storage.legacy zarrdepends onzarr_storagefor the legacy store API (i.e., no behavioral changes)- develop a new store API in
zarr_storage. when that new API is stable, we allowzarrto consume it. crucially, we can add new features tozarr_storagewithout affectingzarr. - when the new store API is established, we deprecate
zarr_storage.legacy - finally,
zarrdepends exclusively on the new API. This could be a major version increment ofzarror not, depending on how smooth we make the deprecation.
This will also be slow, but I think it will be gradual, i.e. we can make progress using this strategy. Third-party store implementations like Icechunk will have plenty of time to adapt. And we can keep support for the old Store API around as long as we need.
So, the main discussion point is whether a subpackage is a good way to evolve our storage API. Personally I don't see an alternative way to ship fundamental changes like the return type of get without a ton of immediate breakage, but maybe folks have better ideas.
If we are aligned in this path, I'd start pushing the requisite changes.
Activity
d-v-b commentedon Dec 1, 2026
cc @zarr-developers/python-core-devs
normanrz commentedon Dec 1, 2026
Sounds good!
maxrjones commentedon Dec 1, 2026
Thanks for the proposal, Davis. I agree with all your motivations and the vision.
Procedurally, I don't understand the benefits of doing 2-3 before 4. It seems like defining zarr-storage's interfact is the hard part. I think there's value in doing the hard part first, since 2-3 offers is only worthwhile if 4 succeeds. So, let's built zarr-storage first and make sure it can be designed in a way that makes the creation of a legacy module worthwhile.
d-v-b commentedon Dec 1, 2026
hi max, I'm totally up for developing the future API concurrently with other steps. I've already started this work on my fork (see d-v-b#460, d-v-b#464). For me the big change in 4. is making
zarrdepend on the new API. I think we only want to do that afterzarrdepends onzarr-storage(e.g., for the legacy API). What I want to avoid is a holding pattern situation where we have the legacy API defined in two places (e.g.,zarrandzarr-storage), and we have to apply patches / bugfixes to two libraries untilzarrdepends onzarr-storage. That's why I proposed makingzarrdepend onzarr-storagebefore makingzarruse the new API. But we can definitely develop the new API continuously!