Skip to content

Object storage

Object storage — Amazon S3, Google Cloud Storage, Azure Blob Storage, Cloudflare R2 and their self-hosted cousins — is where most of the world’s bytes live: images, videos, backups, logs, model weights and analytics tables. It is cheap, practically unlimited and extremely durable, but it is not a file system and not a database. Knowing its semantics lets you design upload flows, media pipelines and data lakes that are both simple and cheap.

Block storageFile storageObject storage
UnitFixed-size blocks on a volumeFiles in a directory treeObjects (bytes + metadata) under a key
InterfaceDisk device (SCSI, NVMe); a file system on topPOSIX via NFS or SMBHTTP API (PUT, GET, DELETE, LIST)
UpdatesIn place, any byte rangeIn place, with locksReplace the whole object
Shared accessOne host at a time (usually)Many hostsAny number of clients over the network
LatencyTens of µs (local NVMe) to ~1 ms (network volume)Around a millisecond~10–200 ms to first byte (S3 median: tens of ms)
ScaleUp to tens of TiB per volumeUp to petabytes per file systemEffectively unlimited
Typical costHighestMiddleLowest per GB
ExamplesAmazon EBS, Persistent Disk, local NVMeAmazon EFS, Filestore, Azure FilesS3, GCS, Azure Blob, R2, Ceph RGW
Use forDatabases, boot volumesShared home directories, legacy appsMedia, backups, logs, data lakes

Databases need block storage: they update pages in place and depend on low latency and fsync. Everything that is written once and read many times belongs in object storage.

  • Buckets and keys. A bucket is a container with a globally or regionally unique name; inside it, the namespace is flat. photos/2026/10/cat.jpg is one key; the slashes only look like folders, and listing by prefix emulates directories.
  • Immutable objects. A PUT writes a complete object, and a later PUT to the same key replaces it atomically: readers see the old or the new version, never a mix. There is no partial update; to change one byte you rewrite the object. Appends are the narrow exception: S3 Express One Zone (since late 2024) and Azure append blobs can add data to the end of an object.
  • Metadata. Each object carries system metadata (size, Content-Type, ETag, last-modified) and user-defined key-value metadata. Tags drive lifecycle and access rules.
  • Versioning. With versioning on, overwrites and deletes keep previous versions, which protects against accidental deletion and ransomware (add object lock for write-once-read-many retention).
  • Range reads. GET with a Range header fetches part of an object; this is how video players seek and how analytics engines read one column of a Parquet file.
  • Throughput scales by prefix. S3 supports at least 3,500 writes and 5,500 reads per second per partitioned key prefix and adds capacity gradually, returning 503 Slow Down while it scales. Spread hot traffic across prefixes and retry with backoff.

Until late 2020, S3 offered only eventual consistency for overwrites and listings, which forced data platforms to run extra metadata services. In December 2020 AWS made S3 strongly consistent for all applications at no extra cost: after a successful PUT or DELETE, every subsequent GET, HEAD and LIST reflects it. Google Cloud Storage is also strongly consistent for object reads, writes and listings.

What object storage still does not give you:

  • No multi-object transactions. Updates are per key; there is no way to change two objects atomically.
  • No coordination of concurrent writers by default. Two simultaneous PUTs to one key: the last one wins. Since 2024 S3 supports conditional writes — If-None-Match: * to create only if absent, and If-Match: <etag> for compare-and-swap — which lets you build locks and optimistic concurrency without a separate database.
  • Bucket configuration is eventually consistent. For example, AWS advises waiting about 15 minutes after first enabling versioning before writing to the bucket.

Durability is the probability that a stored object is not lost over a year. Availability is the share of time requests succeed. Object stores invest far more in the first: losing data is unrecoverable, while a few minutes of errors can be retried.

Amazon S3 storage classDesigned durabilityDesigned availabilityCopies acrossMinimum storage duration
S3 Standard99.999999999%99.99%≥ 3 AZs—
S3 Standard-IA99.999999999%99.9%≥ 3 AZs30 days
S3 One Zone-IA99.999999999%99.5%1 AZ30 days
S3 Express One Zone99.999999999%99.95%1 AZ1 hour
S3 Glacier Instant Retrieval99.999999999%99.9%≥ 3 AZs90 days
S3 Glacier Deep Archive99.999999999%99.99%≥ 3 AZs180 days

To make the nines concrete: with 11 nines of annual durability, if you store 10 million objects you can expect to lose one object about once every 10,000 years. Availability is far lower: 99.99% still allows about 53 minutes of errors per year, and 99.9% about 8.8 hours. Note that durability figures are design targets and that single-zone classes keep data in one availability zone, so losing that zone can lose the data. Google Cloud Storage also designs for 11 nines; Azure quotes 11 nines for locally redundant storage, 12 for zone-redundant and 16 for geo-redundant storage.

The biggest durability risk is not hardware but people and software: a bug or a compromised credential that deletes data. Versioning, object lock, cross-region replication to a separate account and least-privilege access matter more than the extra nines.

A presigned URL embeds a signature that grants one operation on one key for a limited time. The application server never proxies the bytes: it authorises the request and hands the client a URL; the client talks to the object store directly.

