Storage Types
Block Storage
Raw disk volumes attached to a single server. Low latency, high IOPS. Like a physical hard drive. Examples: AWS EBS, Azure Managed Disks, GCP Persistent Disk.
Object Storage
Flat namespace of objects (key → blob + metadata). Infinite scale, HTTP API. Best for unstructured data: images, videos, backups. Examples: S3, GCS, Azure Blob.
File Storage (NAS)
Shared filesystem accessible by multiple servers via NFS/SMB. Hierarchical directories. Best for shared config, CMS assets. Examples: AWS EFS, Azure Files, GCP Filestore.
Block vs Object vs File
Block: fastest, single-attach, needs filesystem. Object: cheapest, infinite scale, no filesystem. File: shared access, moderate performance, familiar interface.
S3 Storage Classes
Standard: frequent access ($0.023/GB). IA: infrequent ($0.0125/GB). Glacier: archive ($0.004/GB, minutes-hours retrieval). Deep Archive: ($0.00099/GB, 12-48hr retrieval).
EBS Volume Types
gp3: general purpose SSD (3000 IOPS base). io2: provisioned IOPS (up to 64K IOPS). st1: throughput HDD (big data). sc1: cold HDD (infrequent, cheapest).
IOPS vs Throughput
IOPS: operations per second (4KB random reads). Throughput: MB/s (sequential reads). Databases need high IOPS. Video streaming needs high throughput.
Replication & Durability
S3: 99.999999999% (11 nines) durability, 3+ AZ replication. EBS: replicated within single AZ. EFS: multi-AZ. Higher durability = more replication = higher cost.
When to Use What
Database storage → Block (EBS). Static assets/uploads → Object (S3). Shared config/logs → File (EFS). Large-scale analytics → Object (S3 + Athena). Boot volumes → Block.
Cost Optimization
Use S3 lifecycle policies to auto-transition: Standard → IA (30 days) → Glacier (90 days) → Deep Archive (365 days). Can reduce costs 80%+ for aging data.