Amazon Web Services

Block & File Storage — EBS & EFS

Choose between block, file and object storage, and size an EBS volume for the IOPS it actually needs.

Three storage shapes, and interviewers want you to pick correctly.

EBS is the hard drive inside one machine. EFS is a shared network drive the whole office mounts. S3 is the post room — you hand things in and collect them by reference, and it is not a drive at all.

Key Concepts

1
    EBS   block   one volume, one instance (one AZ). A virtual disk.
    EFS   file    a shared filesystem, many instances, across AZs.
    S3    object  HTTP API, unlimited, not a filesystem.
2
EBS is a disk attached to one instance. It lives in a single AZ, so an AZ failure takes the volume with it — snapshots to S3 are what make it durable.
3
The volume types are a standard question.
    gp3   general purpose SSD. 3,000 IOPS baseline, independently
          tunable up to 16,000. The sensible default.
    gp2   older, IOPS tied to size (3 per GB) -- oversize to get speed
    io2   provisioned IOPS, up to 256,000, 99.999% durable. Databases.
    st1   throughput HDD, big sequential reads. Logs, data lakes.
    sc1   cold HDD, cheapest, rarely touched data.
4
gp3 over gp2 is the easy win. On gp2 you had to buy a 1TB volume to get 3,000 IOPS; gp3 gives that at any size and lets you buy IOPS separately. It is also cheaper per GB.
5
EFS is for when several instances need the same files. It scales automatically, is multi-AZ, and costs substantially more per GB than EBS. Use it for shared uploads or legacy apps that expect a POSIX path — not as a database volume, where its latency shows.
6
Snapshots are incremental. The first captures everything; later ones store only changed blocks, though deleting one never loses data because the blocks other snapshots need are retained.
7
Encryption is a checkbox and should always be on. It uses KMS, costs nothing in performance, and cannot be added to an existing unencrypted volume in place — you snapshot, copy with encryption, restore.
8
The sizing mistake to avoid. Teams provision io2 at great expense when the workload is throughput-bound rather than IOPS-bound. Look at the CloudWatch metrics before buying provisioned IOPS: queue depth and throughput tell you which limit you are actually hitting.
9
What the interviewer is probing.1. "EBS, EFS or S3?" Probing: the three shapes. Stalls: "They all store data." Moves up: EBS is a disk for one instance in one AZ, EFS a shared filesystem across AZs, S3 an HTTP object store that is not a filesystem.
10
2. "Why is gp3 usually better than gp2?" Probing: the IOPS coupling. Stalls: "It is newer." Moves up: gp2 ties IOPS to volume size, so you oversized to get speed; gp3 sells IOPS separately and costs less per GB.
11
3. "Your database on EFS is slow. Why?" Probing: the latency difference. Stalls: "It needs more throughput." Moves up: EFS is network file storage with far higher latency than a block device; a database belongs on EBS.
12
4. "How do you encrypt an existing unencrypted volume?" Probing: the procedure. Stalls: "Turn on encryption." Moves up: you cannot in place — snapshot, copy the snapshot with encryption, and restore a new volume.