Amazon Elastic Block Store (EBS)
Persistent block storage volumes that store data after power is shut off (non-volatile). Pay for what is provisioned. Each volume is automatically replicated within the AZ to protect from component failure (expected that EC2 instance is in the same AZ). Can change configuration while in production (volume type/size, IOPS).
Block Storage → Faster and uses less bandwidth, costs more than object storage.
Difference between block storage and object storage (This affects throughput and latency).
Difference between block storage and object storage (This affects throughput and latency).
Snapshots are incremental backups of EBS Volumes → Backed in S3 and encrypted automatically (using KMS) and shareable between regions:
- Base Snapshot → First snapshot, captures all volume.
- Other Snapshots → Captures difference with previous snapshot.
- Amazon Data Lifecycle Manager (DLM) → Automate snapshots, their lifecycle, and EBS-based AMIs.
- ⚠️ Snapshots are asynchronous*,* you can use the volume during this process.
Encryption → ****No extra cost, encryption is in transit and at rest.
- Encryption can be achieved with own keys or Amazon-managed keys on KMS (does not support asymmetric CMKs).
- 🔒 Encryption by default → Region-specific setting, cannot disable it for individual volumes or snapshots in that region if enabled.
- Can only launch instances if the instance type supports EBS encryption.
Uses:
- Boot volume and storage for EC2 → Low latency as directly attached to EC2, best option for DB in EC2 instance.
- Data storage with file system.
- Database hosts.
- Enterprise apps.
Types
- SSDs → Only usable for EC2 root volumes (⚠️).
- General Purpose → Less performant than provisioned IOPs → Most use cases.
- ⚠️ Maximum ratio of provisioned IOPS to the requested volume size (in GiB) is 3:1 (3 IOPS per GB, 16k limit).
- Provisioned IOPs → Highest performance, highest cost → High velocity I/O per second.
- ⚠️ Maximum ratio of provisioned IOPS to the requested volume size (in GiB) is 50:1 (50 IOPS per GB, 64k limit).
- HDDs → Throughput-optimized.
- Cold → It has a minimum throughput.
- Throughput Optimized → Frequently accessed, throughput intensive workloads, large datasets, and large transfers.
- Magnetic → No throughput.
https://lh4.googleusercontent.com/pO630KcbMMqz6h_Ck0Lk0At4RzEhvC0NCi4lvXsQa0yf4FQbaAen9uycHf_JlY6cGZrsLjZmTZnE9BoVRSvQE9Y4fTdR5vQPA--ugWdJFSyH8u70lRLfLvkQxPhRk_0Vu8OK1y-z
Cost Optimization
- Volumes → Storage is charged for amount provisioned until released.
- IOPs
- General Purpose SSD and Provisioned IOPs SSD → Charged for what is provisioned until released.
- Magnetic → Charged per request.
- Snapshots → Cost per GB stored per month until deleted.
- Data Transfer → Charged for transferred data across regions.
Amazon Simple Storage Service (S3)
It's a key-based object storage, stored in buckets, virtually unlimited storage, with buckets named universally unique and a single object limit of 5 TB. Stored redundantly across different facilities. Data is private by default, and can be encrypted in transit and/or at rest. Stored in minimum 3 AZs at the same time.
- Scales automatically to handle high volumes of requests. Not billed for provisioning, only for usage. Data can be configured to replicate across regions also. Provides increased performance up to 3500 PUT/s and 5500 GET/s.
- Transfer Acceleration is used to accelerate transfers by using a CDN. To use it you have to activate it in the bucket and start using the accelerated endpoint (Source). Mainly used if you are uploading to a central location or usually upload GBs or TBs of data. Same security as standard transfers and supports multipart uploads. HIPAA and PHI eligible.