Amazon EBS – Complete Guide

Bits Lovers
Written by Bits Lovers on
Amazon EBS – Complete Guide

Amazon EBS (Elastic Block Store) is a block storage service from AWS. You can attach these volumes to your EC2 instances and use them for databases, file systems, or anything that needs persistent storage.

If an EC2 instance stops or terminates, the EBS volume sticks around. You can detach it and attach it to another instance later. That’s the main difference from instance store volumes, which disappear when their instance does.

Volume Types

EBS offers several volume types, each designed for different workloads:

SSD-backed:

  • gp3 - General purpose SSD, the default choice for most workloads. You get 3,000 IOPS and 125 MiB/s throughput included, and you can bump those up independently if you need more.
  • gp2 - Older general purpose SSD, gradually being replaced by gp3. Works fine but gp3 is usually the better value.
  • io2 - High-performance SSD for I/O-intensive applications like databases. Supports up to 64,000 IOPS per volume.
  • io1 - Predecessor to io2, still available but io2 is the better option for new deployments.

HDD-backed:

  • st1 - Throughput optimized HDD, good for big data workloads, data warehouses, and log processing.
  • sc1 - Cold storage HDD, the cheapest option for infrequently accessed data.

EBS vs Instance Store

Instance store volumes come attached to the host machine itself. They’re fast and don’t cost extra, but the data vanishes if your instance stops, terminates, or if the underlying hardware fails. EBS persists independently of any single EC2 instance.

For anything you can’t afford to lose, use EBS. For temporary data like caches, buffers, or data you’re actively processing, instance store works fine.

Encryption

EBS volumes encrypt data at rest by default when you create them in modern AWS accounts. The encryption uses AWS-managed KMS keys, though you can bring your own keys if you need more control.

To enable encryption on an existing unencrypted volume, you can’t encrypt it in place. Instead, create a snapshot of the volume, then create a new volume from that snapshot with encryption enabled.

Snapshots

EBS snapshots live in S3. You can copy them across regions, share them with other accounts, or use them to create new volumes. Snapshots are incremental, so after the initial backup, subsequent snapshots only capture changed blocks.

Multi-Attach

You can attach a single io1 or io2 volume to multiple EC2 instances in the same Availability Zone. This is useful for clustered applications like Oracle RAC that need shared storage. Note that your application still needs to handle concurrent access properly.

Monitoring

CloudWatch tracks volume metrics like:

  • VolumeReadOps / VolumeWriteOps
  • VolumeThroughput
  • VolumeIdleTime
  • VolumeQueueLength

Queue length is particularly useful for spotting performance bottlenecks. If it’s consistently above zero, your volume can’t keep up with demand.

Pricing

EBS pricing varies by volume type and region. You’re charged for:

  • Storage capacity (per GB-month)
  • I/O operations (for magnetic volumes)
  • Snapshot storage (per GB-month)
  • Data transfer between Availability Zones

gp3 is generally the most cost-effective for general use since you can independently scale IOPS and throughput. io2 makes sense when you genuinely need the extra performance.

Use the AWS Pricing Calculator to estimate costs for your specific configuration.

Choosing a Volume Type

Pick gp3 if you’re unsure. It handles most workloads and gives you flexibility to adjust performance without changing the volume size.

Move to io2 when your database or application actually needs the extra IOPS and you can measure the performance difference.

Stick with st1 or sc1 only for workloads where throughput matters more than IOPS, like log processing or data warehouse imports where you’re reading large sequential blocks.

Bits Lovers

Bits Lovers

Professional writer and blogger. Focus on Cloud Computing.

Comments

comments powered by Disqus