Lesson 2 of 5 Storage Architecture

Choosing and Protecting Amazon EBS Block Storage

This lesson explains how Amazon EBS provides network-attached block volumes for databases, boot volumes and applications that expect a local disk, with independently chosen type, size and performance and snapshots for recovery and movement.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose a volume type for performance and cost.
  • Explain the Availability Zone scope and durability of volumes.
  • Describe how snapshots work across Availability Zones, Regions and accounts.

Volume types

EBS volume types balance performance against cost. gp3 is the default general-purpose SSD. It has a baseline of 3,000 IOPS and 125 MB/s whatever its size, and both can be provisioned independently of capacity, up to 80,000 IOPS and 2,000 MB/s. It is also cheaper than the older gp2, whose performance grew only with size. io2 Block Express provides up to 256,000 IOPS, 99.999% durability, sub-millisecond latency and Multi-Attach, for critical databases. The HDD types, st1 (throughput-optimised) and sc1 (cold), cost least and suit large sequential data and infrequently accessed data. The following table summarises the types.

Volume typeCharacteristicsUse
gp3Baseline 3,000 IOPS and 125 MB/s, both provisionable independently of size, up to 80,000 IOPS and 2,000 MB/sDefault for most workloads; cheaper than gp2
io2 Block ExpressUp to 256,000 IOPS, 99.999% durability, sub-millisecond latency, Multi-AttachCritical databases
st1 / sc1Throughput-optimised and cold HDDBig sequential data, infrequent access

3,000IOPS

gp3 baseline at any size

80,000IOPS

gp3 maximum

2,000MB/s

gp3 maximum throughput

Scope and durability

An EBS volume lives in one Availability Zone and attaches only to instances in that zone. It is replicated within the zone, which protects against component failure, but not across zones, so surviving the loss of an Availability Zone needs replication at a higher level, such as RDS Multi-AZ or a database's own replication, or recovery from snapshots, which are stored Regionally.

Elastic Volumes change a volume's size, type and performance while it is in use, so capacity can follow demand without downtime. When performance disappoints, CloudWatch EBS metrics such as VolumeQueueLength show whether the volume is the bottleneck, and the instance type's own EBS bandwidth limit must also be checked, because a fast volume on a small instance is limited by the instance.

Snapshots

EBS snapshots are incremental, stored regionally, and can be copied across Regions and shared across accounts (encrypted snapshots need a customer managed key). Data Lifecycle Manager or AWS Backup automates them. Fast Snapshot Restore removes the first-read latency of volumes restored from snapshots, which matters for rapid recovery, and the Snapshot Archive tier reduces the cost of snapshots kept for months or years.

Worked example

Sizing volumes for a database

A SQL Server database being migrated needs 40,000 IOPS at peak and 2 TB of storage. A gp3 volume could be provisioned for that rate, but the database is business-critical and requires consistent sub-millisecond latency and the highest durability. The architect chooses io2 Block Express, provisioned for 40,000 IOPS, on an instance whose EBS bandwidth supports that rate. Log and tempdb volumes, which need throughput rather than extreme IOPS, use gp3 with throughput raised to 500 MB/s. Nightly snapshots are copied to the DR Region by AWS Backup.

Check yourself

How is an EBS volume's data moved to another Availability Zone?

Show answer

Take a snapshot, which is stored at Region level, and create a volume from it in the other zone. A volume itself belongs to one zone.

Exam Tips

Remember for the exam

  • gp3 is the default EBS choice; io2 Block Express for the highest IOPS and durability.
  • EBS volumes are confined to one AZ; cross-AZ resilience needs replication or snapshots.
  • Elastic Volumes change type, size and performance online.
  • To restore volumes from snapshots at full performance immediately, enable Fast Snapshot Restore.
  • Encrypted snapshots shared across accounts need a customer managed key.