EBS | Elastic Block Storage
Overview
AWS Provides a variety of data storage options for its customers such as EBS, EFS, S3, etc. EBS is one of the disk storage options. AWS EBS Volume is a storage device that can be attached to EC2 instance/RDS Instance in AWS.
What is EBS in AWS?
EBS- Elastic Block Storage , EBS is AWS's cloud-based Block Level Storage device.
In layperson's terms, EBS is a kind of Storage disk (SSD or HDD, or NVME Disk).
For Eg, Our Laptop/Computer is attached with a 500GB / 1TB Size Hard Disk / SSD.
Similarly, in AWS, EBS is a disk device that can be attached to an EC2 instance. We can customize our EBS Volume Size here based on our needs.
For a single EBS Volume, the custom size can be defined below
- Minimum EBS Size: 1 GiB
- Maximum EBS Size: 16384 GiB or 16 TB
Features of EBS
There are some features associated with AWS EBS Volume which can be used as per the customer's requirement.
Amazon EBS Elastic Volumes
There is no downtime required to modify the size of the volume and change the volume type. Because of that, we often change the volume size/type depending on applications requirement.
Note: we cannot decrease the EBS Volume size.
Amazon EBS Snapshots
We can create EBS snapshots from any EBS volumes and we will discuss this later in detail.
Amazon Data lifecycle manager for EBS snapshots
Using Lifecycle Manager, we can control how many snapshots should get created or how many days snapshots should retain in the region.
Amazon EBS-Optimized instances .
There is a certain instance released by AWS to facilitate better throughput performance between the EC2 instance and EBS Volumes.
You can find the list in the below mentioned link
How to set up Amazon EBS?
Once logged into the AWS console, enter EC2 in the search bar and click it.
-
In the EC2 left navigation pane, select Volumes under Elastic Block Stores.
-
Click Create Volume
-
Enter the below mentioned values and click create volumes
- Volume Type : General Purpose SSD gp3
- Volume Size : 100GB
- Availability Zone : us-east-2a
- Volume IOPS : 3000 IOPS (Default)
- Volume Throughput : 125 MB/s (Default)
- Encryption : aws/ebs Key
- Snapshot ID : None
-
Once volume is created, Check the volume state and status
- Volume state : Available
- Volume status : Okay
If the Volume is in an available state, you can attach the volume to the EC2 instances. Things to consider while attaching volumes. Volumes and EC2 instances should be in the same availability zone.
EBS Volume Types
There are 5 major types of EBS provided by AWS depending upon the use-cases
Before diving into types, we need to deal with the terminologies associated with those EBS Volumes types. They are
- IOPS
- Throghput
- Latency
- Burst
IOPS
IOPS- Input/Output Operations per Second
IOPS is the measurement of how many reads and writes a disk device will be able to perform per second.
For example,
Read: Opening an existing word document is a read operation Write: Changing the words and saving the document is a write operation.
IOPS is directly proportional to the performance of the Disk.(i.e) the higher the IOPS, the higher the EBS Volume performance.
Throughput
Throughput is the measurement of how much data was transferred from a source at a particular time.
Latency
Latency is defined as the amount of time the device takes for a packet of data transferred from source to destination.
Burst
Burst mode is a temporary high-speed data transmission mode used to perform high-speed data transfer at maximum throughput.
Usually, Burst mode data transfer rate (DTR) speeds faster than normal transmission protocols by 2-5 times.
Types of EBS Volumes:
There are five types of EBS Volumes provided by AWS across 2 categories.
SSD
- General Purpose SSD
- gp2
- gp3
- Provisioned IOPS SSD
- io1
- io2
- io2 block express
HDD
- Throughput Optimized HDD
- st1
- Cold HDD
- sc1
- Magnetic (Previous generation EBS Volumes)
SSD-based volumes
General Purpose SSD
Volume Name | General Purpose SSD | General Purpose SSD |
---|---|---|
Volume Types | gp3 | gp2 |
Description | General Purpose SSD volume that balances price performance for a wide variety of transactional workloads | General Purpose SSD volume that balances price performance for a wide variety of transactional workloads |
Use Cases | virtual desktops, medium sized single instance databases such as MSFT SQL Server and Oracle DB, low-latency interactive apps, dev & test, boot volumes | Boot volumes, low-latency interactive apps, dev & test |
Volume Size | 1 GB – 16 TB | 1 GB – 16 TB |
Durability | 99.8% – 99.9% | 99.8% – 99.9% |
Max IOPS / Volume | 16,000 | 16,000 |
Max Throughput / Volume | 1000 MB/s | 250 MB/s |
Max IOPS / Instance | 260,000 | 260,000 |
Max IOPS / GB | N/A | N/A |
Max Throughput / Instance | 7,500 MB/s | 7,500 MB/s |
Latency | single digit millisecond | single digit millisecond |
Multi-Attach | No | No |
Provisioned IOS SSD
Volume Name | Provisioned SSD | Provisioned SSD | Provisioned SSD |
---|---|---|---|
Volume Types | io1 | io2 | io2 Block Express |
Description | High performance SSD volume designed for latency-sensitive transactional workloads | High performance SSD volume designed for business-critical latency-sensitive applications | High performance SSD volume designed for business-critical latency-sensitive applications |
Use Cases | Workloads that require sustained IOPS performance or more than 16,000 IOPS and I/O-intensive database workloads | Workloads that require sub-millisecond latency, and sustained IOPS performance or more than 64,000 IOPS or 1,000 MiB/s of throughput | I/O-intensive NoSQL & relational databases |
Volume Size | 4 GB – 16 TB | 4 GB – 16 TB | 4 GB – 64 TB |
Durability | 99.8% – 99.9% | 99.999% | 99.999% |
Max IOPS / Volume | 64,000 | 64,000 | 256,000 |
Max Throughput / Volume | 1,000 MB/s | 1,000 MB/s | 4,000 MB/s |
Max IOPS / GB | 260,000 | 160,000 | 260,000 |
Max Throughput / Instance | 4,750 MB/s | 7,500 MB/s | 7,500 MB/s |
Latency | single digit millisecond | single digit millisecond | sub-millisecond |
Multi-Attach | Yes | Yes | No |
HDD-based volumes
Volume Name | Throughput Optimized HDD | Cold SSD |
---|---|---|
Volume Types | st1 | sc2 |
Description | Low cost HDD volume designed for frequently accessed, throughput intensive workloads | Lowest cost HDD volume designed for less frequently accessed workloads |
Use Cases | Big data, data warehouses, log processing | Colder data requiring fewer scans per day |
Volume Size | 125 GB - 16 TB | 125 GB - 16 TB |
Durability | 99.8% - 99.9% | 99.8% – 99.9% |
Max IOPS / Volume | 500 | 250 |
Max Throughput / Volume | 500 MB/s | 250 MB/s |
Max IOPS / Instance | 260,000 | 260,000 |
Max IOPS / GB | N/A | N/A |
Max Throughput / Instance | 7,500 MB/s | 7,500 MB/s |
Multi-Attach | No | No |
Benefits of EBS
1. Data Availability and Persistence
The first benefit would be EBS Volume data persistence and the maximum uptime of EBS volume is between 99.00% and 99.99% as per AWS SLA.
For eg, If we store 100 GB storage in EBS Volume, AWS SLA is Guaranteed for a maximum of 99.9 GB and a minimum of 99.5 GB.
Note: The data stored in EBS Volume will be available independent from the life of an instance.
AWS EBS Service Level Agreement
2. Data Encryption
EBS Volumes can be encrypted by AWS KMS or CMS(customer master key). We can use encrypted EBS volumes to meet regulated/audited data and application compliance requirements.
3. Snapshots
Snapshots are incremental backups of EBS Volume.
Incremental Backup:
For eg : If you have a EBS volume with 50 GB of data, but only 10 GB of data have changed since the taken of the last snapshot, only the 10 GB of modified data is written to Amazon S3.
We will discuss Snapshots in detail later in this article.
4. Flexibility
We can dynamically increase the size of EBS Volume on live production without requiring downtime for current-generation instance types. We can also modify EBS volume type and IOPS capacity without service interruptions.
Drawbacks of EBS
-
There is no support for decreasing the size of an EBS volume in AWS.
-
EBS encryption is only available on certain instance types.
-
We must stop the EC2 instance before we detach the volume if the volume is the root volume of the EC2 Instance.
-
We can have up to 5,000 EBS volumes and 10,000 Snapshots by default in a region, Other than that, we need to raise a support request with AWS to increase Volumes and snapshots Quota.
EBS Snapshots
-
Snapshots are incremental backups of EBS Volume.
-
A snapshot belongs to region only where it created.
-
As the Snapshots are constrained to the Region, To share a snapshot from one region to another region, we need to copy the snapshot from the current region to the desired Region.
-
Snapshots will copy the EBS Volumes and store them in Amazon S3.
Note: We can't see the EBS Backups in the AWS S3 console.
-
Using snapshots, we can create a new volume in the same availability zone or a different availability zone as well.
-
Snapshots of encrypted EBS volumes are automatically encrypted.
Reference Diagram:
Amazon EBS Pricing
The pricing of EBS depends on three parameters.
- Volume Type
- Volume Size
- IOPS
SSD Volumes
EBS Volumes | Price/GB-Month | Price/IOPS-Month |
---|---|---|
GP2 | $0.10/GB-month | 3 IOPS/GB |
GP3 | $0.08/GB-month | $0.005/provisioned IOPS-month over 3,000 IOPS |
IO1 | $0.125/GB-month | $0.065/provisioned IOPS-month |
IO2 | $0.125/GB-month | $0.065/provisioned IOPS-month up to 32,000 IOPS |
IO2 Block express | $0.125/GB-month | $0.065/provisioned IOPS-month up to 32,000 IOPS |
HDD Volumes
EBS Volumes | Price/GB-Month | Price/IOPS-Month |
---|---|---|
ST1 | $0.045/GB-month | 500IOPS/Volume |
SC1 | $0.015/GB-month | 250IOPS / Volume |
Conclusion
-
AWS EBS Volumes are block-level storage that can be attached to EC2 Instances and RDS Instances.
-
AWS EBS Volumes provide flexible performance for all types of workloads across a wide range of application use cases.
-
EBS Volumes are a lot cheaper than most of the other Cloud service providers (Azure, OCI, GCP, etc) and on-premise storage costs.