Declare a namespace
Up to five per app.$TINY_DATA_DIR/storage/<environment>/<name> on the control-plane host.
Use it
resources.storage[].name, and may be omitted when
the manifest declares exactly one namespace. Asking for a namespace the
manifest never declared throws before any request is made.
→ ObjectMetadata
Accepts a string or
Uint8Array and returns the stored object’s metadata.→ Uint8Array | null
null means that key is absent. A missing namespace or a superseded
deployment raises, so an unreachable namespace never reads as an empty one.→ boolean
Whether the key existed.
→ ObjectSummary[]
Objects sorted by key with
key, size, lastModified, and etag, filtered
by an optional prefix.Keys
Keys must be relative and may not contain... A key that would escape its
namespace is refused before it reaches a disk. Maximum key length is 1024 bytes.
Bytes are bytes
Bytes cross the link raw rather than base64-encoded in JSON, so binary is stored exactly as given — the round trip is byte-for-byte, not UTF-8-normalized.ETags are change validators, not digests
Quotas and limits
On top of those,
maxSize is the per-namespace quota. It is measured against
the namespace as it will be after the write, so replacing an object does not
charge for the copy it replaces.
Filling a quota is a
RESOURCE_LIMIT_EXCEEDED refusal, never a truncated write.storage_bytes, split into reads and writes by the
operation field on each usage record.
Writes are atomic
Writes are staged under$TINY_DATA_DIR/storage/.staging and renamed into
place, so a reader sees either the previous object or the new one — never a
partial file. That directory sits beside the environment directories rather
than inside a namespace, which keeps a half-written object out of listings and
out of quota accounting.
Serving files to a browser
The 32 MiB object limit bounds what your app can write over the private link. What a browser can upload through an app is bounded separately by the reverse proxy: the single-host nginx configuration setsclient_max_body_size 20m.
examples/file-vault is a working version of this.
Durability
An S3/R2-backedObjectStore is the intended replacement, and it is one
interface implementation away — nothing an app sees would change. It is not
implemented in this repository.
retention describes how long deleted objects are kept for recovery. It is
recorded on the claim and is not yet enforced by a reaper.