DEV Community

Cover image for Amazon EBS - Primer
Prabusah
Prabusah

Posted on

Amazon EBS - Primer

Amazon Elastic Block Storage:

This is raw storage in storage devices such as Hard disk drives (HDDs), Solid state drives (SSDs) and Non-Volatile Memory Express (NVMe) that uses disk or volume.

HDD: Legacy technology. Data stored in spinning disks. Read/write speed of 80MB/s to 160 MB/s.
SSD: Data stored in integrated circuits. Read/write speed of 600 MB/s.
NVMe: Data stored in integrated circuits. Read/write speed of 3.5 GB/s.

Blocks and Volumes:

Disk or volume to be formatted as continuous blocks. Block - Fixed storage unit to store data. Volume - Block storage devices can be combined into larger logical units called volumes.

Components of Block storage:

Contains 3 components: Block storage, compute system and operating system (OS). Block storage attached to compute system. OS identifies the block storage and formats to make it ready for use.

AWS block storage:

Instance storage: Ephemeral (temporary) storage that is non-persistent and terminated when associated EC2 instance is terminated. Use for buffers, caches or other temporary content.

Amazon EBS storage: Persistent store. If an EC2 instance goes down, volume and data on volume remain available to attach to different EC2 instance.

Block storage service designed for use with Amazon EC2. EBS volumes suited for file systems, databases or any application that requires access to raw, block- level storage. Best for random reads/writes (DBs) and long, sequential, reads/writes as well.

Snapshots:

Point-in-time copies of data in EBS volumes. Backup from EBS to S3. Incremental copies (only blocks on EBS volumes that changed after most recent snapshot are saved).
Delete snapshot-only data unique to that snapshot removed.
Snapshot of encrypted volumes auto encrypted. Copy snapshots across Regions.

Snapshot Use Cases:

Host Microsoft Sharepoint, SAP, Exchange server etc. Bring your relational/non-relational DB into EBS attached to EC2. Bring your file system.

Amazon Data Lifecycle Manager (DLM):

DLM used to automate creation, retention and deletion of snapshots to backup your EBS volumes.

EBS Availability:

AWS auto replicates EBS volume within the AZ to prevent failure of single hardware component. But what if that AZ itself down? It is recommended to create snapshots of EBS volumes frequently. Snapshot replicated across all AZs within a Region. Snapshots can also be copied to other Regions.

EBS Types:

SSD: (gp2, gp1, io1, io2) and HDD: (st1, sc1).
iops: Input Output per second.
gp: general purpose;
io: Provisioned IOPS.
st1: Throughput Optimized HDD.
sc1: Cold HDD.

EBS Pricing:

Pay for Provisioned volume size, IOPS and throughput performance.
Snapshot Pricing: Actual amount of storage space consumed (not provisioned).

Basic Architecture:

An EC2 instance can have multiple EBS volumes (and different EBS volume types as well) attached. EC2 & EBS must reside in same AZ. Each EBS volume --> snapshots stored in S3 within same Region where EBS volume resides.

Advanced Architecture - Multi Attach:

Multiple EC2 instances connected to a single EBS volume. Data consistency to be managed by your application or OS environment. Multi-Attach supported only with Provisioned IOPS SSD (io1, io2) EBS volume types. EC2 & EBS must reside in same AZ. EC2 & EBS must reside in same AZ. Each EBS volume --> snapshots stored in S3 within same region where EBS volume resides.

Advanced Architecture-Striped volumes:

Multiple EBS volumes operate as single EBS volume attached to a single EC2 instance. EC2 & EBS must reside in same AZ. Each EBS volume--> snapshots stored in S3 within same Region where EBS volume resides.

Security:

IAM:

Policy created to allow users, groups, roles to access EC2 and EBS resources.

Encryption:

Occurs on servers that host EC2 instances, both data at rest and data in transit between EC2 and EBS are encrypted. Both encrypted/unencrypted volumes can be attached to an EC2 instance.
Data inside EBS volume, Data moving between EBS and EC2 instance. Snapshots created out of EBS volume and EBS volumes created out of snapshots-all can be encrypted.

AWS Backup:

Deploy backup policy across AWS accounts in Organization for services like EC2, EBS, RDS etc. Like snapshots AWS Backup also stores data backups of EBS in S3 bucket.
AWS Backup backups many services including EBS... whereas snapshot is to backup only EBS volume data. AWS Backup offers more features compared to snapshots.

AWS Compute Optimizer:

EBS sends data points (metrics) to Amazon CloudWatch. 1-minute metrics. Compute Optimizer uses Amazon CloudWatch metrics to analyze your EBS volumes and provide recommendations to assist you in optimizing your Amazon EBS costs.
(CloudWatch notifies events based on EBS changes like creation of volumes or snapshot etc.)

Image by lisa runnels from Pixabay

Top comments (0)