Cloud Computing Storage with AWS
AWS EBS Volume
An EBS (Elastic Block Store) Volume is a network-attached storage device that can be attached to an EC2 instance. It's like a virtual hard drive that persists data even after the instance is terminated. This allows you to recreate instances and access your data seamlessly.
- Single Instance Attachment: An EBS Volume can only be attached to one instance at a time.
- Availability Zone Binding: EBS Volumes are locked to a specific Availability Zone.
- Network-Based: EBS Volumes communicate with instances over the network, which might introduce slight latency.
- Detach and Attach: You can quickly detach and attach EBS Volumes to different instances, making them ideal for failover scenarios.
- Capacity Provisioning: You need to specify the desired capacity in GB and IOPS (Input/Output Operations Per Second) when creating an EBS Volume.
- Delete on Termination: This attribute controls whether an EBS Volume is deleted when its associated instance is terminated. By default, root volumes are deleted, while additional volumes are preserved.
What is Snapshot?
EBS Snapshot is a point-in-time backup of your EBS volume. You can create snapshots without detaching your volume from your EC2 instance, but it's recommended for optimal performance.
- Cross-Region and Cross-AZ Copies: Easily copy snapshots across different Availability Zones or even Regions.
- EBS Snapshot Archive: Reduce storage costs by moving infrequently accessed snapshots to a cheaper archive tier. Note that restoring archived snapshots can take 24-72 hours.
- EBS Snapshot Recycle Bin: Prevent accidental deletion of snapshots. You can recover them from the Recycle Bin within a specified retention period (1 day to 1 year).
- Fast Snapshot Restore: Quickly initialize large snapshots for immediate use. However, this feature can be costly.
AMIs: Your EC2 Instance's Blueprint
Amazon Machine Images (AMIs) are the foundation for launching EC2 instances. They encapsulate the operating system, software configurations, and other settings needed to run your applications.
Types of AMIs:
- Public AMIs: Provided by AWS, like Amazon Linux 2.
- Private AMIs: Created and managed by you. They offer faster boot times and tailored configurations.
- AWS Marketplace AMIs: Third-party AMIs, often pre-configured with specific software or tools.
Creating Your Own AMI:
- Launch an EC2 instance: Customize it with your desired software and settings.
- Stop the instance: Ensures data integrity.
- Create the AMI: This process involves taking EBS snapshots of the instance's storage.
Boost Your Instance Performance with EC2 Instance Store
Want to supercharge your EC2 instances? Consider using EC2 Instance Store for lightning-fast disk performance!
What is EC2 Instance Store?
- Hardware-backed storage: Directly attached to the physical server hosting your EC2 instance.
- Blazing-fast I/O: Delivers exceptional read and write speeds, ideal for demanding workloads.
When to Use EC2 Instance Store:
- High-performance applications: Perfect for applications that require rapid data access and processing.
- Temporary storage: Ideal for caching, buffering, and storing temporary data.
Important Considerations:
- Ephemeral storage: Data stored on Instance Store is lost when the instance is stopped or terminated.
- Risk of data loss: If the underlying server fails, data on Instance Store may be compromised.
- Backup and replication: Implement robust backup and replication strategies to protect your data.
EBS Volume Types: A Quick Guide
- General Purpose SSD (gp2, gp3)
- gp2: Older generation, cost-effective for basic workloads.
- gp3: Newer generation, offers more flexibility with independent IOPS and throughput scaling.
- Provisioned IOPS SSD (io1, io2)
- io1: High-performance for critical workloads.
- io2: Ultra-high performance for demanding applications, offering sub-millisecond latency and high IOPS.
- Magnetic HDD (st1, sc1)
- st1: Throughput-optimized for big data and log processing.
- sc1: Cold HDD for infrequent access, offering the lowest cost.
Key Points:
- Boot Volumes: Only gp2, gp3, io1, and io2 can be used as boot volumes.
- IOPS and Throughput: Understand the difference between linked and independent scaling.
- Workload Matching: Choose the right volume type based on your specific workload needs.
- Cost-Performance Trade-off: Balance cost and performance requirements when selecting a volume type.
EBS Multi-Attach: A Powerful Tool for High Availability
This feature allows you to attach a single EBS volume (specifically io1 and io2) to multiple EC2 instances within the same Availability Zone. This means that multiple instances can simultaneously read and write to the same high-performance volume.
Key Benefits of Multi-Attach:
- Enhanced High Availability: Ideal for clustered Linux applications like Teradata.
- Improved Performance: Leverages the power of high-performance EBS volumes.
- Flexible Deployment: Supports concurrent read and write operations.
Important Considerations:
- Availability Zone Limitation: Multi-Attach is confined to a single Availability Zone.
- Instance Limit: A maximum of 16 EC2 instances can be attached to a single volume.
- Cluster-Aware File System: Requires a specific file system designed for clustered environments.
Encrypting Your EBS Volumes: A Step-by-Step Guide
Want to bolster your AWS security? Encrypting your EBS volumes is a crucial step. Here's a breakdown of the process:
Understanding EBS Encryption
- Automatic Encryption: When you create a new, encrypted EBS volume, the data at rest, in transit, and in snapshots is automatically encrypted.
- Transparent Process: This encryption is handled seamlessly by AWS, requiring no additional configuration.
- Minimal Performance Impact: Encryption has a negligible impact on performance.
Encrypting Unencrypted EBS Volumes
- Create a Snapshot: Take a snapshot of your unencrypted volume.
- Encrypt the Snapshot: Use the "Copy Snapshot" function to create an encrypted copy.
- Create a New Volume: Create a new volume from the encrypted snapshot.
- Attach the Volume: Attach the new, encrypted volume to your instance.
Shortcut Method:
- Create a Volume from Snapshot: Directly create an encrypted volume from an unencrypted snapshot.
- Enable Encryption: During the creation process, select the "Enable encryption" option.
EFS: A Versatile and Scalable Network File System
Amazon EFS, a managed network file system (NFS), offers a highly available and scalable solution for storing and sharing data across multiple EC2 instances, even those in different availability zones.
Key Features of EFS:
- Scalability: Automatically scales to petabyte scale.
- Performance: Supports thousands of concurrent clients and high throughput.
- Flexibility: Choose from various performance modes and storage classes to optimize for different workloads.
- Cost-Effective: Pay-per-use model with options for cost-saving storage tiers.
- Security: Encrypted data at rest and access control through security groups.
- Compatibility: Works with Linux-based AMIs.
Use Cases - Content management, Web serving, Data sharing, WordPress
Performance and Storage Considerations:
- Performance Modes:
- General Purpose: Default for latency-sensitive workloads.
- Max I/O: High throughput for big data and media processing.
- Bursting: Balanced performance with burst capacity.
- Provisioned: Fixed throughput regardless of storage size.
- Elastic: Automatically scales throughput based on workload.
- Storage Classes:
- Standard: For frequently accessed files.
- EFS-IA: For infrequent access files.
- Archive: For rarely accessed data.
EBS vs. EFS: A Quick Guide
EBS Volumes
- Single-Instance Attachment: Primarily attached to one instance at a time, except for specific high-performance volume types.
- AZ-Locked: Cannot be migrated between Availability Zones without snapshotting and restoring.
- IO and Storage Scaling: Varies by volume type, with some offering independent scaling of IO and storage.
- Backup Considerations: Backups consume IO, so avoid during peak traffic.
- Termination Behavior: Default termination of route tables upon instance termination, but can be disabled.
EFS File Systems
- Network-Based: Can be mounted by multiple instances across multiple Availability Zones.
- POSIX Compliance: Well-suited for Linux-based applications like WordPress.
- Higher Cost: More expensive than EBS, but offers storage tiers for cost optimization.
- No Instance-Level Persistence: Data is not tied to a specific instance; it persists independently.
[1]: Stephane Maarek, AWS Certified Solutions Architect Associate Certification SAA-C03