The mental model
Compute runs your code, but each runtime exposes a different operating boundary. EC2 gives you virtual machines and responsibility for their operating systems. Container services schedule packaged processes. Lambda runs functions in response to events with service-specific limits. None removes the need to understand resource usage and failure behavior.
Start with execution duration, traffic variability, operating-system requirements, startup latency, and the team’s operating skills. A long-running process with custom host requirements may fit EC2. A short event handler may fit Lambda. Moving between models can change networking, identity, deployment, and cost, even when application code looks similar.
Decisions to make
- Choose EC2 when host-level control is a real requirement, with a patching and recovery plan.
- Choose an event-driven runtime when its execution model and limits match the work.
Design exercise · no AWS resources needed
Work through a scenario
You need to run a continuous video worker and a short webhook handler.
- Write each workload’s duration, host requirements, and traffic pattern.
- Choose a candidate runtime for each workload.
- Identify one runtime limit and one operating task that must be verified.
Check your understanding
Which is a useful first input to a compute decision?
Choose an answer to see the reasoning.
Continue with AWS documentation
Before following a deployment guide, review current pricing, permissions, and cleanup steps. Budget alerts are not a hard spending cap.