Store types and backends¶
Where a store’s bytes can live, how zarr-vectors-py picks a storage
backend, and which extras each backend needs.
Terms¶
- Backend
The Zarr v3 store (
zarr.abc.store.Store) that carries a store’s bytes. It is named by a string:"local","obstore","fsspec"or"icechunk". Selection is inzarr_vectors/core/backends/__init__.py; construction is inzarr_vectors/core/store.py.
Introduction¶
Every operation works the same on every backend. The backend affects only latency, throughput and cost per request.
Backend |
Zarr store |
Built with |
Extra |
|---|---|---|---|
|
|
|
none |
|
|
|
|
|
|
|
|
|
Icechunk session store |
an Icechunk repository session |
|
A pre-built Zarr store, such as zarr.storage.MemoryStore, can be
passed wherever a path is accepted. A writer given a pre-built store
does not pass its bounds or chunk shape to it, so call create_store
on the store first.
Technical reference¶
Entry points¶
zarr_vectors.open(source, *, mode="r", storage=None)
zarr_vectors.create(target, *, schema, storage=None)
zarr_vectors.open_or_create(target, *, schema, storage=None, on_conflict="raise")
source and target may be a path, a URL or a pre-built store.
StorageOptions(backend=None, options={}, branch=None) names the
backend and holds the options for its constructor: obstore from_url
keyword arguments, fsspec storage_options, or Icechunk storage
settings. branch is the Icechunk branch to open (default "main");
it raises with any other backend. On an object store the dataset API
packs cells into shards by default (Layout(pack="auto")).
The lower-level create_store and open_store in
zarr_vectors.core.store take backend=, storage_options= and loose
**backend_kwargs, which are merged into storage_options. Both return
a Group, the library’s wrapper around a Zarr group; open_store also
accepts a Group. The local
backend and pre-built stores take no options; passing any raises
TypeError. The type writers and readers (write_points,
read_points and the others) take backend= but no options. For
credentials, rely on the environment or pass an open store.
Backend selection¶
resolve_backend_name uses the first of:
the explicit backend (
StorageOptions.backendorbackend=);the
ZARR_VECTORS_BACKENDenvironment variable;the URL scheme:
Scheme |
Backend |
|---|---|
none, |
|
|
|
An explicit backend applies to any scheme, so backend="fsspec"
reaches any filesystem fsspec has a driver for. Icechunk is used only
when named.
Backend notes¶
Backend |
Notes |
|---|---|
Local |
One file per stored cell. Sharding packs cells into fewer files. |
Object stores |
One object per stored cell, so larger chunks or sharding mean fewer requests (see Chunk shape). Credentials come from the options or the environment (for example |
Icechunk |
Opens a repository at a local path or a |
Consolidated metadata |
Not written or used. A read gathers the metadata nodes it needs in one batch. |
ZIP |
|
import zarr_vectors as zv
ds = zv.open(
"s3://my-bucket/scan.zarrvectors",
storage=zv.StorageOptions(backend="obstore",
options={"region": "us-west-2"}),
)
Validation¶
The backend does not change validation.
zarr_vectors.validate.validate accepts a path, a URL or an open
store, and level 1 reports an error when the store cannot be opened.
See Validation.