AWS Bites Podcast

117. What do EBS and a jellyfish have in common?

In this episode, we provide an overview of Amazon EBS, which stands for Elastic Block Storage. We explain what block storage is and how EBS provides highly available and high-performance storage volumes that can be attached to EC2 instances. We discuss the various EBS volume types, including GP3, GP2, provisioned IOPS, and HDD volumes, and explain how they differ in performance characteristics like IOPS and throughput. We go over important concepts like IOPS, throughput, and volume types so listeners can make informed decisions when provisioning EBS. We also cover EBS features like snapshots, encryption, direct API access, and ECS integration. Overall, this is a comprehensive guide to understanding EBS and choosing the right options based on your workload needs.

AWS Bites is brought to you by fourTheorem, an AWS Partner that does CLOUD stuff really well. Go to fourtheorem.com to read about our case studies!

In this episode, we mentioned the following resources.

Let's talk!

Do you agree with our opinions? Do you have interesting AWS questions you'd like us to chat about? Leave a comment on YouTube or connect with us on:

00:02:40

And that's just for a single volume. So you can also have multiple volumes and you can even use things like RAID to create arrays of volumes. You can also easily change volume types. So you've got elastic options with EBS as well. You can change the type, the size, as well as other features. Volumes can even be resized dynamically without any downtime on attached instances, which is pretty cool. Now they're encrypted. And one of the amazing things about them is that they're encrypted without that encryption incurring any performance impact. Because of their design, they also have a reduced failure rate when compared to physical disk drives, typically, which is something that is really an advantage when it comes to choosing EBS over a traditional physical medium in a data center. And they're highly available within an AZ. And I think that's one of the important things to understand about EBS volumes. They are related to availability zone. Within that AZ, there is redundancy when it comes to the storage and failure of components of the EBS volume, but they're still within one availability zone. So if you want to make them more resilient, you can do that by taking EBS snapshots. And these are backed by S3. So then they're stored in multiple AZs. Another point to mention is that we're talking about EC2. EBS volumes are of course also used by RDS for storage. So when you're creating databases in RDS, you will choose EBS volume types when you're creating them. It doesn't apply to Aurora because Aurora has its own very special storage mechanism, which we might talk about in another future episode. One of the neat features of EBS is snapshots. And we just referred to them there, but it's worthwhile going into them in a bit more detail. What do you think?

00:05:45

Snapshots can also be archived, which is something that can be convenient when you don't expect to necessarily access that snapshot frequently, maybe just for extra peace of mind. That will help you to reduce the cost. So you just take the snapshot, archive it, and it's going to be there for 90 days or more, for example. So apart from attaching an EBS volume, is there any other way to access the data? You might be wondering, okay, is that the only use case? There is actually a very interesting API that is something that I came across only very recently. So it's a little bit of something that is not necessarily well known to everybody, and it's what is called the direct API. We will have a link in the show notes with all the documentation, some examples, but generally speaking, it's kind of a lower level API that allows you to access directly the EBS snapshot data, so without having to mount a volume into an EC2 instance. And this is probably a bit of a niche use case that is used maybe if you are a vendor that wants to provide some kind of backup, DR kind of extra facility, they can use this approach to be very efficient in the way they can access the data and read and write data directly into EBS snapshot data. You don't necessarily have to create volumes. That's kind of the idea. So if you have a use case where you want to control the data directly and you might do that at large volumes, this might be an API worth exploring a little bit more. It will come at a lower price. That's kind of the idea. We mentioned that EBS itself is a bit of a technical wonder in AWS. So what is this magic? How does it work under the hood?

00:07:59

