Making Sense of AWS EC2 Instance Types

Which one to choose from?

Introduction

AWS Elastic Compute Cloud (EC2) is a powerful and flexible service that allows you to run virtual machines in the AWS cloud. One of the key features of EC2 is the ability to choose from a wide variety of instance types that are optimized to fit different use cases, each with different combinations of CPU, memory, storage and networking. But with so many options, it can be daunting to know which one to choose.

In this article, I'd like to continue on my previous article about EC2 pricing, but this time, we'll take a closer look at the different instance type families available, as well as some example use cases based on my experience as a software developer.

General Purpose

First, let's start with the general purpose instance type family. This family includes the t3, m5 and m5a instances, which are great for a wide variety of workloads. They offer a balance of CPU, memory, and storage. These types of instances are great for applications that use these resources equally. You can think of them as your go-to general-purpose choice, and this is my preferred choice when I'm exploring the waters with a new application that has no specific compute-intensive requirements. This is a good choice for web servers, small databases, and development environments.

One example use case I've used this instance type family for is hosting a small web application for a local business, the m5.large instance type was sufficient to handle the traffic and the storage was enough to handle the database.

Compute Optimized

Next, there's the compute optimized instance type family. This family includes the c5, c5n, and c5a instances, which are optimized for compute-intensive workloads. They have a higher ratio of CPU to memory, making them a good choice for high-performance computing, scientific simulations, and machine learning.

I've used the c5.large for a project which was running Machine Learning models, this instance type was able to handle the heavy computation and resulted in faster results.

Memory Optimized

The memory optimized instance type family includes the r5, r5a, and r5ad instances. These instances are optimized for memory-intensive workloads, such as in-memory databases, high-performance computing, and large data processing.

I've used the r5.large to host a Redis in-memory cache for a project, this instance type was able to handle the high memory requirements and resulted in faster query results.

Storage Optimized

Finally, there's the storage optimized instance type family, which includes the i3, i3en, and d2 instances. These instances are designed to handle storage-intensive workloads that require high, sequential read and write access to large datasets, such as big data processing, log analysis, and data warehousing. These are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.

Some example use cases for this instance type are: running a large data warehousing system, and large relational and NoSQL databases.

Conclusion

In conclusion, AWS EC2 offers a wide variety of instance types to choose from, each with its own unique combination of CPU, memory, storage and networking. By understanding the pros and cons of each instance type family, you can select the best one for your workload, whether it's a general-purpose web server, a compute-intensive machine learning workload, a memory-intensive in-memory database, or a storage-intensive data warehousing system. AWS continuously adds new and improved instance types, for more details about the specific instances you can refer to AWS Instance Types documentation.