This is the second article in my AWS series, where I share what I’m learning about AWS. The previous article introduced EC2, AWS’s virtual machine offering. In this article, I’ll discuss some storage options that can be used with EC2 instances.
- EC2 Fundamentals
- This article
AWS offers a range of solutions for Object, file and block storage. In this post, I’ll cover Block storage, Instance storage, machine images and EFS.
Elastic Block Store (EBS)
EBS is like a network drive that you attach to instances while running. It allows your EC2 instances and applications to persist their data, which can be quickly detached from one instance and attached to another. This is good for doing failovers. EBS volumes are locked to an Availability Zone(AZ) and can’t technically be moved between zones. To “move” an EBS volume between zones, you’d have to create a snapshot of it in one AZ and use it to create a new volume in a new AZ.
EBS volumes must be provisioned in advance for capacity; AWS allows you to provision their size in GB and their speed in IO Operations Per Second(IOPS). Multiple EBS volumes can be attached to a single EC2 instance.
Elastic Block Volumes come in three types: SSD, Provisioned IOPS SSD and HDDs.
SSD storage is ideal for general-purpose storage setting up dev and test environments and can be used for applications such as virtual desktops, boot volumes and medium-sized databases. You can expect speeds of up to 250Mb/s or 3000 IOPS on these drives.
These are for critical business applications that require sub-millisecond latency, sustained IOPS performance in excess of 16000 IOPS and multi-attach.
AWS offers storage on traditional Hard Disk Drives, too. This is the most affordable storage type and ideal for storing lots of data for long periods.
Snapshots allow you to make a backup of your EBS volume at a point in time, and they can be copied across Availability Zones or regions. AWS offers an affordable snapshot archive storage service that allows you to store infrequently accessed snapshots for a long time. The service is roughly 75% cheaper than using a traditional EBS volume, but the downside is that it takes between 1 and 3 days to restore the snapshots when needed. If you need a faster turnaround time to access snapshots, AWS offers Fast Snapshot Restore (FSR) service that is more expensive than archive storage.
AWS also offers a recycle bin for snapshots that you can use to recover deleted snapshots.
Amazon Machine Image (AMI)
AWS offers Amazon Machine Images (AMI), images or snapshots containing the information required to start an instance. An AMI allows you to customise your instance by creating an image with all the tools you need prepackaged and installed. You have three options on where to get AMIs; the first is to make your own AMI and upload it to AWS or to use the Amazon-provided ones, or buy one from the AWS marketplace.
AWS EC2 Instance Store
Unlike EBS, instance store stores data on the hard drive of the server that your instance runs on. This type of storage is much faster than EBS and has lower latency. The downside is that it is ephemeral, meaning it isn’t permanent. The data stored in instance storage gets lost when the server fails or the instance is terminated or rebooted, making it good for temporary storage for things such as buffers, caches, temporary files and for applications that need high-speed IO.
AWS Elastic File System (EFS)
EFS is a managed file system that can be mounted to EC2 instances without any setup. The file system is scalable and costs more than Block Volume storage. It is compatible only with Linux instances and won’t work on Windows. Data stored on EFS is encrypted at rest using KMS and scales automatically.
This post covered some storage options that can be used with EC2 instances. In the next post, I’ll talk about load balancers.