This cellular database design is known as Physalia after the Latin name for the Portuguese Man o' War. So the Portuguese Man o' War is, it looks like a jellyfish, but it's not technically a jellyfish because it's not a single animal, but a colony of millions of individual organisms. So I guess the team thought that this was a good fit for the Physalia EBS architecture, which is built basically on a colony of individual distributed database cells. So it's difficult to really wrap your head around the idea that this high performance storage system is actually backed by millions of tiny distributed databases that give you durability, high availability and consistency that you need. And if you have a look at that paper, like a lot of distributed systems papers, it'll talk about the CAP theorem, which is the famous theorem that it describes in a distributed system, you can have two out of the three when it comes to consistency, availability, and partitioning. Now consistency and partitioning are non negotiable in the context of EBS, you have to have consistency when it comes to block storage. And the architecture basically just optimizes to achieve the maximum possible value of the third one, which is availability. So it's they're just essentially achieving availability with a very high probability, which is the best trade off you can achieve for a system like this. Now you often hear AWS people talking about the nitro system, which is their custom, very extensive hardware that underpins a lot of the modern AWS infrastructure. And this the nitro system actually has specific features built into it to facilitate EBS volumes. And to enable this encryption, we talked about without having any performance overhead, you might also have heard of EBS optimized easy to instances, because it's a network based file system, these instances actually have dedicated bandwidth, so they give you more guarantees around the bandwidth you have when accessing EBS. So that's as much I think, as I can say about the internals of EBS, feel free to check out the paper if that kind of thing floats your boat. When it comes to actually using them as an end user, though, one of the things I find is that if you're not used to EBS, suddenly, all you want is a disk, but you're confronted by all these different terms that seem very confusing. And there's a lot of different options. And people talk about IOPS, and it's very easy to get lost and confused. So should we try and do our best to explain these concepts at least at a high level without boring everybody to death?

00:11:47

Just always be aware of cost. Don't just push that to the maximum because you might end up just paying a lot of money for something that you don't really need to use. So instead, what are volume types? This can be a little bit confusing because there are many different options, but let's try to cover the broad categories and how to think about them so that you can choose somewhat consciously. So you have one category of volume type, which is basically SSD, so solid states, like, I don't know, the flash memory that you have in your phone, or probably if you have a very modern laptop, they will have some kind of SSD inside. Then the other option is HDD, so the old school spinning mechanical disks. It's another option and there are slightly different trade-offs in terms of performance and cost, but you can make this option. With SSD, you have general purpose SSD and provision IOPS types. So this is a kind of a subcategory when you pick SSD. Then if you go with HDD, you can pick either throughput optimized or called HDD. Now again, we might kind of deep dive a lot more, but let's just try to keep it high level. And we will put a link in the show notes about some pricing examples that are part of the official documentation when it comes to pricing to really understand how these different choices will affect pricing. Again, the pricing model as sometimes happens with AWS is not very linear. Depending on the choices, it changes the formula. So I think the examples are a very good way to try to figure out some common use cases and how to think about pricing for those specific use cases. Eoin, do you want to try to give us a little bit of a more complete overview on what the types are and how to think about them?

00:18:51

That basically means that when you create a volume, that single volume can be attached to multiple EC2 instances. And there is a limit, of course, and the limit is 16 EC2 instances, which basically means that you can share data in a volume across 16 different machines. Only works with provision IOPS though, so you basically are forced to use IO1 or IO2 if you want to use this particular feature. And of course, it's something that you need to use carefully because you know that reading and writing from different machines in the same disk might create consistency problems. So one way to avoid those consistency problems is to use a file system that is designed for this particular use case, like a cluster or file system. So don't just go for the standard Linux one like ext or XFS because these ones might not guarantee you any consistency. There are of course other options if you want to do something like this. Probably you are thinking about NFS or EFS on AWS or maybe FSX, and these are designed for sharing data across many devices. So probably these are more scalable options. Generally speaking, they might be more suitable for this kind of use case, but we thought it was worth mentioning the idea of multi-attachment. Maybe for specific use cases, you maybe have a cluster of a few machines, it might be an easy way to just be able to share information across these machines. And the last thing that I want to mention is that there is ECS support, which basically means that you can configure your tasks or services to create EBS volumes when they are launched or deployed, but you cannot attach an existing EBS volume. The thing that you could do is that you could do a snapshot and then you can create an EBS volume from a snapshot. So again, in the use case where you might have datasets that you have created before and you want to be able to consume those datasets from an ECS cluster, this could be one way of giving your cluster access to that data. And of course, this works in Fargate too, so something to be aware. And this is everything we have on this Jellyfish EBS episode, so hopefully you enjoyed all of that and you find it valuable. But of course, don't forget that if you don't clean up your old volumes as snapshots, you are going to get stung! So thank you very much for being with us and we'll see you in the next episode.

Help us to make this transcription better! If you find an error, please submit a PR with your corrections.