How it works
The explanation, with examples you can run.
EBS: a disk with a zone
An EBS volume is created in one Availability Zone, replicated across several servers inside it, and attached to instances in that zone (one at a time, except io1 and io2 multi-attach for clustered software). Volume types trade cost for performance:
| Type | Notes |
|---|---|
| gp3 | General purpose SSD; baseline IOPS and throughput you can raise independently of size. The default choice. |
| io2 Block Express | Provisioned IOPS for demanding databases, higher durability |
| st1, sc1 | Throughput-oriented and cold HDD for large sequential workloads |
Because a volume lives in one zone, so does whatever depends on it. If that zone fails, the volume is unavailable until it recovers. Snapshots are the escape hatch: incremental, point-in-time copies stored at Region level, which you can restore into any zone, copy to another Region or account, and schedule with Data Lifecycle Manager or AWS Backup. A snapshot of a running database is crash-consistent at best; use the database's own backup or flush before snapshotting.
Encrypt volumes (you can make encryption the default per Region in account settings), and watch the throughput limits of both the volume and the instance type, since either can be the bottleneck.
EFS: shared and elastic
EFS speaks NFSv4.1 and grows and shrinks as you add files, so there is nothing to size. Many EC2 instances, ECS and EKS tasks, and Lambda functions can mount it at once. Regional file systems (the recommended kind) store data redundantly across several zones, with a mount target in each zone; One Zone file systems are cheaper and live in one zone. Throughput modes include Elastic, which scales with demand and bills per use.
The costs of sharing: every operation is a network round trip, so workloads with many small files and metadata calls (such as npm install or a Git checkout) are much slower than on a local disk, and NFS locking semantics are weaker than a local file system's. Lifecycle management can move cold files to cheaper Infrequent Access and Archive classes.
Choosing
- Single writer, low latency, a database or a boot disk: EBS.
- Many clients sharing files across zones: EFS.
- Whole objects, HTTP access, unlimited scale, cheapest per GB: S3.
- Scratch space and caches that may vanish: instance store.
Whatever you choose, the safest design keeps durable state in a managed service (S3, RDS, DynamoDB) and treats instances and their disks as replaceable.
Check yourself
3 questions. Get them all right to finish this topic.
0 of 3 right so far. Get all three to finish this topic.