sequenceDiagram
  participant C as Client
  participant A as App server
  participant D as Metadata DB
  participant S as Object storage
  C->>A: POST /uploads<br/>(type, size)
  A->>D: insert media row<br/>(status = pending)
  A-->>C: presigned PUT URL<br/>(expires in 15 min)
  C->>S: PUT object bytes
  S-->>A: object-created event
  A->>D: status = ready,<br/>size, checksum
presign.py
import uuid
import boto3
s3 = boto3.client("s3", region_name="eu-central-1")
def create_upload(user_id: int, content_type: str) -> dict[str, str]:
"""Reserve a key and return a short-lived URL the client can PUT to directly."""
key = f"uploads/{user_id}/{uuid.uuid4()}"
url = s3.generate_presigned_url(
"put_object",
Params={"Bucket": "media-prod", "Key": key, "ContentType": content_type},
ExpiresIn=900, # 15 minutes
)
# Store (key, user_id, status="pending") in the metadata database here.
return {"key": key, "upload_url": url}

Keep expiries short (S3 caps SigV4 presigned URLs at 7 days, and a URL stops working earlier if the credentials that signed it expire), generate keys on the server so clients cannot overwrite each other, and validate the uploaded object (size, type, malware scan) before marking it ready.

Large objects are uploaded in parts that can be sent in parallel and retried individually, then stitched together by a final “complete” call. In S3, parts are 5 MiB to 5 GiB, an upload can have up to 10,000 parts, a single PUT is limited to 5 GB, and objects can be up to 50 TB. AWS suggests multipart from about 100 MB. Incomplete uploads are billed until aborted, so add a lifecycle rule that aborts them after a few days.

Storage classes trade storage price against retrieval cost, latency and minimum retention. Lifecycle rules move objects between classes or delete them automatically, by age, prefix or tag. A typical policy for user uploads:

AgeAction
0–30 daysS3 Standard (frequent reads, thumbnails generated)
30–90 daysStandard-IA or Glacier Instant Retrieval
1 yearGlacier Deep Archive, or delete if not required
7 days after startAbort incomplete multipart uploads

Watch the fine print: minimum storage durations and per-request fees can make “cheaper” classes more expensive for small or short-lived objects. Intelligent-Tiering moves objects automatically when access patterns are unknown. Also budget for egress: transfer out of most clouds is billed per GB and often dominates the bill for media services; a CDN reduces it, and some providers (Cloudflare R2, for example) charge no egress fees at all.

Metadata in a database, blobs in object storage, CDN in front

Section titled “Metadata in a database, blobs in object storage, CDN in front”

The most common storage architecture for user content splits responsibilities:

flowchart TB
  user["Client"] -->|"GET /photos/42"| api["API service"]
  api --> db[("Metadata DB<br/>owner, key, size, ACL")]
  api -->|"signed CDN URL"| user
  user -->|"GET image"| cdn["CDN edge"]
  cdn -->|"cache miss"| obj[("Object storage")]
  obj -->|"object-created event"| worker["Thumbnail and<br/>transcode workers"]
  worker --> obj
  worker --> db
  • The database holds what you query and transact on: owner, permissions, captions, the object key, processing status.
  • Object storage holds the immutable bytes, under keys the application generates.
  • The CDN serves bytes from edge caches; the origin sees only misses. Signed CDN URLs or cookies protect private content.
  • Events from the bucket trigger workers that create thumbnails, transcode video or extract text.

Two details make this pattern robust. First, treat objects as immutable and give each version a new key (photos/42/v3.jpg or a content hash): CDN caches never need purging and can use long Cache-Control lifetimes. Second, reconcile the two stores: a periodic job removes objects with no metadata row (orphans from failed uploads) and flags rows whose object is missing.

A data lake keeps raw and processed data as files in object storage and lets many engines (Spark, Trino, Flink, DuckDB, warehouse engines) query them. Two layers make that practical:

  • Apache Parquet — a columnar file format with compression and per-column statistics. A query that reads 3 of 100 columns fetches only those byte ranges and skips row groups whose min/max cannot match.
  • Apache Iceberg — an open table format: metadata files that list which Parquet files form each table snapshot. Commits swap one metadata pointer atomically, which gives serializable isolation for readers and writers, schema evolution without rewriting data, hidden partitioning, and time travel to earlier snapshots. Version 2 of the spec added row-level deletes, and version 3 added types such as variant and geospatial, deletion vectors and row lineage. Delta Lake and Apache Hudi solve the same problem with different trade-offs.

Managed offerings now bundle this layer, for example Amazon S3 Tables (S3 storage with built-in Iceberg tables and maintenance). Data lakes need compaction: thousands of tiny files mean thousands of requests and slow queries, so engines periodically rewrite small files into larger ones.

ChoiceBenefitCost
Object storage vs a file systemUnlimited scale, 11-nines durability, low priceNo in-place edits, higher latency, no POSIX locks
Direct upload via presigned URLsApp servers handle no bytes; scales with the storeMust validate uploads asynchronously and clean up orphans
Colder storage classesMuch lower price per GBRetrieval fees, minimum durations, slower access
Single-zone classesLower price or lower latencyData loss if the zone is lost
Iceberg on object storageOpen format, many engines, cheap storageCompaction, catalog and file-layout work

Based on The System Design Primer by Donne Martin (CC BY 4.0). Restructured, rewritten and updated; site content is licensed under CC BY 4.0.