From the course: AWS: Storage and Data Management

Elastic Block Storage

- [Instructor] When you create an EC2 instance, you're asking AWS to start a virtual server for you. Although it's sometimes easy to forget, this takes place on actual hardware, somewhere deep in Amazon's data center facilities for that availability zone. Of course, a virtual machine is simply a way of giving you a virtualized slice of what's on the underlying hardware. A bit of the CPU, some of the RAM, et cetera. So in the beginning, if you needed hard drive space you'd use what's called instant storage, a slice of the hardware's disk drive. Instant storage uses the disk attached to the instance's hardware. It has lowest possible latency, survives reboots, and is suitable for ephemeral storage. It might be disk-based or SSD-based. Now, having said that it does not persist when the instance is stopped, although reboots are fine. It cannot be encrypted and it's not part of a snapshot taken for an AMI. It cannot be detached or backed up on its own and it has a fixed size tied to the instance size. In short, instance storage is good for temporary uses like caching but its overall usefulness is limited. Enter AWS's Elastic Block Store, or EBS. EBS is network-attached storage, meaning that it has a lifecycle separate from the instance to which it's attached. If the instance is stopped or even fully terminated, the EBS volume lives on. This feature alone allows us to unlock the true elasticity of AWS Elastic Compute Cloud, or EC2, instances. It means that we can shut down or sleep instances when we don't need them, such as at night or after business hours. Since on-demand EC2 instances are charged hourly, this saves us money, and because EBS stays persistent, we can pick right back up where we left off the next day. Since EBS is network storage, it can then be detached from one instance and attached, even at runtime, to another instance, and the data persists. You can also attach multiple EBS volumes to a single instance, and unlike instance storage EBS can be grown on demand, giving you extra capacity when you need it. Just be aware that you will need to make the operating system aware of any capacity changes. EBS volumes can also be created as encrypted volumes. The encryption is seamless, invisible to you as the user of the attached EC2 instance, but impenetrable to anyone who might gain access to the volume without permission. What about reliability? Hard drives have a notorious failure rate, and with a vast number of hard drives AWS has deployed at any given time, failure is a certainty. The good news is that EBS is very reliable. Within its availability zone, an EBS volume is automatically replicated. This replication gives EBS five nines of availability, meaning you can expect about five minutes of downtime in a year. But we know that availability is not the same as durability, and disks are volatile. AWS advertises that EBS has an annual failure rate of between 0.1 and 0.2%, making EBS 20 times more reliable than the typical off-the-shelf disk which carries a failure rate about 4%. Of course, AWS gives you the tools to make sure that even those kinds of failures are not catastrophic. You can snapshot an EBS volume at any time. In fact, you can keep as many snaps as you like, creating them on a regular schedule, whatever satisfies your backup needs. Just be aware that your monthly bill will increase with the number of snapshots you keep in your account. Now, let's take a look at what it takes to create an EBS volume.

Contents