All guides
Practice now
D3 · High performance

Compute: EC2, Lambda, ECS and instance types

24% of the exam (D3) evaluates high-performance design. For compute, you need to pick the right service (EC2, Lambda, ECS/EKS) and the right instance type / purchasing option for each scenario.

Icon-Architecture/48/Arch_Amazon-EC2_48

EC2 instance types

instance types are organized into families by use case. The prefix identifies the family, the number the generation, and the suffix any additional characteristics (a=AMD,g=GPU,n=networking,i=NVMe SSD,d=HDD).

⚖️

General Purpose (T, M, A1)

Balance of CPU, memory and networking. T = burstable (CPU credits). M = steady baseline.

EXAM: "General-purpose web app", "small microservice" → t3.micro, m5.large
⚡

Compute Optimized (C)

High CPU-to-memory ratio. For workloads that need intensive processing.

EXAM: "Media server", "batch processing", "gaming servers", "machine learning inference" → c5.xlarge
🧠

Memory Optimized (R, X, High Memory)

Lots of RAM. For in-memory databases, real-time analytics, big data.

EXAM: "SAP HANA database", "high-performance Redis", "in-memory Spark" → r5.2xlarge
💾

Storage Optimized (I, D, H)

High local I/O throughput. NVMe SSD (I), high-density HDD (D, H).

EXAM: "Low-latency NoSQL", "data warehouse with frequent access", "Hadoop/HDFS" → i3.xlarge
🎮

Accelerated Computing (P, G, Inf, Trn)

GPUs (P, G) for ML training/inference, 3D rendering. Inferentia/Trainium for ML on AWS.

EXAM: "Training a deep learning model", "video rendering" → p3.2xlarge, g4dn
Icon-Architecture/48/Arch_Amazon-EC2_48

EC2 purchasing options

On-Demand

0% (baseline)

Full price per hour/second

No commitment. . Maximum flexibility.

When: Unpredictable workloads, short dev/test environments, initial deployments.

Reserved Instances (RI)

Up to 72% with 3-year All Upfront

Up to 72% discount vs On-Demand

1- or 3-year commitment. Standard RI (bigger discount), Convertible RI (can change family).

When: Applications with predictable 24/7 load. Always-on production databases.

Savings Plans

EC2 Savings Plans: up to 72%. Compute: up to 66% but also applies to Lambda/Fargate.

Up to 66% discount (Compute) / 72% (EC2)

$/hour commitment for 1 or 3 years. Applies automatically to EC2, Lambda, Fargate.

When: When you want the Reserved discount but with instance type/region flexibility.

Spot Instances

Up to 90% — the biggest discount

Up to 90% discount vs On-Demand

Uses unused AWS EC2 capacity. Can be reclaimed with 2 minutes of notice.

When: Batch processing, ML training, rendering, CI/CD — any interruption-tolerant workload.

Dedicated Hosts

No price savings — value comes from compliance and existing licenses

The most expensive (an entire physical server)

Dedicated physical server. Lets you use existing software licenses (BYOL: Windows Server, SQL Server).

When: Compliance that requires dedicated hardware. Per-socket/per-core software licensing.

Spot Fleet — smart mixing

Spot Fleet can combine multiple instance types and AZs to maximize available capacity. If a Spot instance gets reclaimed, it automatically launches another from the available pool. For batch jobs or ML training: Spot Fleet + instance diversification.

Icon-Architecture/48/Arch_AWS-Lambda_48

— serverless compute

Lambda runs code without managing servers. Scales automatically from 0 to thousands of concurrent executions. You only pay for execution time (milliseconds).

Limits that matter for the exam

Max timeout15 minutes
Memory128 MB – 10,240 MB (10 GB)
Ephemeral storage (/tmp)512 MB (extendable to 10 GB)
Deployment package50 MB (zip) / 250 MB (unzipped)
Default concurrency1,000 concurrent per region
vCPUProportional to memory (1 vCPU = 1,769 MB)

Common event sources

API GatewaySQS/SNSCloudWatch EventsKinesisALBCognito

Cold Start

First invocation or after inactivity: Lambda has to initialize the environment (~100ms-1s). Mitigate with Provisioned Concurrency(keeps N instances pre-initialized) or SnapStart for Java.

Icon-Architecture/48/Arch_Amazon-Elastic-Container-Service_48

, EKS and

ServiceOrchestrationInfrastructure managementWhen to use
ECS + EC2ECS (AWS native)You manage the EC2 instancesFull control over the host. Spot instances to cut costs.
ECS + FargateECS (AWS native)AWS manages the infrastructure (serverless)No server management. Pay per container vCPU/memory.
EKS + EC2KubernetesYou manage the nodesKubernetes portability. Teams with K8s experience.
EKS + FargateKubernetesAWS manages the nodes (serverless)Kubernetes without managing nodes. More expensive than ECS Fargate.

ECS vs signals in the exam

Choose ECS when:

  • • "AWS-native container service"
  • • "No prior Kubernetes experience"
  • • "Native integration with ALB, IAM, CloudWatch"

Choose EKS when:

  • • "Already running Kubernetes on-prem"
  • • "Multi-cloud portability"
  • • "Kubernetes ecosystem (Helm, operators)"
Icon-Architecture/48/Arch_Amazon-EC2_48

When to use each service

ScenarioServiceReason
Processing images when uploaded to S3LambdaEvent-driven, short-lived, scales automatically
High-concurrency REST API without managing serversLambda + Serverless, pay per request, automatic scaling
ML training batch job that takes 2 hoursEC2 Spot (C or P family)Lambda caps at 15 min. Spot cuts cost by up to 90%
Containerized microservices from the AWS teamECS + FargateAWS native, no infra to manage, native integration
Migrating a Kubernetes app from on-prem to AWSEKSSame Kubernetes API, no rewriting manifests
Web app with predictable 24/7 loadEC2 Reserved InstancesUp to 72% savings vs On-Demand for steady load
Overnight batch data analysisEC2 Spot FleetInterruption-tolerant, maximum savings

Did you get this topic?

Test what you just learned

A company runs machine learning training jobs that take between 2 and 8 hours. The jobs are interruption-tolerant (they can restart from checkpoints). The company wants to minimize cost. Which EC2 configuration is most appropriate?

Ready to test "Compute: EC2, Lambda, ECS and instance types"?

Put what you learned to the test with original SAA-C03 exam questions.

Start SAA-C03 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.