EBS
General Info¶
- Persistent Block-Level storage for EC2
- Automatically replicated within a single AZ (not across regions/zones)
- Multiple EBS can be attached to 1 EC2, but an EBS volume can only attach to a single instance at one time
- Use Cases
- Primary storage for DB
- Filesystem
EBS Volume Types¶
Name | Description | Use Cases | IOPS | Volume Size | THR |
---|---|---|---|---|---|
Standard HDD |
|
|
1GB - 1TB |
90MiB/s |
|
Cold HDD (sc1) |
|
250 |
500GB - 16TB |
250 MiB/s |
|
Throughput-optimised HDD (st1) |
|
|
500 |
500GB - 16TB |
500 MiB/s |
General-purpose SSD (gp2) |
|
|
16,000 |
1GB - 16TB |
128-250 MiB/s |
Provisioned IOPS SSD (io1) |
|
|
32,000 - 64,000 |
4GB - 16TB |
500-1000 MiB/s |
IOPS Performance - General Purpose SSD
Baseline 3 IOPS/GBprovisioned capped at 10k IOPS:
1TB --> baseline 3K IOPS
5TB --> hit cap at 10k IOPS
if <1TB can BURST to 3K IOPS:
500G --> baseline = 1,500 IOPS
when not used accumulated as credits
when heavy traffic --> up to 3K IOPS till credits depleted
Protecting Data¶
- Encryption
-
- Native in EBS with KMS (wrapped data key stored alongside volume)
- Transparent (same IOPS)
- Occurs on the servers that host the EC2 instance, so data is encrypted in transit and at rest
- Snapshots from encrypted volumes are automatically encrypted
ec2:CreateVolume
action paired withec2:Encrypted
condition key can enforce use of encrypted volumes
- Backup & Recovery
-
- Backup data by taking point-in-time snapshots (incremental backups)
- Set the root EBS volume to persist after instance termination:
DeleteOnTermination = false
- Data for snapshot
- Stored in S3 (AWS-controlled)
- Constrained in the original region
- To create (restore) in different region, 1st copy snapshot in that region
- Creating EBS volumes from snapshots
- Volume created immediately
- Data loaded lazily
- If data requested not restored yet → restored upon 1st request
- Best practice to access all blocks when initialising