Developing new storage backends

One advantage of the zarr data model is that it can be used in combination with a variety of storage backends. Currently in this package there is support for a DictStore (keeping data in memory), DirectoryStore (writing data to a local disk) and an S3Store for S3-compatible object store which is currently read-only. In order to implement a new storage backend, you would have to create a subtype of Zarr.AbstractStore and implement the following methods:

Zarr.storagesizeFunction

storagesize(d::AbstractStore, p::AbstractString)

This function shall return the size of all data files in a store at path p.

source
Base.getindexMethod
Base.getindex(d::AbstractStore,i::String)

Returns the data stored in the given key as a Vector{UInt8}

source
Base.setindex!Method
Base.setindex!(d::AbstractStore,v,i::String)

Writes the values in v to the given store and key.

source
Zarr.subdirsFunction
subdirs(d::AbstractStore, p)

Returns a list of keys for children stores in the given store at path p.

source

You can get some inspiration on how to implement this by looking at the source code of existing storage backends.