Intermediate → Advanced15 min read· Topic 7.1

Storage types and trade-offs

Block storage, object storage, file storage, in-memory storage

💾Key Takeaways

  • 1
    Block storage: raw disk volumes, highest performance, used by databases (AWS EBS)
  • 2
    Object storage: unlimited scale, HTTP API, cheap, used for files/images/backups (S3)
  • 3
    File storage: shared filesystem, traditional NFS, used for legacy apps and shared access
  • 4
    In-memory storage: fastest but volatile, used for caching and real-time processing (Redis)

Choosing the Right Storage Layer

Every system needs storage, but not all storage is created equal. The choice between block, object, file, and in-memory storage determines performance, cost, scalability, and access patterns.

Storage Types Compared

TypeLatencyScalabilityCostBest For
Block (EBS, SAN)~1-2ms (SSD)Limited (per-instance)$0.10/GB/moDatabases, boot volumes
Object (S3, GCS)~50-100msUnlimited$0.023/GB/moImages, videos, backups, data lake
File (EFS, NFS)~5-10msModerate$0.30/GB/moShared config, legacy apps
In-Memory (Redis)~0.1msLimited by RAM$$$Cache, sessions, leaderboards

Advantages

  • Each type is optimized for its use case
  • Object storage is extremely cost-effective at scale
  • In-memory storage provides sub-millisecond latency

Disadvantages

  • Block storage doesn't scale horizontally well
  • Object storage has higher latency than block/memory
  • Mixing storage types adds operational complexity

🧪 Test Your Understanding

Knowledge Check1/1

Which storage type is best for storing user-uploaded images?