System Design Academy

Saving…

Lesson 10 of 10 in Module 30 of 54 lessons complete

Object / Blob Storage

Module 3, lesson 10Concept12 min

Definition

Object storage

In plain English
Object storage keeps files of any size as objects, each found by a unique key, in a service built to hold practically unlimited data.
Think of it like
It is like a vast warehouse where every box has a barcode and staff fetch any box by scanning it.

Blob

In plain English
A blob, short for binary large object, is a chunk of raw file data such as an image or audio file.
Think of it like
It is like a sealed box whose contents the warehouse never opens.

Why it exists

You put 60 MB audio files in episode rows. Backups grow, and database traffic now includes every audio download.

Keep searchable facts in the database. Let a file-oriented service handle the large file traffic.

How it works

Metadata

In plain English
Metadata is data about data, such as a file's name, size, owner and upload date.
Think of it like
Like the label on the box.

Pre-signed URL

In plain English
A pre-signed URL is a temporary link that lets a client upload or download one specific object directly, without passing through your servers.
Think of it like
Like a warehouse pass that works for one box until it expires.
  1. Request permission

    The client asks your API for an upload link; the API checks who may upload.

  2. Issue a limited link

    The API chooses an object key and returns a short-lived pre-signed upload URL.

  3. Upload directly

    The client sends the file to object storage.

  4. Verify completion

    Your API verifies the object exists and meets required size and type rules before saving its key and metadata.

  5. Download later

    After checking access, issue a pre-signed download link or serve public files through a nearby delivery network.

The client requests a link, uploads directly to storage, and notifies the API; the API verifies the object and saves metadata.

Verify the uploaded object before recording a completed upload.

The client requests a link, uploads directly to storage, and notifies the API; the API verifies the object and saves metadata.

QuestionDatabaseObject storage
Best fitRelated, searchable factsLarge files fetched by key
Size limitsRow and field limits varyPer-object and request limits vary
Cost per stored GBOften higher for transactional storageOften lower; requests and transfers add cost
QueriesFilter, combine, and summarize fieldsFetch objects; content queries need other tools

A pre-signed URL works for one object and can be reused until it expires. Keep expiry times short, and treat the link like a password.

Object storage has per-object limits despite its large total capacity. Typical workflows replace whole files; check provider-specific operations before assuming edit support.

Examples

Store the key beside episode facts

Your audio files live in object storage. The episodes table holds searchable facts and each audio key.

The audio_key identifies the object; the row does not contain audio bytes.
SQL
CREATE TABLE episodes (
  id INTEGER PRIMARY KEY,
  title VARCHAR(200) NOT NULL,
  duration_seconds INTEGER NOT NULL,
  audio_key VARCHAR(500) NOT NULL
);
INSERT INTO episodes VALUES
  (7, 'Designing a data layer', 1800, 'audio/episode-7.mp3');

Search titles using the database. Fetch the audio by its key after checking whether the listener has access.

The insight

Use the database for facts and object storage for large files.

Trade-offs

Pros

  • Large capacity with lower storage cost in many cases.
  • Direct transfers reduce app-server traffic.
  • Managed services offer durable storage options.

Cons

  • Keys and permissions need careful handling.
  • Searching file contents requires other tools.
  • Requests and data transfer can add significant costs.

Use when

  • Images, audio, video, and exports dominate storage.
  • Large files are retrieved by a known key.

Avoid when

  • Small records need frequent filtering and joins.
  • You require database-style changes inside file contents.

Quick check

Where should 60 MB podcast audio files go?
Why use pre-signed URLs for uploads?

Takeaways

  • Store large files as objects and their searchable facts in a database.
  • Pre-signed URLs grant scoped, temporary direct access.
  • Verify uploads and keep large transfers off app servers.

Try the quick check above whenever you feel ready.

Previous: Sharding Strategies & Hot Spots