1Block vs Object
EBS is Block Storage. It behaves like a raw, unformatted hard drive. You install file systems on it (like ext4 or NTFS) and it can boot operating systems. S3, on the other hand, is Object Storage, accessed via APIs, and cannot run an OS.
2The Magic of Snapshots
Snapshots are incremental. If you have a 100GB volume and take a snapshot, it backs up 100GB. If you change 2GB of data and take another snapshot, the second snapshot only stores the 2GB difference, saving you massive amounts of money on backup storage.
3Step-by-Step Breakdown
What is EBS?. Amazon Elastic Block Store (EBS) provides block-level storage volumes for use with EC2 instances. Think of it as a virtual hard drive.
Persistence. Unlike Instance Store (temporary storage), EBS volumes persist independently from the life of an instance.
Availability Zone Bound. An EBS volume is tied to a specific Availability Zone (AZ). It can only be attached to instances in that same AZ.
Volume Types. AWS offers different types of EBS volumes depending on your needs: SSD (gp2/gp3, io1/io2) for fast random access, and HDD (st1, sc1) for large sequential workloads.
Snapshots. A snapshot is an incremental backup of your EBS volume stored in S3. It captures the state of the drive at a specific point in time.
Storage Check. If you want to attach an existing EBS volume to an EC2 instance, what restriction must you keep in mind?
- βMust be in the same Region
- βMust be in the exact same Availability Zone (AZ)
- βMust be the same size as the RAM
Moving Volumes. To move a volume across AZs or Regions, you must first take a Snapshot, and then create a new Volume from that snapshot in the target AZ/Region.
Encryption. You can encrypt EBS volumes at rest using AWS KMS. The encryption is transparent to the EC2 instance.
Delete on Termination. By default, the root EBS volume is deleted when the EC2 instance is terminated, but additional attached volumes are preserved. You can change this behavior.
Completion. You now understand how to persist and backup your data.
