4.2.2. Amazon EBS for Persistent Storage
š” First Principle: Amazon EBS provides persistent block storage for EC2 instances, ensuring data durability, consistent performance, and flexibility for operational needs like scaling and backups.
Scenario: You need to attach persistent storage to your production EC2 instances for critical application data. This data needs to be durable, performant (high IOPS), and regularly backed up for disaster recovery.
Amazon Elastic Block Store (EBS) provides persistent block storage volumes for use with Amazon EC2 instances. For SysOps Administrators, EBS is essential for applications requiring durable, high-performance storage that is attached to a single EC2 instance.
Key Operational Uses of Amazon EBS:
- Boot Volumes: The primary volume attached to an EC2 instance that contains the operating system.
- Data Volumes: Additional volumes attached to EC2 instances for application data, databases, or log files.
- Snapshots: (Point-in-time backups of EBS volumes stored in Amazon S3.) Crucial for backup, disaster recovery, and creating new volumes or AMIs.
- Volume Types: (gp3, io2, st1, sc1) SysOps Administrators select the appropriate volume type based on IOPS, throughput, and cost requirements.
- Encryption: Seamlessly encrypts EBS volumes and their snapshots using AWS KMS.
- Resizing Volumes: You can modify volume size and IOPS/throughput dynamically without detaching the volume or stopping the instance.
ā ļø Common Pitfall: Not taking regular EBS snapshots, leaving data vulnerable to loss if the volume becomes corrupted or deleted.
Key Trade-Offs: Performance (e.g., io2 for high IOPS, higher cost) versus cost (e.g., sc1 for cold HDD, lower cost).
Practical Implementation: Creating an EBS snapshot via CLI:
aws ec2 create-snapshot --volume-id vol-0abcdef1234567890 --description "Daily backup of app data"
Modifying an EBS volume to increase IOPS:
aws ec2 modify-volume --volume-id vol-0abcdef1234567890 --iops 3000
Reflection Question: How does Amazon EBS, by providing persistent block storage with various volume types (e.g., io2
for high IOPS) and supporting snapshots for backups, ensure data durability, consistent performance, and flexibility for your operational needs?