Skip to content

Add general CacheStore to Zarr 3.0 #3357

Closed

Description

@ruaridhg

This is something that would be very helpful to have ported from zarr-python 2

Activity

  1. d-v-b commented on Aug 7, 2025

    @d-v-b
    Contributor

    agreed, but I think you can get the same functionality today using a modified store class: see this example, which uses a primary store (where the data is coming from) and a cache store (where you want to store the data as a cache). This might be better than the LRUStoreCache because in this case you can easily re-use the cache later, but I haven't tested this approach extensively

  2. ruaridhg commented on Aug 7, 2025

    @ruaridhg
    ContributorAuthor

    Happy to work on this approach using the example and see how far I get.

  3. d-v-b commented on Aug 7, 2025

    @d-v-b
    Contributor

    great! if this is useful, then we could definitely include it in the library

  4. changed the title [-]Add LRUStoreCache to Zarr 3.0[/-] [+]Add general StoreCache to Zarr 3.0[/+] on Aug 11, 2025
  5. changed the title [-]Add general StoreCache to Zarr 3.0[/-] [+]Add general CacheStore to Zarr 3.0[/+] on Aug 11, 2025
  6. FabricioArendTorres commented on Sep 10, 2025

    @FabricioArendTorres

    A general comment regarding use of caches:

    I mainly use zarr is for Machine Learning, for efficient data loading during model training.
    ML however relies on mostly random sampling (without replacement, i.e. for each epoch one datapoint is only loaded once) from a huge dataset.

    That is, any caching similar to LRUCache that relies on caching the more frequently accessed data would be essentially useless in that scenario. A more 'stupid' caching (i.e. just cache everything accessed until limit is reached, without any concept of 'staleness') might be really helpful for such applications.

    Of course implementing ones own is always an option, but I'd guess this is not such a niche case and would benefit from a default support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions