Understand EBS volume types, when to use SSD versus HDD, EBS snapshots, and the difference between EBS and instance store.
EBS — Elastic Block Store
EBS provides persistent storage volumes for EC2 instances — like a hard drive that you attach to your virtual server. When you stop an EC2 instance, the data on EBS survives.
Teacher Note: Think of EBS like a USB hard drive plugged into your computer (EC2). You can unplug it from one computer and plug it into another. The data stays on the drive even when the computer is turned off.
EBS Volume Types
| Type | Technology | IOPS | Best For | Cost |
|---|
| gp3 | SSD (General Purpose) | 3,000-16,000 | Web servers, dev environments — DEFAULT choice | Low ($0.08/GB) |
| io2 Block Express | SSD (Provisioned IOPS) | Up to 256,000 | Critical databases — Oracle, SAP HANA | High |
| st1 | HDD (Throughput) | Sequential only | Big data, Kafka logs, data warehouses | Low ($0.045/GB) |
| sc1 | HDD (Cold) | Sequential only | Infrequently accessed archives | Lowest ($0.015/GB) |
Key EBS Facts
- EBS volumes are locked to ONE Availability Zone — cannot attach to EC2 in a different AZ
- Snapshots copy EBS volume data to S3 — incremental and cross-region copyable
- Encryption at rest uses KMS keys — encrypting an existing unencrypted volume requires: create snapshot, copy snapshot with encryption, create new volume from encrypted snapshot
- gp3 is the recommended default — independent IOPS and throughput from size
Instance Store vs EBS
| Feature | Instance Store | EBS |
|---|
| Persistence | LOST when instance stops/terminates | Survives stops and restarts |
| Speed | VERY fast (physically attached NVMe) | Fast (network-attached) |
| Use case | Temp files, caches, scratch space | Databases, application files, OS |
| Cost | Included in instance price | Separate charge per GB/month |
Exam Tip: The exam tests: EBS is AZ-locked. To move an EBS volume to another AZ: create a snapshot, copy it to the new AZ, create a new volume from it. Remember: gp3 lets you scale IOPS independently of size — gp2 does not.