EC2 Storage
Last updated
Last updated
There are lot of storage type in EC2 including 3 main type Network Drive
, Image
, Physical
For Network drive
It is a network drive you can attach to EC2 instance. There are 2 storage in EC2.
EBS (Elastic Block Storage)
EFS (Elastic File System)
It is a storage persisting data after instance termination. It is possible to attach multiple EBS to one EC2.It is network drive so it uses the network to comunnicate which mean there might be a bit of latency. Moreover you allow to create a snapshot for moving volume across AZ. This volume is specific AZ.
It is a backup of our EBS volume , for backup we did not need to detach volume from EC2 instance. To Move EBS volume to another AZ or Region , It is able to do by using this snapshots.
There are 3 features for EBS Snapshots
(1) Snapshot archive = Move snapshot toarchive tier
to less the cost. (24 to 72hours for restore time)
(2) Recycle bin = It deletes a snapshot and stores in recycle bin for 1 day to 1 year.
(3) Fast Snapshot Restore (FSR) = It is fast to restore snapshot but It is expensive.
There are 3 main type. Only gp2/gp3
and io1/io2
can be used as boot volumes.
General Purpose SSD
High Performance SSD
HDD
(1) General Purpose: including gp2/gp3
It is cost effective storage and low latency (Not Expensive) (***Not support Multi attach)
(2) High Performance SSD: including io1/io2
It is greate for DB workloads or application that need more perfomance.(***Support Multi attach)
(3) HDD including: scl
It is lowest cost of EBS and suitable for data that is infrequently accessed.
EC2 Multi Attach
This feature is only for io1/io2
EBS volume. (Make higher application availability in case that one application fail) (Only 16 EC2 instance at a time)
It is the feature to encrypt the EBS volume. It used encryption key from KMS (AES-256).
If you are not encrpt the volume , the snapshot will not be encrypt.
In case that you want to encrypt existing EBS Volume then you need to create the snapshot of that volume , encypt the snapshot and create new EBS volume from snapshot so you will get the EBS volume was encrypted.
Since it managed NFS (Network file system) that can be mounted on many EC2 across multi AZ. It is high availability , scale and expensive. This file system will scale automatically . To access EFS , it use security group to control it. It is compatible only Linux based AMI. It recommend to set Lifecycle policy to move file from EFS to EFS-IA (Storage tier) for cost saving. It used NFS protocol for communication.
content management
wordpress
For Image
In AWS it has something similar to Docker image to pack the EC2 to be image it call AMI
.
AMI are a customization of an EC2 instance. you can add own software ,configuration , OS etc.
It is fater boot because all your software is pre-packed. It built for specific region (can be copied across region) EC2 can launch AMI from (1) Public AMI (AWS provided) (2) Your own AMI (3) AWS marketplace AMI
For Physical
If you need a high-performance hardware disk, use EC2 instance store.
lose storage if it stop
better i/o performance
backup and replication are your responsibility
risk of data loss if hardware fail