What is a bucket, and why can't you append to a file in it?
GeoStack · background · key → bytes
Abstract¶
Pictures first. S3, Azure Blob Storage and Google Cloud Storage are not disks. Each is a dictionary from a name to a blob of bytes, reached over HTTP with five operations. Cloud-native formats, catalogs and versioned stores are all designed around what those five can and cannot do.
The running example¶
Keys, not folders¶
A bucket is a dictionary from key to bytes. The highlighted key is the running example’s object. “Listing a folder” is really “list every key that starts with this prefix”.
An object is a blob of bytes plus a little metadata (size, time, a fingerprint called the ETag). A key is its full name. A bucket (Azure: container) holds the keys. The store keeps keys sorted, which is why a prefix search is possible and nothing else is: you cannot ask for “every B12.tif” without walking every scene prefix.
Five verbs¶
Five verbs, each one HTTP request. Everything a format or a catalog does on the cloud is built from these, and shaped by the four that are missing.
The missing operations matter more than the present ones. No append means a growing array cannot be one growing file, so Zarr stores one object per chunk. No rename means the usual “write to a temp file, then rename” trick for safe writes does not exist. No lock means two writers cannot take turns unless the format gives them a way.
Range requests: reading part of an object¶
your codeobject store
GET bytes=0–16383206 · header: where every tile is · 16 kB
GET bytes of tile 38206 · one compressed tile · 524 kB
GET bytes of tile 39206 · one compressed tile · 524 kB
GET bytes of tile 49206 · one compressed tile · 524 kB
GET bytes of tile 50206 · one compressed tile · 524 kB
The window read from the storage formats page, as HTTP. Status 206 means “partial content”. Five requests fetch about 2.1 MB uncompressed out of a 60.28 MB band; the four tile requests can run at the same time.
A range request is a GET with a header naming the bytes wanted. It costs about the same as any other request, whatever the object’s size. A format is cloud-native when its index sits where one small range request can fetch it and points to byte ranges for everything else. The storage formats page shows how COG, GeoParquet and Zarr each do that.
import obstore
# not pinned (obstore)
store = obstore.store.S3Store("sentinel-cogs", region="us-west-2", skip_signature=True)
key = "sentinel-s2-l2a-cogs/31/T/CJ/2026/6/S2A_31TCJ_20260612_0_L2A/B12.tif"
# not pinned (obstore)
head = obstore.head(store, key) # size, last_modified, e_tag
# not pinned (obstore)
header = obstore.get_range(store, key, start=0, end=16_384) # → 16 384 B
# not pinned (obstore)
tiles = obstore.get_ranges(store, key, starts=starts, ends=ends) # → 4 buffers
# not pinned (obstore)
# fails if the key already exists: a conditional PUT
obstore.put(store, "models/_tags/v3", b"<hash>", mode="create")Each request has a fixed cost of tens of milliseconds before the first byte arrives, so a read is priced in requests more than in bytes. Two consequences: merge nearby ranges into one request, and send independent requests at the same time (the parallelism page measures that: 121 tile fetches drop from 6.4 s to 0.23 s).
Listing is the slow verb¶
Listing is paged and sequential, so it scales with the number of objects, not with what you want. This is why Zarr has consolidated metadata, Icechunk has manifests, and geocatalog keeps a table of files.
Writing safely: one PUT, or a pointer swap¶
The middle row is pipekit’s model registry today (operator, weights, metadata, tag). The bottom row is how a versioned store commits safely: every new object is written under a fresh key, then one small pointer is swapped with a condition.
S3, Azure and GCS are strongly consistent: once a PUT returns, every later GET and LIST sees it. That covers one object. For several objects that must change together, the pattern is always the same: write the new objects under keys nobody reads yet, then make them visible with one conditional write. Icechunk commits this way; the versions and identity page builds on it.
Three providers, one model¶
| AWS S3 | Azure Blob / ADLS Gen2 | Google Cloud Storage | |
|---|---|---|---|
| Container of keys | bucket | container (in a storage account) | bucket |
| URI | s3://bucket/key | az://container/key, abfs:// | gs://bucket/key |
| Range reads | yes | yes | yes |
| Conditional writes | If-None-Match, If-Match | ETag conditions, leases | generation preconditions |
| Real directories | no | yes, with the hierarchical namespace (ADLS Gen2): atomic directory rename | no (optional on newer bucket types) |
| Auth you will meet | keys, roles, unsigned public access | account keys, SAS tokens, managed identity | service accounts |
The differences are in names and credentials. Libraries such as obstore and fsspec hide them behind one interface, which is why the stack addresses everything by URI.
In your stack¶
Checked at geotoolz 640670c and pipekit 9e86a56.
| Where | What it does with the bucket |
|---|---|
geocloud store.py | one process-wide pool of obstore clients, keyed by URI root (S3, Azure, GCS, Hugging Face, local); credentials live in the store, keys in object_key(uri) |
geocloud CogSource | range requests for COG headers and tiles through async-geotiff on the pooled client |
geocloud files | copy between stores, 8 objects at a time |
| geocatalog | lists once to build a catalog, then answers queries from the table, never from LIST |
pipekit S3ModelRegistry | four PUTs per registered model, the tag last; the reason for the transactional registry in the recipe registries design |
import geocloud.store
# today (geocloud)
store = geocloud.store.get_obstore("s3://sentinel-cogs/sentinel-s2-l2a-cogs/31/T/CJ/")
# today (geocloud)
key = geocloud.store.object_key(uri) # the part of the URI after the store's rootWhere this goes next¶
| Idea here | Shows up as |
|---|---|
| Range requests | how COG, Parquet and Zarr are read (storage formats) |
| An index instead of LIST | catalogs and STAC (databases and catalogs); Icechunk manifests |
| New keys, then a conditional pointer swap | snapshots and commits (versions and identity); Level 2 collections, B |
| Four PUTs are not atomic | the transactional model registry (recipe registries, H) |
Sources and status
Sources, each read on 17 November 2026: Amazon S3 on its consistency model, conditional writes and conditional requests, request rates and ListObjectsV2; Azure on the Data Lake Storage hierarchical namespace; Google Cloud Storage on consistency and request preconditions; and obstore on put and get. The same entries are in references.bib and cited from the page’s MyST stub. The obstore put, get_range and get_ranges signatures were checked against those pages; the other obstore calls stay marked not pinned. Stack rows read from geotoolz at 640670c and pipekit at 9e86a56. The byte counts are the running example’s; the bucket key is illustrative, and nothing on this page is measured.