AWS EBS

· Updated · 4 min read · AWS Storage · Cloud service

Amazon Elastic Block Store #

Amazon EBS provides block storage volumes for the persistent data of EC2 instances. The operating system of an instance is stored in an EBS volume, it is possible to attach several volumes to an instance and, for some volume types, even share a volume between instances using EBS Multi-Attach.

Maximum Volume Size #

EBS supports volumes of up to 64 TiB (the limit depends on the volume type). The operating system sees an EBS volume as a locally attached disk (a native block device), partitioned with MBR or GPT and formatted with the preferred file system (Ext4, XFS, NTFS).

Note: AWS and many providers now use Tebibyte (TiB) instead of terabyte (TB) as a measure of storage capacity.

  • Terabyte (TB): Uses the decimal system (powers of 10). 1 TB equals 1,000,000,000,000 bytes (1 trillion bytes). This system is commonly used in the marketing and sales of storage devices.
  • Tebibyte (TiB): Uses the binary system (powers of 2). 1 TiB equals 2^40 bytes, which is roughly equivalent to 1,099,511,627,776 bytes (almost 1.1 TB). This system is more accurate for representing actual storage capacity as digital data is stored in binary bits.

The difference between units is about 10%, which is a substantial discrepancy for massive amounts of data, like in cloud storage or large server arrays.

Replication and Availability #

EBS volumes are automatically replicated within their Availability Zone and can be attached only to instances in the same Availability Zone. A volume can be configured to be deleted when the instance is terminated, or to remain available to be attached to another instance.

Root Volume #

A root volume is the main storage volume associated with a virtual machine instance. It holds the operating system, applications, and user data for that specific instance. A root volume can be mounted into another instance and act as an additional disk. This is commonly done to fix broken systems, for example when a misconfiguration of the SSH daemon prevents access to the instance.

The EC2 instances created with Terraform in these tutorials use EBS root volumes to store the operating system and the data.

Data encryption #

Volumes can be encrypted with AES-256 using keys managed by AWS Key Management Service (KMS). Encryption also covers the snapshots and the data in transit between the volume and the instance.

Data security #

AWS uses specific methods to erase the data of a volume before it is reused or decommissioned.

Snapshots #

EBS volumes can be backed up with Snapshots. Snapshots are incremental backups stored in S3: only the blocks changed since the last snapshot are copied, which makes the process fast and cost-efficient. They can be copied to other Regions, shared with other accounts and used to create new volumes for new instances or for recovery. Snapshots can be created on running instances as well as on stopped instances.

Volume Size #

The size of a volume can be increased while it is in use. After the change, the operating system of the instance needs to extend the file system of the EBS volume to use the new size.

Volume Type & IOPS Capacity #

EBS volumes are available in four families of types offering different performances, capabilities, and prices.

The IOPS (Input/Output Operations Per Second) capacity is the maximum number of read and write operations that an EBS volume can perform in a second.

General Purpose SSD (gp3 and gp2) #

The balanced choice for most workloads. gp3 has a baseline of 3,000 IOPS and 125 MiB/s whatever the size of the volume, and IOPS and throughput can be increased independently, at a lower price per GB than gp2. gp2 is the previous generation: its performance depends on the size (3 IOPS per GB, from 100 up to 16,000 IOPS per volume).

Provisioned IOPS SSD (io2 Block Express and io1) #

It allows you to specify the IOPS you need for your workload, offering consistent, low-latency performance for critical applications such as large databases. It has the highest IOPS and throughput limits of all the volume types; check the volume types page for the current limits.

Hard disk drive (HDD): st1 and sc1 #

st1 (Throughput Optimized HDD) is a low-cost option for frequently accessed, throughput-intensive workloads such as big data and log processing. sc1 (Cold HDD) has lower throughput and is the lowest-cost option for infrequently accessed data. HDD volumes cannot be used as boot volumes.

Previous generation: Magnetic (standard) #

Magnetic volumes are a previous generation type and are not recommended for new workloads.

Choosing a Volume Type #

It is essential to choose the appropriate EBS volume type and size based on the performance requirements and workload characteristics to ensure optimal performance and cost efficiency.

In these tutorials, the General Purpose SSD gp3 volume type will be used along with EBS–optimized instances that have dedicated network bandwidth to Amazon EBS.

More tutorials that use EBS

#AWS #AWS EBS