AWS EC2 Storage
Tags: aws, ami, ebs
Published: 2023-08-31 07:00:46

---
title: AWS EC2 Storage
published: true
date: 2023-08-30 08:41:02 UTC
tags: AWS,ami,aws,ebs
canonical_url: https://vuyisile.com/aws-ec2-storage/
---

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 can attach to instances while they run. It allows your [EC2 instances](https://dev.to/vndlovu/aws-ec2-fundamentals-4pbc)and applications to persist their data, and they can be detached from one instance and attached to another quickly. 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 the snapshot 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.

### Volume Types

Elastic Block Volumes come in three types; SSD, Provisioned IOPS SSD and HDDs.

**SSD storage**

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.

**Provisioned SSD**

These are for critical business applications that require sub-millisecond latency, sustained IOPS performance in excess of 16000 IOPS and multi attach.

**HDDs**

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

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](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-archive.html) storage service which 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 down side is that it takes anywhere between 1 and 3 days to restore the snapshots when you need them. 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) which are images or snapshots that contain information required to start an instance. An AMI allows you to customise your own instance by creating an image that has 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 requiring 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 it scales automatically.