Shaf Lab

Object storage

Storage for files and blobs on a cloud or edge network, such as Cloudflare R2.

Object storage holds files and blobs — images, videos, tarballs, recordings, model artifacts — and serves them by key. Cloudflare R2 and the various S3-compatible APIs are typical. You pay for space and for transfer, you get durability, and you do not try to query inside the blob as if it were a row in a database.

Use object storage when the data is large, when it is mostly written once and read many times, or when you want a stable URL or signed access to a file. Keep metadata and relationships in a database, and store the object key there. That way you can list, sort, and delete without scanning a bucket.

Set a clear naming scheme, a lifecycle for old objects, and a policy for who can read or write. Public buckets should be rare and intentional. For user uploads, validate type and size before the object becomes visible to anyone else.

If you are storing a 200-byte JSON document, a key-value store or a database row is usually enough. Object storage shines when the payload is a file, not a field.