EBS, EFS, and EC2 Instance Store
AWS offers multiple storage options that serve different needs. This lesson focuses on three services that attach directly to compute: Amazon EBS (block storage), Amazon EFS (file storage), and EC2 Instance Store (ephemeral block storage).
| Service | Type | Persistent? | Attachable To |
|---|---|---|---|
| Amazon EBS | Block storage | Yes | One EC2 instance at a time (same AZ) |
| Amazon EFS | File storage (NFS) | Yes | Thousands of EC2 instances (multi-AZ) |
| EC2 Instance Store | Block storage | No (ephemeral) | Single EC2 instance (physically attached) |
Amazon Elastic Block Store (Amazon EBS) provides persistent block storage volumes for use with EC2 instances. Each volume is automatically replicated within its Availability Zone to protect against component failure.
| Type | Best For | Notes |
|---|---|---|
| General Purpose SSD (gp3) | Most workloads: boot volumes, dev/test, low-latency interactive apps, virtual desktops. | Balances price and performance. Can be used as a boot volume. |
| Provisioned IOPS SSD (io2) | Critical business apps, large databases needing sustained IOPS performance. | Highest performance. For workloads needing more than 16,000 IOPS. |
| Throughput Optimized HDD (st1) | Streaming workloads, big data, log processing requiring consistent fast throughput. | Cannot be a boot volume. Lower cost per GB than SSD. |
| Cold HDD (sc1) | Throughput-oriented storage for large volumes of infrequently accessed data. | Lowest storage cost. Cannot be a boot volume. |
Amazon Elastic File System (Amazon EFS) provides simple, scalable, elastic file storage for use with AWS services and on-premises resources. It uses the Network File System (NFS) protocol.
To access EFS, you create mount targets in your VPC subnets. Each AZ should have one mount target. EC2 instances connect to the mount target in their own AZ for optimal performance.
EC2 Instance Store provides ephemeral, temporary block-level storage for your EC2 instance. The storage is located on disks that are physically attached to the host computer.
Do multiple EC2 instances need to access the same data concurrently? Yes → Amazon EFS.
Does the data need to survive if the EC2 instance stops? Yes → Amazon EBS. No → Consider Instance Store for highest performance temporary data.
Is the data accessed as objects over HTTP/HTTPS from anywhere? Yes → Amazon S3 (covered in the previous lesson).
| Scenario | Best Storage | Why |
|---|---|---|
| Database boot volume requiring fast, persistent storage | EBS (gp3 or io2) | Persistent, low-latency block storage. Can be used as a boot volume. |
| Shared home directories for hundreds of Linux users | EFS | Shared NFS access across many instances and AZs. |
| Temporary rendering files for a video processing pipeline | Instance Store | Highest performance, physically attached. Data can be recreated if lost. |
| Long-term backups that must survive AZ failure | EBS snapshots in S3 | Snapshots are stored in S3 with 11 9s durability and can be copied across Regions. |
Select one answer per question. You will receive immediate feedback.