Block vs Object vs File Storage
The three storage types
Section titled “The three storage types”| Block | Object | File | |
|---|---|---|---|
| Mental model | Raw disk (hard drive) | Key → value bucket | Shared network folder |
| AWS service | EBS | S3 | EFS |
| Access unit | Blocks (512B-4KB) | Whole objects | Files |
| Structure | Formatted FS on blocks | Flat namespace (keys) | Real directories |
| Writers | 1 EC2 | Many (API) | Many (NFS) |
| Price/GB | $0.08 (gp3) | $0.023 | $0.30 (most expensive!) |
| Latency | Lowest | Medium | Medium |
Block (EBS) — the hard drive
Section titled “Block (EBS) — the hard drive”- Attached to ONE EC2 (like internal SSD). Format it (ext4/NTFS), mount, use.
- Filesystem tracks which blocks belong to which file (pointer table).
- Lowest latency — OS disks, databases (high IOPS).
- Snapshots → S3 for backup. Can’t share across EC2 (multi-attach rare/limited).
Object (S3) — the cloud bucket
Section titled “Object (S3) — the cloud bucket”- Key → data + metadata + ID. Flat namespace, no real folders (prefixes only).
- NOT a filesystem — no mount, no locking. HTTPS REST API (GET/PUT by key).
- Unlimited scale, 11 nines durability (99.999999999%).
- Multi-writer safe. Great for static files, media, backups, data lakes, static sites.
File (EFS) — shared network drive
Section titled “File (EFS) — shared network drive”- POSIX: real dirs, permissions, locks. Accessed via NFS.
- Attachable to MANY EC2 simultaneously — all see same files.
- Elastic (grows/shrinks). Linux only.
- Use: shared assets across web farm, home dirs, lift-and-shift POSIX apps.
- FSx = managed file systems: Windows (SMB) / Lustre (HPC parallel).
Key exam distinctions
Section titled “Key exam distinctions”- EBS = block, single EC2, snapshot to S3
- S3 = object, 11 nines, unlimited, API-based
- EFS = file/NFS, multi-EC2, Linux only
- “formatted disk attached to one server” → EBS
- “shared files across servers” → EFS
- “store unlimited files via API” → S3
Related
Section titled “Related”- [[aws/index]]
- [[aws/compute-map/index]]