What is EBS Volume in AWS

What is EBS Volume in AWS and its types ?

An Elastic Block Store– EBS Volume in AWS is a network drive you can attach to your instances while they run. It allows your instances to persist data.

  • It’s a network drive (i.e. not a physical drive)
  • It uses the network to communicate the instance, which means there might be a bit of latency.
  • It can be detached from an EC2 instance and attached to another one quickly
  • It’s locked to an Availability Zone (AZ)
  • An EBS Volume in us-east-1a cannot be attached to us-east-1b
  • To move a volume across, you first need to snapshot it
  • Have a provisioned capacity (size in GBs, and IOPS)
  • You get billed for all the provisioned capacity
  • You can increase the capacity of the drive over time

EBS Volume Types

EBS Volume in AWS come in 4 types as follows-

  1. GP2 (SSD):General purpose SSD volume that balances price and performance for a wide variety of workloads
  2. IO1 (SSD):Highest-performance SSD volume for mission-critical low-latency or high throughput workloads
  3. ST1 (HDD):Low cost HDD volume designed for frequently accessed, throughput intensive workloads
  4. SC1 (HDD):Lowest cost HDD volume designed for less frequently accessed workloads

AWS EBS Volume Types

EBS Volumes are characterized in Size | Throughput | IOPS (I/O Ops Per Sec)

Only GP2 and IO1 can be used as boot volumes.

Difference between EBS Volume Types in Amazon :

GP2(SSD) IO1(SSD) ST1(HDD) SC1(HDD)
gp2: General Purpose Volumes (cheap) io1: Provisioned IOPS (expensive) st1: Throughput Optimized HDD sc1: Cold HDD, Infrequently accessed data
Recommended For most workload. System boot volumes, Virtual desktops, Low-latency interactive apps, Development and test environments Critical application & large databases. Critical business applications that require sustained IOPS performance, or more than 16,000 IOPS per volume (gp2 limit)

Large database workloads, such as: MongoDB, Cassandra, Microsoft SQL Server, MySQL, hSQL, Oracle

Streaming workload requiring constant, fast throughput at low price.

Big Data, ware housing, log processing, apache kafka

Throughput oriented storage for large volume of data that is infrequently accessed.

Scenarios where lowest storage cost is important.

System boot volumes Cannot be a boot volume Cannot be a boot volume
1GiB-16 TiB 4 GiB – 16 TiB 500 GiB – 16 TiB 500 GiB – 16 TiB
3 IOPS / GiB, minimum 100 IOPS, burst to 3000 IOPS, max 16000 IOPS

1 GiB – 16 TiB , +1 TB = +3000 IOPS

Min 100 IOPS, Max 64000 IOPS (Nitro) or 32000 (other)

4 GiB – 16 TiB. Size of volume and IOPS are independent

500 GiB – 16 TiB , 500 MiB /s throughput 500 GiB – 16 TiB , 250 MiB /s throughput

EBS Snapshots:

It is Incremental – only backup changed blocks

EBS backups use IO and you shouldn’t run them while your application is handling a lot of traffic

Snapshots will be stored in S3 (but you won’t directly see them)

Not necessary to detach volume to do snapshot, but recommended

Max 100,000 snapshots can be taken.

Can copy snapshots across AZ or Region

Can make Image (AMI) from Snapshot

EBS volumes restored by snapshots need to be pre-warmed (using fio or dd command to read the entire volume)

Snapshots can be automated using Amazon Data Lifecycle Manager

EBS Migration:

EBS Volumes are only locked to a specific AZ but we can migrate it to a different AZ.

To migrate it to a different AZ (or region):

  • Snapshot the volume
  • (optional) Copy the volume to a different region
  • Create a volume from the snapshot in the AZ of your choice

EBS Encryption:

  • When you create an encrypted EBS volume, you get the following:
  • Data at rest is encrypted inside the volume
  • All the data in flight moving between the instance and the volume is encrypted
  • All snapshots are encrypted
  • All volumes created from the snapshot
  • Encryption and decryption are handled transparently (you have nothing to do)
  • Encryption has a minimal impact on latency
  • EBS Encryption leverages keys from KMS (AES-256)
  • Copying an unencrypted snapshot allows encryption
  • Snapshots of encrypted volumes are encrypted

Encryption: encrypt an unencrypted EBS volume

  • Create an EBS snapshot of the volume
  • Encrypt the EBS snapshot (using copy)
  • Create new ebs volume from the snapshot (the volume will also be encrypted)
  • Now you can attach the encrypted volume to the original instance

EBS vs Instance Store

Some instance do not come with Root EBS volumes. Instead, they come with “Instance Store” (= ephemeral storage)

Instance store is physically attached to the machine where as EBS is a network drive.

Pros:

  • Better I/O performance (EBS gp2 has an max IOPS of 16000, io1 of 64000)
  • Good for buffer / cache / scratch data / temporary content
  • Data survives reboots

Cons:

  • On stop or termination, the instance store is lost
  • You can’t resize the instance store
  • Backups must be operated by the user

Local EC2 Instance Store:

  • Physical disk attached to the physical server where your EC2 is
  • Very High IOPS (because physical)
  • Disks up to 7.5 TiB (can change over time), stripped to reach 30 TiB (can change over time…)
  • Block Storage (just like EBS)
  • Cannot be increased in size
  • Risk of data loss if hardware fails

 

EBS RAID Options

EBS is already redundant storage (replicated within an AZ). RAID is possible as long as your OS supports it. Some RAID options are:

  • RAID 0
  • RAID 1
  • RAID 5 (not recommended for EBS)
  • RAID 6 (not recommended for EBS)

Difference between RAID 0 and RAID 1:

RAID 0 RAID 1
Increase Performance Increase Fault Tolerance
Combining 2 or more volumes and getting the total disk space and I/O

But one disk fails, all the data is failed

RAID 1 = Mirroring a volume to another

If one disk fails, our logical volume is still working

We have to send the data to two EBS volume at the same time (2x network)

Use cases would be:

• An application that needs a lot of IOPS and doesn’t need fault-tolerance

• A database that has replication already built-in

Use case:

• Application that need increase volume fault tolerance

• Application where you need to service disks

Happy Learning !!

Related Posts:

Amazon Web Service – AWS Tutorial

Top 13 Reasons to Why Learn AWS in 2022

What is AWS EFS (Elastic File System) ?

What is Auto Scaling in AWS ?

What is Amazon API Gateway? Benefits, Features of Amazon API Gateway

AWS VPC – Amazon Virtual Private Cloud || Benefits & Components

300 AWS Interview Questions and Answers [2023]