Understanding Amazon Elastic Block Storage
In simple terms, Amazon Elastic Block Storage (EBS) is a hard drive for a server in AWS. One advantage of Amazon EBS over many typical hard drives is that you can easily detach it from one server and attach it to another server using software commands. Usually, with other servers outside of AWS, this would require physically detaching the hard drive and physically attaching it to another server.
Additionally, if you use the Amazon Elastic File Storage (EFS) service, you will be able to attach the hard drive (block storage device) to multiple servers (EC2 instances). It significantly simplifies your maintenance and operations.
When using Amazon EBS, data is persisted. This means that data lives even after the server is shut down. Like other services, Amazon EBS provides high availability and durability.
Amazon EBS should not be confused with the instance store available in EC2 instances. EC2 instance stores deliver ephemeral storage for EC2 instances. Some of the use cases for EC2 instance stores are any data that does not need to be persisted, such as the following:
- Caches
- Buffers
- Temporary files
- Temporary variables
If data needs to be stored permanently, the following Amazon EBS options are available.
General-purpose Solid-State Devices (SSDs)
General-purpose SSD storage provides a solid balance of cost and performance. It can be applied to a wide array of use cases, such as the following:
- Virtual desktops
- Development and staging environments
- Application development
There are two types of general-purpose SSD volume available gp2 and gp3. They come in the volume size of 1 TB to 16 TB with IOPS up to 16,000. IOPS stands for input/output operations per second and is a way to measure disk performance. The gp3 is the latest generation of SSD volume and is 20% less price than the gp2 volume.
Provisioned IOPS SSD
As the name suggests, provisioned IOPS means that these operations are provisioned consistently. This type of storage is ideally suited for mission-critical applications where needed high IOPS performance, such as the following:
- Business applications
- Production databases including SAP HANA, MS SQL Server, and IBM DB2
There are two types of provisioned IOPS SSD available io1 and io2. They come in a volume size of 4 TB to 16 TB with IOPS up to 64,000. The io2 is a new generation volume and offers consistent baseline performance up to 500 IOPS/GB compared to io1, which offers 50 IOPS/GB performance. Improving further on performance, AWS launched the “io2 Block Express" volume, which comes into volume sizes of 4 TB to 64 TB with IOPS up to 256,000
Throughput Optimized HDD
Throughput Optimized HDDs offer an excellent value providing a reasonable cost for workloads that call for high performance and have high throughput requirements. Typical use cases include these:
- Big data applications
- Log processing
- Streaming applications
- Data warehouse applications
Throughput optimizes HDD, also known as st1, comes in volume size 125 GB to 16TB with 500 IOPS per volume.
Cold HDD
This type of storage is normally used for applications that require optimizing costs with large volumes of data—typically, data that needs to be accessed infrequently. Cold HDD also goes by sc1 and comes in volume size 125 GB to 16TB with 250 IOPS per volume.
You can learn more details for each volume by visiting AWS documentation -https://aws.amazon.com/ebs/volume-types/.
IMPORTANT NOTE
This would be a good time to note the following. EC2 instances are virtualized, and there isn't a one-to-one relationship between servers and EC2 instances. Similarly, when you use EBS storage, a single physical storage device is not assigned to you by AWS; instead, you get a slice of several devices that store the data in a distributed fashion across data centers to increase reliability and availability.
In addition, Amazon Elastic Block Storage (EBS) volumes are replicated transparently by design. Therefore, it is unnecessary to provide extra redundancy by setting up RAID or other redundancy strategies.
Amazon EBS volumes are by default highly available, durable, and reliable. This redundancy strategy and multiple server replication are built into the base price of Amazon EBS volumes. Amazon EBS volume files are mirrored across more than one server within an Availability Zone (AZ). This will minimize data loss. More than one device will have to fail simultaneously for data loss to occur. Amazon EBS volumes will also self-heal and bring in additional healthy resources if a disk fails.
Amazon EBS volumes offer at least twenty times more reliability than traditional commodity devices.
Amazon EBS Snapshots
Amazon EBS also provides a feature to quickly and automatically create snapshots. The backups of data volumes can be performed incrementally. For example, if you have a device with 100 GB of data, the first day the snapshot is created, the snapshot will have to reflect all 100 GBs. If, the next day, 5 GB of additional data are added, when the next snapshot is taken, EBS is smart enough to realize that it only needs to account for the new data. It can use the previous snapshot with the latest backup to recreate the full picture. This incremental snapshot strategy will translate into lower storage costs.
Snapshots can be compressed, mirrored, transferred, replicated, and managed across multiple AWS AZs using the Amazon Data Lifecycle Manager.
Amazon EBS snapshots are stored as Amazon S3 objects. Amazon EBS snapshots are accessed using the Amazon EBS API, and they cannot be accessed directly by users. Snapshots are stored as Amazon Machine Images (AMIs), and therefore, they can be leveraged to launch an EC2 instance.
While optimizing the cost, the first place to look into unused EBS snapshots. People often take EBS snapshots even for the dev/test environment and never access them, causing additional costs. You should always use lifecycle management to delete unused EBS Snapshots as needed. For example, you can set up a policy to delete any EBS snapshot tagged as dev/test and older than six months.
This wraps up what we wanted to say about the Amazon EBS service. Now, let's move on and learn about another important service—Amazon Elastic File Storage.