Zarr
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Differences Between Zarr V2 and Zarr V3 This document summarizes all significant differences between the Zarr Storage Specification Version 2 and the Zarr Core Specification Version 3 (current version: 3.1). ## Metadata File Layout | **Aspect** | **V2** | **V3** | |--------|----|----| | **Array metadata** | `.zarray` | `zarr.json` | | **Group metadata** | `.zgroup` | `zarr.json` | | **User attributes** | `.zattrs` (separate file) | `attributes` field inside `zarr.json` | | **Node type indicator** | Implicit (determined by which dot-file exists) | Explicit `node_type` field (`"array"` or `"group"`) | In V2, array metadata, group metadata, and user attributes are stored in three separate files. In V3, everything is consolidated into a single `zarr.json` document per node. This reduces the number of storage operations needed to read or write a node and eliminates race conditions between metadata and attribute files. ### V2 example (3 files) `.zarray`: ```json { "zarr_format": 2, "shape": [10000, 10000], "chunks": [1000, 1000], "dtype": "<f8", "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1}, "fill_value": "NaN", "order": "C", "filters": [{"id": "delta", "dtype": "<f8", "astype": "<f4"}] } ``` `.zattrs`: ```json {"foo": 42, "bar": "apples"} ``` ### V3 example (1 file) `zarr.json`: ```json { "zarr_format": 3, "node_type": "array", "shape": [10000, 1000], "data_type": "float64", "chunk_grid": { "name": "regular", "configuration": {"chunk_shape": [1000, 100]} }, "chunk_key_encoding": { "name": "default", "configuration": {"separator": "/"} }, "codecs": [ {"name": "bytes", "configuration": {"endian": "little"}} ], "fill_value": "NaN", "attributes": {"foo": 42, "bar": "apples"} } ``` ## Group Metadata | **Aspect** | **V2** | **V3** | |--------|----|----| | **File** | `.zgroup` | `zarr.json` | | **Content** | Only `zarr_format` | `zarr_format`, `node_type`, optional `attributes` | | **Attributes** | Separate `.zattrs` file | Inline `attributes` field | | **Ancestor creation** | Ancestors must be explicitly created | Ancestors must be explicitly created (implicit groups were removed) | In both V2 and V3, creating an array at path `foo/bar/baz` requires ensuring group metadata exists at `foo/bar`, `foo`, and the root. An earlier V3 draft supported implicit groups, but this was removed (see [PR #292](https://github.com/zarr-developers/zarr-specs/pull/292)). ## Data Types | **Aspect** | **V2** | **V3** | |--------|----|----| | **Field name** | `dtype` | `data_type` | | **Format** | NumPy typestr format (e.g., `"<f8"`, `">i4"`, `"\|b1"`) | Named identifiers (e.g., `"float64"`, `"int32"`, `"bool"`) | | **Byte order** | Embedded in dtype string | Handled by the `bytes` codec | | **Structured/compound dtypes** | Supported via nested lists | Not in core; available via extensions | | **Datetime/timedelta** | `datetime64` and `timedelta64` built-in | Not in core; available via extensions | | **Strings** | Fixed-length strings (`\|S12`) and unicode (`\|U12`) | Not in core; available via extensions | ### V3 core data types `bool`, `int8`, `int16`, `int32`, `int64`, `uint8`, `uint16`, `uint32`, `uint64`, `float16` (optional), `float32`, `float64`, `complex64`, `complex128`, `r*` (raw bits, optional) V3 data types are language-agnostic identifiers rather than NumPy-specific format strings. Endianness is no longer part of the data type and is instead specified through the `bytes` codec. The `data_type` field is an extension point, so new data types can be added without modifying the core spec. ## Chunks and Chunk Grid | **Aspect** | **V2** | **V3** | |--------|----|----| | **Field name** | `chunks` (array of ints) | `chunk_grid` (named object with configuration) | | **Grid types** | Only regular (uniform) grids | Regular grid in core; rectilinear and others via extensions | | **Specification** | Flat array: `[1000, 1000]` | Object: `{"name": "regular", "configuration": {"chunk_shape": [1000, 100]}}` | The chunk grid is an extension point in V3, enabling future grid types (e.g., rectilinear grids with non-uniform chunk sizes) without changing the core spec. ## Chunk Key Encoding | **Aspect** | **V2** | **V3** | |--------|----|----| | **Field** | `dimension_separator` (optional) | `chunk_key_encoding` (required) | | **Default separator** | `.` | `/` | | **Key prefix** | None | `c` | | **Example key** | `0.0` or `0/0` | `c/0/0` or `c.0.0` | | **0-d array key** | N/A | `c` | V3 introduces a `c` prefix to chunk keys by default, which separates chunk data from metadata in the key namespace. The default separator changed from `.` to `/` (matching N5's convention), which produces a directory-like hierarchy that reduces the number of entries per directory on filesystem-based stores. V3 also defines a backward-compatible `v2` chunk key encoding (`"chunk_key_encoding": {"name": "v2"}`) that preserves the old key format (no `c` prefix, `.` separator by default). This allows migrating existing V2 datasets to V3 metadata without renaming chunk files on disk. ## Compression and Codecs This is one of the most significant architectural changes. | **Aspect** | **V2** | **V3** | |--------|----|----| | **Fields** | Separate `filters` and `compressor` | Single `codecs` list | | **Pipeline** | Filters applied first, then single compressor | Ordered codec chain with typed stages | | **Codec types** | Untyped (all are "id"-based) | Three types: `array -> array`, `array -> bytes`, `bytes -> bytes` | | **Memory layout** | `order` field (`"C"` or `"F"`) | `transpose` codec (array -> array) | | **Byte serialization** | Implicit (via NumPy memory layout + dtype endianness) | Explicit `bytes` codec with `endian` parameter | | **Minimum codecs** | `compressor` can be `null`, `filters` can be `null` | Must have at least one `array -> bytes` codec | | **Sharding** | Not supported | Supported via sharding codec (ZEP0002) | ### V2 compression model ```json { "filters": [{"id": "delta", "dtype": "<f8"}], "compressor": {"id": "blosc", "cname": "lz4", "clevel": 5, "shuffle": 1}, "order": "C" } ``` Filters are applied in order, then the single compressor is applied. ### V3 codec pipeline ```json { "codecs": [ {"name": "transpose", "configuration": {"order": [1, 0]}}, {"name": "bytes", "configuration": {"endian": "little"}}, {"name": "blosc", "configuration": {"cname": "lz4", "clevel": 5, "shuffle": "noshuffle"}} ] } ``` The pipeline is strictly ordered: zero or more `array -> array` codecs, then exactly one `array -> bytes` codec, then zero or more `bytes -> bytes` codecs. ### Key implications - **Memory layout (`order`)** is no longer a top-level metadata field. It is handled by the `transpose` codec if non-default ordering is desired. - **Byte serialization** is explicit. The `bytes` codec specifies endianness, making chunk data self-describing regardless of the data type field. - **Sharding** (ZEP0002) is an `array -> bytes` codec that groups multiple logical chunks ("inner chunks") into a single storage object ("shard"), with an embedded index for random access to individual inner chunks. ## Fill Value | **Aspect** | **V2** | **V3** | |--------|----|----| | **Required** | Yes, but can be `null` | Yes, always required (no `null`) | | **NaN/Infinity** | String encodings: `"NaN"`, `"Infinity"`, `"-Infinity"` | Same string encodings, plus hex byte representation (e.g., `"0x7fc00000"`) | | **Boolean** | Integer `0` or `1` | JSON `true` or `false` | | **Complex numbers** | Not specified | Two-element array: `[real, imag]` | | **Binary/byte strings** | Base64-encoded | Array of integers in `[0, 255]` (for `r*` types) | | **Default behavior** | `null` means contents of uninitialized chunks are undefined | Implementations may choose a default, but it must be recorded in metadata | ## Memory Layout (`order`) | **V2** | **V3** | |----|----| | Top-level `order` field: `"C"` or `"F"` | No `order` field; use the `transpose` codec instead | In V2, `"C"` means row-major (last dimension varies fastest) and `"F"` means column-major (first dimension varies fastest). In V3, the default is C order; column-major or other orderings are achieved by inserting a `transpose` codec into the codec chain. ## Extension Points V2 has no formal extension mechanism. Unrecognized keys in metadata should be ignored. V3 defines five explicit extension points: | **Extension Point** | **Description** | |-----------------|-------------| | **Data types** | Custom data types beyond core (e.g., variable-length strings, datetime) | | **Chunk grids** | Custom grid layouts (e.g., rectilinear) | | **Chunk key encodings** | Custom chunk-to-key mappings | | **Codecs** | Custom codecs for encoding/decoding | | **Storage transformers** | Intercept and modify storage operations (e.g., caching, sharding) | Each extension is identified by a registered name (e.g., `zstd`, `blosc`). Extensions use a consistent object format: ```json { "name": "<extension-name>", "configuration": { ... } } ``` Short-hand names (just a string) can be used when no configuration is needed. ### `must_understand` semantics V3 introduces a `must_understand` field for extensions. By default, all extensions have `must_understand: true`, meaning implementations must fail if they encounter an unrecognized extension. Extensions can set `must_understand: false` to indicate they can be safely ignored. This replaces V2's implicit "ignore unknown keys" behavior with explicit, per-extension compatibility signaling. ## Storage Transformers V3 introduces storage transformers, a concept absent in V2. Storage transformers sit between the codec pipeline and the store, intercepting and modifying storage operations at the array level (as opposed to codecs which operate per-chunk). They can be stacked. Use cases include caching, data reorganization, and encryption. ## Store Interface | **Aspect** | **V2** | **V3** | |--------|----|----| | **Interface definition** | Informal: read, write, delete | Formal abstract interface with three capability sets | | **Capabilities** | Not categorized | readable, writeable, listable | | **Partial I/O** | Not specified | `get_partial_values` and `set_partial_values` operations | | **Listing** | Not specified | `list`, `list_prefix`, `list_dir` operations | | **Bulk operations** | Not specified | `erase_values`, `erase_prefix` | V3 formalizes the store interface to enable modular, interchangeable store implementations and explicitly supports partial reads/writes for efficient access to subsets of chunks (important for sharding). ## Node Names | **Aspect** | **V2** | **V3** | |--------|----|----| | **Character set** | Any ASCII string | Unicode with constraints | | **Reserved prefixes** | Dot-files (`.zarray`, `.zgroup`, `.zattrs`) | `__` prefix reserved for Zarr internal use | | **Constraints** | Normalized paths, no `.` or `..` segments | No `/`, no empty strings, no `.`/`..`-only strings, no `__` prefix | ## Dimension Names | **V2** | **V3** | |----|----| | Not part of spec (handled by conventions like xarray's `_ARRAY_DIMENSIONS`) | Optional `dimension_names` field in array metadata | V3 natively supports naming dimensions (e.g., `["x", "y", "z"]`), removing the need for convention-based workarounds. ## Hierarchy Model | **Aspect** | **V2** | **V3** | |--------|----|----| | **Root node** | Must be a group | Can be a group or an array | | **Implicit groups** | Not supported | Removed after initial draft; ancestors must be explicitly created | V3 allows a hierarchy to consist of a single root array, which simplifies the single-array use case. An early V3 draft supported implicit groups (ancestors inferred from descendants without explicit metadata), but this was removed in [PR #292](https://github.com/zarr-developers/zarr-specs/pull/292). ## Versioning and Stability Policy | **Aspect** | **V2** | **V3** | |--------|----|----| | **Version format** | Single integer (`2`) | `MAJOR.MINOR` (e.g., `3.1`) | | **Compatibility** | Not formally specified | Minor versions add features only; breaking changes require major version bump | | **Metadata version** | `zarr_format: 2` | `zarr_format: 3` (major version only; minor features are auto-discovered) | ## Summary of Field Name Changes | **V2 Field** | **V3 Field** | |----------|----------| | `dtype` | `data_type` | | `chunks` | `chunk_grid` | | `compressor` | `codecs` (combined) | | `filters` | `codecs` (combined) | | `order` | Removed (use `transpose` codec) | | `dimension_separator` | `chunk_key_encoding` | | (N/A) | `node_type` (new) | | (N/A) | `dimension_names` (new) | | (N/A) | `storage_transformers` (new) | | (`.zattrs` file) | `attributes` (inline) |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully