A Quick Overview of EC2 Storages

This blog is a part of my journey “Embarking on the AWS Solution Architect Associate SAA-CO3 Certification Journey”

Table of Content

  • Elastic Block Store (EBS)
    • Key Features
    • EBS Snapshot
    • EBS Encryption
    • Encrypting an Unencrypted EBS Volume
    • EBS Volume Types
    • EBS Multi-Attach
  • EC2 Instance Store
  • Amazon EFS (Elastic File System)

Amazon Web Services (AWS) provides a plethora of storage options to meet diverse application needs. Among these, Elastic Block Store (EBS) plays a pivotal role in enabling data persistence for your Amazon Elastic Compute Cloud (EC2) instances. In this comprehensive guide, we’ll delve into the world of EBS, EBS snapshots, EFS, and understand the nuances that differentiate them.

Elastic Block Store (EBS)

Key Features

  • EBS volumes are like network drives that can be attached to your running EC2 instances, ensuring your data persists even after instances are terminated.
  • Each EBS volume can be mounted to one EC2 instance at a time.
  • EBS volumes are bound to specific Availability Zones (AZs).
  • They use network communication with instances, which may introduce minimal latency.
  • EBS volumes can be detached from an instance and rapidly attached to another.
  • An EBS volume in one AZ cannot be attached to an instance in another. To move it, a snapshot is required.
  • Billing is based on provisioned capacity, which can be increased over time.
  • Multiple EBS volumes can connect to a single instance.
  • By default, the root EBS volume gets deleted upon instance termination, but you can configure it differently.

EBS Snapshots

  • EBS snapshots create backups of your EBS volumes at a specific point in time.
  • Although it’s recommended, you don’t need to detach a volume to create a snapshot.
  • Snapshots can be copied across Availability Zones (AZs) and regions.
  • Snapshots can be moved to an archive tier, which is cost-effective but takes 24 to 72 hours to restore.
  • Rules can be configured to retain deleted snapshots, specifying a retention period (1 day to 1 year).
  • FSR forces full initialization of a snapshot, eliminating latency on first use.

EBS Encryption

  • Creating an encrypted EBS volume ensures data at rest, data in flight between instances, all snapshots, and volumes created from those snapshots are encrypted.
  • Encryption and decryption are handled by AWS, minimizing latency impact.
  • EBS encryption leverages keys from AWS Key Management Service (KMS).

Encrypting an Unencrypted EBS Volume

  • First, create an EBS snapshot of the volume.
  • Encrypt the EBS snapshot using the copy function.
  • Generate a new EBS volume from the encrypted snapshot.
  • Finally, attach this EBS volume to the original instance.

EBS Volume Types

AWS offers six types of EBS volumes, each tailored for specific workloads:

  • General Purpose (SSD) – gp2/gp3: Balances price and performance for various workloads.
  • Provisioned IOPS (SSD) – io1/io2: Designed for mission-critical low latency or high throughput tasks.
  • Throughput Optimized (HDD) – st1: Ideal for frequently accessed, throughput-intensive workloads.
  • Cold HDD – sc1: Cost-effective for less frequently accessed workloads.

Note: Root EBS volumes are typically gp2/gp3 or io1/io2.

EBS Multi-Attach

  • Allows attaching the same EBS volume to multiple EC2 instances within the same AZ.
  • Each instance gets full read and write access to the high-performance volume.
  • Useful for achieving higher application availability in clustered Linux applications and managing concurrent write operations.
  • Limitations: Supported only for io1 and io2 volume types, and the file system must be cluster-aware.

EC2 Instance Store

  • EC2 instance store offers better IO performance compared to EBS volumes.
  • Data stored on instance store volumes is ephemeral, and data can be lost if the instance is stopped.
  • Use Cases: Suitable for buffering, caching, or temporary content where data loss risk is acceptable.
  • Developers are responsible for backup and replication.

Amazon EFS (Elastic File System)

  1. Amazon EFS is a managed Network File System that can be mounted on multiple EC2 instances.
  2. It is highly available and scalable, functioning across multiple Availability Zones.
  3. Use Cases: Commonly used for content management, web services, and applications like WordPress.
  4. It employs NFS 4.1 protocol for file access.
  5. Access to EFS is regulated using security groups.
  6. Compatible with Linux-based instances.
  7.  EFS supports encryption at rest using KMS.
  8. EFS is a POSIX-compliant file system with a standard file API.
  9. The file system scales automatically, eliminating the need for capacity planning.
  10. EFS offers two performance modes: General Purpose for latency-sensitive use cases and Max I/O for high throughput.
  11. Throughput can be set as Bursting, Provisioned, or Elastic, depending on workload needs.

In conclusion, understanding the nuances of AWS storage options, especially EBS, EBS snapshots, EFS, and their use cases, is crucial for optimizing data persistence, performance, and costs in your AWS environment. Each of these services offers distinct advantages tailored to specific application requirements.

Related Post