03 / 09

What are the different EC2 instance types, their use cases, and naming conventions?

Difficulty: 5/10
instance families, use case selection, naming convention

EC2 instance types are grouped into families based on their hardware characteristics — General Purpose, Compute Optimized, Memory Optimized, Storage Optimized, and Accelerated Computing. The naming convention follows a pattern: [Family][Generation][Attributes].[Size].

AWS offers hundreds of EC2 instance types to serve different workloads. Each instance type belongs to a family that describes its primary hardware strength. Choosing the right instance type is critical for both performance and cost efficiency. The naming convention encodes the family, generation, optional attributes, and size in a compact string.

Instance Naming Convention — [Family][Generation][Attributes].[Size]
  1. 1

    Family letter — describes the primary characteristic: t (burstable), m (general), c (compute), r (memory), i (storage), g (GPU), p (ML/AI), x (extreme memory), d (dense storage), h (HDD storage)

  2. 2

    Generation number — higher means newer hardware (e.g., m5 is newer than m4)

  3. 3

    Optional attributes — a (AMD CPU), g (AWS Graviton/ARM), i (Intel), n (network optimized), d (NVMe storage), e (extra storage/memory), z (high frequency)

  4. 4

    Size — nano, micro, small, medium, large, xlarge, 2xlarge, 4xlarge, 8xlarge, 12xlarge, 16xlarge, 24xlarge, metal

  5. 5

    Examples: t3.micro = burstable gen3 micro | c5n.xlarge = compute gen5 network-optimized xlarge | m6g.2xlarge = general gen6 Graviton 2xlarge

General Purpose — t, m, mac Series
  1. 1

    t3, t3a, t4g — Burstable performance instances. Low baseline CPU with burst credits. Best for: dev/test environments, small websites, low-traffic apps. Cost-efficient for variable workloads.

  2. 2

    m5, m6g, m6i, m7g — Balanced CPU and memory. Best for: web servers, app servers, small databases, backend services, enterprise applications.

  3. 3

    mac1, mac2 — macOS-based instances on Apple silicon. Best for: iOS/macOS app development and testing.

Compute Optimized — c Series
  1. 1

    c5, c5n, c6g, c6i, c7g — High CPU-to-memory ratio. Best for: batch processing, high-performance web servers, scientific modeling, media transcoding, gaming servers, machine learning inference.

  2. 2

    c5n — Same as c5 but with higher network bandwidth (up to 100 Gbps). Best for: HPC and network-intensive workloads.

Memory Optimized — r, x, z, u Series
  1. 1

    r5, r6g, r6i, r7g — High memory-to-CPU ratio. Best for: in-memory databases (Redis, Memcached), real-time analytics, large-scale caching, SAP HANA.

  2. 2

    x1, x1e, x2gd — Extreme memory (up to 3.9 TB RAM). Best for: in-memory databases, SAP HANA, Apache Spark.

  3. 3

    z1d — High frequency (up to 4.0 GHz) with large memory. Best for: financial simulations, EDA (Electronic Design Automation), relational databases.

Storage Optimized — i, d, h Series
  1. 1

    i3, i3en, i4g, i4i — NVMe SSD-backed storage with very high IOPS. Best for: high-frequency OLTP databases, NoSQL databases (Cassandra, MongoDB), data warehousing.

  2. 2

    d2, d3, d3en — High-density HDD storage (up to 336 TB). Best for: Hadoop/HDFS, data warehouses, distributed file systems.

  3. 3

    h1 — High disk throughput with HDD. Best for: MapReduce, distributed file systems like HDFS.

Accelerated Computing — p, g, trn, inf Series
  1. 1

    p3, p4, p4d — NVIDIA Tesla GPUs. Best for: deep learning training, scientific simulations, molecular modeling.

  2. 2

    g3, g4dn, g4ad, g5 — NVIDIA/AMD GPUs. Best for: graphics-intensive applications, ML inference, video encoding, gaming.

  3. 3

    trn1 — AWS Trainium chips. Best for: cost-efficient deep learning training.

  4. 4

    inf1, inf2 — AWS Inferentia chips. Best for: high-throughput, low-latency ML inference at scale.

Naming Convention Decoded

Scenario Questions

0-2 years experience

  1. 1We need to spin up a web server for a low‑traffic blog. Which EC2 instance type would you pick and why?
  2. 2If you launch an m5.large instance but your application is memory‑bound, what would you observe and what would you change?

2-5 years experience

  1. 1Your team migrated a batch processing job from a t2.micro to a c5.xlarge and saw higher costs without performance gain. Walk me through how you would diagnose the mismatch and pick a better instance.
  2. 2During a recent deployment, an autoscaling group using mixed instance types started failing health checks. How would you investigate the issue related to instance families and naming?

5-8 years experience

  1. 1Design a cost‑optimized, high‑throughput data ingestion pipeline that uses multiple EC2 instance families. Explain how you would choose instance types, handle scaling, and balance compute vs memory.
  2. 2Our latency‑sensitive microservices run on m5.large instances, but we need to reduce network jitter. What alternative instance families would you consider and what trade‑offs?

8+ years experience

  1. 1We are planning a multi‑region migration from on‑prem servers to AWS and need a long‑term instance strategy that accommodates future workload shifts. How would you develop a naming convention and instance family roadmap that aligns with governance and cost controls?
  2. 2Across several product teams, there is inconsistency in instance selection leading to sprawl. Propose an organization‑wide policy and tooling approach to enforce appropriate EC2 type choices and naming standards.

Follow-up Questions

  • Can you give an example where a burstable instance would be a poor fit?
  • How would you monitor that your chosen instance type continues to meet performance SLAs?
  • What signals would prompt you to revisit your instance selection after a few months?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.