`.to_zarr(..., compute=False)` optimizations

The likely problem here is that the Dask graph for that array is absolutely huge, which bogs everything down.

Instead, use this pattern:

  • Just use one single Dask chunk for the Xarray dataset
  • Specify chunk size via encoding

Here’s an example of that from our Serverless Data Cube Demo:

An even better solution would be to stop overloading to_zarr and actually implement schema creation in Xarray. That has been discussed extensively here:

4 Likes