System design concepts · Specialized Building Blocks

Object Storage (S3) and Large File Uploads in System Design

Databases are for facts about things. Object stores are for the things themselves: photos, videos, PDFs, backups. Mixing them up is one of the most expensive mistakes in system design.

What you'll be able to explain
  • Compare block, file and object storage
  • Upload directly to object storage with pre-signed URLs
  • Handle large files with multipart and resumable uploads
  • Build a media processing pipeline
  • Control cost with storage tiers and lifecycle rules

Three kinds of storage

Block File Object
Interface Raw disk volumes Hierarchical paths, POSIX HTTP API: PUT/GET by key
Scale One machine (mostly) Shared cluster Practically unlimited
Use for Databases, VM disks Shared filesystems, legacy apps Media, backups, logs, data lakes
Examples EBS, Persistent Disk EFS, NFS S3, GCS, Azure Blob, Cloudflare R2, MinIO

Object stores offer extreme durability (S3 is designed for 11 nines) by spreading data across devices and zones, often with erasure coding: split data into k pieces plus m parity pieces, so any k pieces can rebuild it at far less overhead than 3 full copies.

Upload without touching your servers

Streaming gigabytes through your app servers wastes bandwidth and threads. Instead, issue a pre-signed URL:

ClientAPIObject storeProcessor1POST /uploads {name, size, type}2upload_id + pre-signed PUT URL (expires 15 min)3PUT bytes directly4event: object created5mark upload READY, store metadata
Direct upload with a pre-signed URL; the app server only handles metadata.

The pre-signed URL embeds the bucket, key, allowed content type, size limit and expiry, signed with your credentials. The client can do exactly one thing with it.

Large files: multipart and resumable

  • Multipart upload: split a file into parts (e.g. 8–64 MB), upload parts in parallel, then "complete" to assemble. A failed part is retried alone.
  • Resumable uploads: the client records which parts succeeded; after a network drop it continues where it stopped. Essential on mobile.
  • Checksums per part (and for the whole file) detect corruption.
  • Content-addressed chunks (key = hash of content) enable deduplication (Case Study C14 of the book).