Introduction to AWS Elastic Block Store(EBS)
AWS Storage Services: AWS offers a wide range of storage services that can be provisioned depending on your project requirements and use case. AWS storage services have different provisions for highly confidential data, frequently accessed data, and the not so frequently accessed data. You can choose from various storage types namely, object storage, file storage, block storage services, backups,, and data migration options. All of which fall under the AWS Storage Services list.
Elastic Block Storage (EBS): From the aforementioned list, EBS is a block type durable and persistent storage that can be attached to EC2 instances for additional storage. Unlike EC2 instance storage volumes which are suitable for holding temporary data EBS volumes are highly suitable for essential and long term data. EBS volumes are specific to availability zones and can only be attached to instances within the same availability zone.
EBS can be created from the EC2 dashboard in the console as well as in Step 4 of the EC2 launch. Just note that when creating EBS with EC2, the EBS volumes are created in the same availability zone as EC2, however when provisioned independently users can choose the AZ in which EBS is required.
Features of EBS:
- Scalability: EBS volume sizes and features can be scaled as per the needs of the system. This can be done in two ways:
- Take a snapshot of the volume and create a new volume using the Snapshot with new updated features.
- Updating the existing EBS volume from the console.
- Backup: Users can create snapshots of EBS volumes that act as backups.
- Snapshot can be created manually at any point in time or can be scheduled.
- Snapshots are stored on AWS S3 and are charged according to the S3 storage charges.
- Snapshots are incremental in nature.
- New volumes across regions can be created from snapshots.
- Encryption: Encryption can be a basic requirement when it comes to storage. This can be due to the government of regulatory compliance. EBS offers an AWS managed encryption feature.
- Users can enable encryption when creating EBS volumes by clicking on a checkbox.
- Encryption Keys are managed by the Key Management Service (KMS) provided by AWS.
- Encrypted volumes can only be attached to selected instance types.
- Encryption uses the AES-256 algorithm.
- Snapshots from encrypted volumes are encrypted and similarly, volumes created from snapshots are encrypted.
- Charges: Unlike AWS S3, where you are charged for the storage you consume, AWS charges users for the storage you hold. For example if you use 1 GB storage in a 5 GB volume, you’d still be charged for a 5 GB EBS volume.
- EBS charges vary from region to region.
- EBS Volumes are independent of the EC2 instance they are attached to. The data in an EBS volume will remain unchanged even if the instance is rebooted or terminated.
Single EBS volume can only be attached to one EC2 instance at a time. However, one EC2 can have more than one EBS volumes attached to it.
- EBS volumes are specific to availability zones and can only be attached to EC2 in the same availability zone. In case AWS’ availability zone is to go down, access to the EBS volume will be lost.
- Can be used for rapidly changing data that needs good I/Ops.
- As compared to EC2 instance storage the control over data and flexibility offered by EBS is far greater.
- To provide durability, EBS volumes are replicated in their availability zone but are limited to one availability zone.
Types of EBS Volumes:
SSD: This storage type is suitable for small chunks of data that requires fast I/Ops. SSDs can be used as root volumes for EC2 instances.
- General Purpose SSD (GP2)
- Offers a single-digit millisecond latency.
- Can provide 3000 IOps burst.
- IOps speed is limited from 3-10000 IOps.
- The throughput of these volumes is 128MBPS up to 170GB. After which throughput increases 768KBPS per GB and peaks at 160MBPS.
- Provisioned IOPS SSD (IO1)
- These SSDs are IO intensive.
- Users can specify IOPS requirement during creation.
- Size limit is 4TB-16TB
- According to AWS claims “These volumes, if attached to EBS optimized instances will deliver IOPS defined within 10% 99.9% times of the year”
- Max IOPS speed is 20000.
HDD: This storage type is suitable for Big Data chunks and slower processing. These volumes cannot be used as root volumes for EC2. AWS claims that “These volumes provide expected throughput 99.9% times of the year”
- Cold HDD (SC1)
- SC1 is the cheapest of all EBS volume types. It is suitable for large, infrequently accessed data.
- Max Burst speed offered is 250 Mbps
- Throughput optimized HDD (ST)
- Suitable for large, frequently accessed data.
- Burst speed ranges from 250 MBPS to 500 MBPS.
The above image shows single EBS volumes attached to their respective EC2 instances (Note that EBS cannot be shared between two volumes, however one EFS can be attached to multiple EC2 servers). These Volumes can have a multiple of use cases as discussed below:
- Database storage: Given the low latency and scalability offered by EBS it is highly suitable for storing relational as well as NoSQL databases.
- Business intensive applications: Given the scheduled backup offered by EBS as snapshots the recovery of data is quick and a refreshed system can be rebooted efficiently with minimal data loss.
- Hard Disks for EC2 servers: EBS volumes can be used as hard drives to your EC2 servers. They are independent of your EC2 servers and hence your data in these volumes is safe even if EC2 servers fails/reboots/terminate
- Hosting Large Applications: EBS provides an exceptionally low latency period amounting to a great computing power of the architecture. It can be used to hold big enterprise application software and data.
- Root Volumes for EC2: EBS types GP2 and IO1 can be used as the root volumes for your EC2 server.
Use of EBS in database applications:
EBS can be used to store data for database applications in a number of ways. Some examples include:
- As a root volume for a database instance: An EBS volume can be used as the root volume for an Amazon EC2 instance running a database application, such as MySQL or PostgreSQL. This allows the database application to store its data on a persistent and highly available storage volume, rather than relying on the ephemeral storage of the EC2 instance.
- As a storage volume for a managed database service: AWS offers several managed database services, such as Amazon RDS and Amazon Aurora, that allow users to easily set up and manage a database without having to worry about the underlying infrastructure. These services allow users to create EBS volumes as the storage for their database, providing persistent and scalable storage for the database data.
- As a storage volume for containerized databases: EBS can also be used as the storage for containerized database applications, such as those deployed using Amazon ECS or Amazon EKS. This allows users to store their database data on a persistent and highly available storage volume, while still taking advantage of the benefits of running their database in a containerized environment.
Drawbacks:
- EBS is not recommended as temporary storage.
- They cannot be used as a multi-instance accessed storage as they cannot be shared between instances.
- The durability offered by services like AWS S3 and AWS EFS is greater.
Contact Us