Key technologies · Object storage

Key technologies

Object storage

S3-compatible blob stores: durable bytes, presigned uploads, and the metadata that still belongs in a database.

2 min read system-design

Object storage (S3, GCS, Azure Blob) keeps immutable blobs under a key, replicated so that losing a disk is not losing the object. You pay for storage and for requests, and you get an API that is deliberately not a filesystem. There is no “append a byte in the middle” and no directory listing you should build a product on.

The split

Your database stores the row a user cares about: this file, this owner, this status, this checksum. The bucket stores the bytes at a key you generated (tenant/object-id or a content hash). Authorization checks the row, then issues a short-lived presigned URL for the GET. The client downloads from the bucket, often via a CDN in front.

Uploads reverse the path. The API checks the quota and the content type, returns a presigned PUT or a multipart upload id, and the client sends bytes directly. A completion call, or a bucket notification, flips the row to “uploaded” and enqueues a scan or a transcode. Until that finishes, the object is not visible to other users.

Multipart and integrity

Large uploads are parts of a few megabytes and up. A failed part retries without restarting the world. You record the checksum. If the hash does not match, you do not mark the file ready. Prefer keys that change when the bytes change, so caches and resumable clients are simple. Bucket versioning protects you from an accidental overwrite while you are still on mutable keys.

Lifecycle and failure

Move old objects to colder classes with a lifecycle rule if you must keep them and rarely read them. Remember that retrieval from deep archive is minutes or hours, which is a product decision.

Durability is not the same as availability. A regional outage can make a highly durable object unreachable. If the product cannot tolerate that, replicate to a second region and decide which region is authoritative for new writes. Do not serve a stale replica of a medical record without saying so.

Never make the bucket world-readable and rely on unguessable keys as your only ACL. Keys leak via referrers, logs, and screenshots.

Further reading

Check yourself

Answer the questions. Multiple choice is scored on this device only.

1. A 2 GB video should be uploaded how?

2. A presigned URL grants what?

3. What do you store in the database versus the bucket?