CLOUD & INFRASTRUCTURE / SYSTEM CONCEPT BRIEF

Storage

Cloud storage comes in three main types.

BeginnerPhase 07 / Topic 4 of 17RequirementsTrade-offsFailure modes
01

Overview

Cloud storage comes in three main types. Block storage (EBS, persistent disks) provides raw volumes attached to one VM, used for databases and file systems. File storage (EFS, Filestore) provides shared network file systems mounted by many machines. Object storage (S3, GCS, Azure Blob) stores immutable objects with metadata in flat buckets, accessed over HTTP, at massive scale and low cost.

Each type trades latency, sharing, scalability, and cost. Storage tiers (hot, infrequent access, archive) let you move older data to cheaper storage automatically. Durability, replication, backups, and encryption are part of every storage design.

Hard drive, shared drive, and warehouse

Block storage is your laptop's hard drive: fast and private. File storage is the office shared drive: everyone can open the same folders. Object storage is a vast warehouse where each box has a label; you fetch whole boxes by label.

02

When to use it

  • Choosing where to store database files, uploads, logs, and backups.
  • Designing data lakes and media storage.
  • Sharing files between servers.
  • Cost optimization for large, aging datasets.
03

Where it shows up in interviews

Media storage

Recognize it when: store user uploads, images, videos.

  • Design Instagram photo storage
  • Design YouTube video storage
Data lifecycle

Recognize it when: keep data for years cheaply.

  • Design log retention
  • Design a backup system
04

Where it is used in real software

S3 as a data lake

Companies store petabytes in S3 in Parquet and query them with Athena, Spark, or Snowflake.

EBS for databases

Self-managed databases on EC2 use gp3 or io2 volumes for predictable IOPS.

Glacier Deep Archive

Stores compliance archives for about $1 per TB per month with hours-long retrieval.

05

Key terms

Block storage
Raw volumes; low latency; attached to one instance.
File storage
Shared POSIX file system over the network.
Object storage
Objects with keys and metadata over HTTP; virtually unlimited.
IOPS / throughput
Operations per second / MB per second.
Storage class / lifecycle
Cost tier / rules that move or delete data over time.
06

How it works, step by step

  1. 1
    Classify the data

    Database files, shared files, blobs, backups, logs.

  2. 2
    Pick the type

    Block for databases, file for shared access, object for blobs and lakes.

  3. 3
    Pick performance

    IOPS and throughput for block; request rates for object.

  4. 4
    Set durability and backups

    Snapshots, versioning, cross-region replication.

  5. 5
    Set lifecycle rules

    Move cold data to cheaper tiers; expire old data.

07

Block vs file vs object

Storage types compared

Step 1 / 5
AspectBlock (EBS)File (EFS)Object (S3)
AccessOne instance (mostly)Many instancesAnyone via HTTP API
LatencySub-millisecondMillisecondsTens of milliseconds
ScaleUp to tens of TB per volumePetabytesUnlimited
Cost (relative)MediumHighestLowest
Typical useDatabases, boot disksShared content, legacy appsUploads, backups, data lakes

NOWAspect: Access | Block (EBS): One instance (mostly) | File (EFS): Many instances | Object (S3): Anyone via HTTP API

Store blobs in object storage and metadata in a database; never store large files inside the database.

08

Implementation

{  "Rules": [    {      "ID": "logs-tiering",      "Filter": { "Prefix": "logs/" },      "Status": "Enabled",      "Transitions": [        { "Days": 30, "StorageClass": "STANDARD_IA" },        { "Days": 90, "StorageClass": "GLACIER_IR" },        { "Days": 365, "StorageClass": "DEEP_ARCHIVE" }      ],      "Expiration": { "Days": 2555 }    }  ]}
09

Complexity and performance

Object sizeUp to 5 TB

Multipart upload above 100 MB.

S3 request rate3,500 writes / 5,500 reads per s per prefix

Scales with prefixes.

10

Trade-offs

Latency vs cost and scale

Block storage is fastest but limited and expensive; object storage is slower per request but cheap and unlimited.

Archive tiers

Very cheap storage but retrieval takes minutes to hours and has fees.

11

Variants and related techniques

Instance store

Ephemeral local NVMe disks: very fast, lost on stop.

Distributed file systems

HDFS, Ceph, and Lustre for big data and HPC.

12

Common mistakes

  • Storing images as database BLOBs.

    Fix: Put them in object storage and store the key in the DB.

  • No backups for block volumes.

    Fix: Schedule snapshots and test restores.

13

Interview questions

Where do you store user-uploaded photos?

In object storage (S3) with metadata (owner, key, size) in a database, uploaded directly by clients with pre-signed URLs, served through a CDN, and tiered with lifecycle rules.

When do you use block storage instead of object storage?

When you need low-latency random reads and writes with a file system, such as database data files or boot volumes attached to a VM.

14

Practice problems

ProblemDifficultyWhat it trains
Choose storage for 6 data typesEasyTypes.
Design storage for 1 PB of videoMediumTiering and CDN.