Sub topic 1
Block Storage for EC2 with Amazon EBS
Prerequisites
Assume you understand EC2 instances, AMIs, Availability Zones, basic Linux commands, and file systems. You should also know how to use the AWS CLI or console.
What Amazon EBS Is and How It Works
Amazon Elastic Block Store (EBS) provides persistent block storage for an EC2 instance. A block device stores data in addressable blocks, like a disk. An EBS volume exists independently from the instance, so the data normally remains when the instance stops or is replaced.
An EBS volume belongs to one Availability Zone. You can attach it to an instance in that same Availability Zone. The instance operating system then sees the volume as a disk. You format it with a file system, such as XFS or ext4, and mount it at a directory.
EBS Versus Other Storage
| Storage | Main property | Typical use |
|---|---|---|
| EBS | Persistent block storage for one AZ | Boot disks and databases |
| Instance store | Local, fast storage tied to instance hardware | Temporary cache or scratch data |
| EFS | Shared, elastic file system | Files shared by many instances |
| S3 | Regional object storage accessed through an API | Backups, media, and data lakes |
Instance store data is lost when the instance is stopped, terminated, or moved to different hardware. EFS and S3 use different access models, so applications cannot treat them exactly like a local disk.
Choosing a Volume Type
For most general workloads, choose gp3. It lets you set size, IOPS, and throughput independently. Choose io2 or io1 when you need consistently high IOPS and low latency. Use st1 for large, sequential workloads such as log processing. Use sc1 for infrequently accessed, low-cost sequential data. gp2 is an older general-purpose option whose performance depends partly on volume size.
IOPS, Throughput, and Latency
IOPS means input/output operations per second. It matters when an application performs many small reads and writes. Throughput measures data transferred per second, usually in MiB/s. It matters for large sequential transfers. Latency is the time each operation takes.
A workload can have high throughput but low IOPS, or high IOPS but low throughput. Check the application's request size and access pattern instead of choosing a volume from capacity alone.
EBS-Optimized Instances and Limits
An EBS-optimized instance provides dedicated bandwidth between the instance and EBS. Its maximum IOPS and throughput still depend on the instance type. A volume can be provisioned for more performance than the instance can deliver, creating an instance-level bottleneck.
Exercise
A database needs many small, consistent operations. Which performance measure and volume family deserve priority?
Show answer
Prioritize IOPS and predictable latency, then evaluate an io2 volume and the instance's EBS limits.