Question #28 of 60•Databases•Hard• ~3 min read

How do S3 and HDFS store petabytes of unstructured blob data reliably?

Executive Takeaway

Explore erasure coding, object storage chunking, metadata separation, and multi-region replication mechanics.

Architectural Breakdown & AnalysisFAANG Aligned

Traditional file systems crash when storing billions of large media assets or unstructured log files.

1. Separation of Metadata and Data

  • Metadata Tier: Stores file names, permissions, and block mapping locations in a fast in-memory key-value database.
  • Block Storage Tier: Splits files into fixed chunks (e.g., 128 MB blocks) stored on commodity storage nodes.

2. Erasure Coding vs 3x Replication

  • 3x Replication: Copies every data block across 3 physical racks. Fast, but incurs 200% storage overhead.
  • Erasure Coding (Reed-Solomon 8+4): Splits data into 8 data blocks + 4 parity blocks. Can recover from 4 node failures with only 50% storage overhead.
TIP — Storage Layer Choice

Use AWS S3 / Google Cloud Storage for object data storage instead of building custom HDFS clusters unless running bare-metal Hadoop.

Key Architectural Comparison

Storage ArchitectureMetadata HandlingBlock SizeScalability LimitIdeal Workload
Amazon S3 (Object Storage)Distributed flat namespace (Key-Value).Arbitrary (Up to 5 TB per object).Unlimited exabytes.Media files, backups, data lake storage.
Hadoop HDFSCentralized NameNode in RAM.Large contiguous blocks (128 MB).Petabytes (bounded by NameNode memory).Batch MapReduce & big data analytical jobs.
Previous QuestionHow do you design a High-Throughput Push Notification Service?Next Question What are the trade-offs of Layer 4 vs Layer 7 Load Balancing (HAProxy vs Envoy)?

Continue Learning on Being SDE

Explore deep-dive system architecture modules, low-level object-oriented designs, and interview cheat sheets.