AWS › EC2 & Compute

What are the main EC2 instance families, and how do you choose the right one for a specific workload?

Beginner

Answer

EC2 instance families are optimized for different types of workloads, including general purpose instances offering a balance of compute, memory, and networking for a wide variety of applications, compute optimized instances for CPU intensive workloads like batch processing, memory optimized instances for workloads like in memory databases that need large amounts of RAM, and storage optimized instances for workloads requiring high, sequential read and write access to very large datasets.
aws ec2 describe-instance-types --filters Name=instance-type,Values=m5.*
Real-world example A company running a memory intensive in memory caching layer chooses a memory optimized instance family, while their standard web application servers use a general purpose instance family that provides a good balance for typical web traffic.

Common follow-ups: How do you determine which specific instance size within a family is right for your workload?;What is the performance difference between different generations within the same instance family?