You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Every EC2 instance needs storage — for the operating system, application data, logs, and temporary files. AWS provides two primary categories of block storage for EC2: Amazon EBS (Elastic Block Store) for persistent, network-attached storage and Instance Store for high-performance, ephemeral local storage. This lesson covers both in detail.
Amazon EBS provides persistent block-level storage volumes that you attach to EC2 instances. Think of an EBS volume as a virtual hard drive in the cloud.
Key characteristics:
AWS offers several EBS volume types, each optimised for different performance and cost requirements:
| Volume Type | Category | Max IOPS | Max Throughput | Use Cases |
|---|---|---|---|---|
| gp3 | General Purpose SSD | 16,000 | 1,000 MiB/s | Boot volumes, dev/test, most workloads |
| gp2 | General Purpose SSD | 16,000 | 250 MiB/s | Legacy default; use gp3 for new volumes |
| io2 Block Express | Provisioned IOPS SSD | 256,000 | 4,000 MiB/s | Mission-critical databases, SAP HANA |
| io1 | Provisioned IOPS SSD | 64,000 | 1,000 MiB/s | Databases needing consistent IOPS |
| st1 | Throughput Optimised HDD | 500 | 500 MiB/s | Big data, data warehouses, log processing |
| sc1 | Cold HDD | 250 | 250 MiB/s | Infrequently accessed data, lowest cost |
gp3 is the current recommended general-purpose volume:
| Feature | gp3 | gp2 |
|---|---|---|
| Baseline IOPS | 3,000 (independent of size) | 3 IOPS per GiB (min 100, max 16,000) |
| Baseline throughput | 125 MiB/s (independent of size) | Scales with IOPS |
| Provisioned IOPS | Up to 16,000 (additional cost) | Not configurable separately |
| Cost | ~20% cheaper than gp2 at baseline | Higher baseline cost |
Best practice: Use gp3 for new volumes. It provides better baseline performance at a lower cost than gp2.
For workloads that need guaranteed, consistent IOPS regardless of volume size:
# Create an io2 volume with 10,000 provisioned IOPS
aws ec2 create-volume \
--volume-type io2 \
--size 100 \
--iops 10000 \
--availability-zone us-east-1a
io2 Block Express (available on Nitro-based instances) supports up to 256,000 IOPS and 4,000 MiB/s throughput — suitable for the most demanding database workloads.
io2 and io1 volumes support Multi-Attach, allowing a single volume to be attached to up to 16 Nitro-based instances in the same AZ simultaneously. This is useful for clustered applications that need shared block storage (e.g., Oracle RAC).
An EBS snapshot is a point-in-time backup of an EBS volume, stored in Amazon S3 (managed by AWS — you do not see the snapshots in your S3 buckets).
# Create a snapshot
aws ec2 create-snapshot \
--volume-id vol-0123456789abcdef0 \
--description "Pre-upgrade backup"
# Create a volume from a snapshot (can be in a different AZ)
aws ec2 create-volume \
--snapshot-id snap-0123456789abcdef0 \
--availability-zone us-east-1b \
--volume-type gp3
# Copy a snapshot to another region (for disaster recovery)
aws ec2 copy-snapshot \
--source-snapshot-id snap-0123456789abcdef0 \
--source-region us-east-1 \
--destination-region eu-west-1
Key snapshot features:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.