What is Amazon EBS?

EBS vs Instance Store,

Amazon Elastic Block Store (Amazon EBS) – Deep Dive

Amazon Elastic Block Store (EBS) is a high-performance block storage service provided by AWS for Amazon EC2 (Elastic Compute Cloud) instances. It offers persistent, high-availability, low-latency storage that can be attached to EC2 instances, making it ideal for databases, file systems, containerized applications, and big data analytics.


1. Key Features of Amazon EBS

a) Persistent Storage

  • Unlike instance store volumes (which are ephemeral and lost when an EC2 instance is stopped/terminated), EBS retains data even if the instance is stopped or restarted.

b) Scalable and Elastic

  • EBS volumes can be increased in size, changed in type, and even modified without downtime.
  • Supports up to 64 TiB per volume.

c) High Availability and Durability

  • Data is automatically replicated within an Availability Zone (AZ) to prevent data loss.
  • Provides 99.999% availability.

d) Performance Optimization

  • Offers provisioned IOPS (IO1, IO2) for high-speed transactions (ideal for databases).
  • Uses SSD or HDD-based storage depending on use case.

e) Backup and Disaster Recovery

  • Provides EBS Snapshots, which are incremental backups stored in Amazon S3.
  • Snapshots can be copied across regions for disaster recovery.

2. Amazon EBS Volume Types

EBS volumes come in different types, categorized into SSD-based (high-performance) and HDD-based (cost-effective for sequential workloads).

A) SSD-based Volumes (High IOPS & Low Latency)

  1. gp3 (General Purpose SSD)
    • Baseline performance: 3,000 IOPS and 125 MB/s throughput.
    • Can scale up to 16,000 IOPS and 1,000 MB/s.
    • More cost-effective than gp2.
  2. gp2 (General Purpose SSD)
    • Baseline IOPS depends on size (3 IOPS per GiB).
    • Max 16,000 IOPS, but burstable.
    • Being replaced by gp3.
  3. io1 & io2 (Provisioned IOPS SSD)
    • High-performance storage for critical applications.
    • Supports up to 256,000 IOPS.
    • io2 is more durable (99.999% durability).

B) HDD-based Volumes (High Throughput & Cost-effective)

  1. st1 (Throughput Optimized HDD)
    • 500 MB/s max throughput.
    • Used for big data, log processing, and streaming workloads.
  2. sc1 (Cold HDD)
    • 250 MB/s max throughput.
    • Lowest cost, ideal for cold storage and backups.

3. How EBS Works with EC2

a) Creating and Attaching an EBS Volume

  1. In the AWS Console, navigate to EC2 → Elastic Block Store → Volumes.
  2. Click “Create Volume”, choose type, size, and availability zone.
  3. Attach it to an EC2 instance and mount it using Linux (/dev/xvdf) or Windows (disk management).

b) Resizing an EBS Volume

  • Modify an EBS volume’s size, performance, or type without stopping the instance.
  • Use resize2fs (Linux) or extend-volume (Windows) after modification.

c) Creating EBS Snapshots

  • Use Create Snapshot to back up an EBS volume to Amazon S3.
  • Snapshots are incremental—only changes are stored, reducing costs.

4. EBS vs Instance Store

FeatureEBSInstance Store
PersistenceYes (Data persists after EC2 stop/terminate)No (Data lost on EC2 stop/terminate)
PerformanceConsistent IOPS & throughputBetter performance, but volatile
DurabilityHigh (AZ-redundant replication)No durability (locally attached disk)
Use CasesDatabases, containers, app serversTemporary caches, buffers, scratch data

5. EBS Pricing

  • Pay-as-you-go: Charged based on provisioned storage (GB per month) and IOPS.
  • Snapshots are charged separately for data stored in S3.

6. Best Practices for Using Amazon EBS

a) Performance Optimization

  • Use gp3 instead of gp2 for cost efficiency.
  • For high-performance workloads, use io2 volumes with multi-attach support.

b) Cost Management

  • Delete unused EBS volumes to avoid unnecessary charges.
  • Enable compression/deduplication at the OS level to save space.

c) Backup and Recovery

  • Automate backups using AWS Backup or Lifecycle Policies for EBS snapshots.
  • Copy snapshots across regions for disaster recovery.

d) Security

  • Enable encryption (AWS KMS) for compliance and data protection.
  • Use IAM policies to control access.

7. Common Use Cases

  1. Databases (MySQL, PostgreSQL, Oracle, MongoDB)
    • Use io2 volumes for high IOPS & low latency.
  2. Big Data & Analytics (Apache Spark, Hadoop)
    • Use st1 volumes for high-throughput workloads.
  3. Containers & Kubernetes Storage
    • Attach EBS volumes to EKS pods.
  4. File Systems (Amazon FSx, NFS)
    • Use gp3 for general-purpose workloads.

8. Conclusion

Amazon EBS is a reliable, high-performance, and scalable block storage solution for EC2 instances. With different volume types catering to various workloads, EBS provides persistent storage, automatic backups, and seamless performance scaling.

Would you like a step-by-step hands-on guide on setting up EBS with EC2? 🚀 Contact us to know more

About Anant 413 Articles
Senior technical writer