What Is Computing?
If you are new to cloud, the word "computing" might feel technical. In simple terms, computing just means actually running code and programs somewhere.
Just like your home needs electricity to power your appliances, cloud applications need a place to actually run. AWS provides this "place" in several different ways. This guide explains the three main approaches.
---
Think of Different Types of Accommodation
Choosing how to run your code is like choosing where to stay when you travel.
Amazon EC2 = renting an apartment. You decorate it how you want, stay as long as you need, but cleaning and maintenance are your responsibility. AWS Lambda = staying in a hotel. You use the room when you need it, leave when you are done, and the hotel handles all the cleaning and upkeep. Containers = a modular mobile home. No matter where you move it, the interior environment stays exactly the same.
---
Amazon EC2 — Your Own Virtual Server
EC2 (Elastic Compute Cloud) lets you rent a virtual computer sitting somewhere in the AWS data center.
Traditionally, running a server meant buying physical hardware, setting it up, installing an operating system, and connecting it to a network. EC2 replaces all of that with a few clicks. You can have a new server running in minutes, and delete it the moment you no longer need it.
Three key concepts to know.
An AMI (Amazon Machine Image) is a template for creating a server. It contains a pre-configured operating system and any software you want pre-installed. Like using a cookie cutter to make identical cookies, one AMI lets you stamp out dozens of identical servers instantly.
Instance Types define the performance specifications of your server — how many CPUs, how much memory, how much storage. You pick the type that matches your workload. We cover instance type families in detail in the next post.
Per-second billing means you only pay for the time your server is actually running. The moment you stop it, charges stop too.
---
AWS Lambda — Running Code Without a Server
Lambda is a "serverless" computing service. This does not mean there is no server — it means AWS handles all the server management for you, completely invisibly.
How does it work? You upload your code to Lambda, and it runs automatically whenever a specific event occurs. If no event happens, Lambda does not run and you are not charged.
An everyday example: when a user uploads a profile photo on a shopping app, Lambda automatically resizes the photo into a smaller thumbnail and saves it. Lambda runs only during that process, then stops. You pay only for those few milliseconds.
Four key characteristics to remember.
No server management: AWS handles everything — operating system patches, server capacity, hardware failures.
Event-driven execution: Lambda responds to events like a file arriving in Amazon S3, an API request coming in, or a scheduled timer going off.
Millisecond billing: you are charged only for the actual time your code runs, measured in milliseconds. Zero execution means zero cost.
Maximum execution time of 15 minutes: Lambda can run for up to 15 minutes per invocation. It is not suitable for long-running tasks like video rendering or database migrations.
---
Container Services — The Same Environment Everywhere
A container packages your application code together with all the libraries and settings it needs to run. Think of it like packing your furniture before moving house — wherever the container runs, the environment inside is always identical.
Containers solve the famous developer problem: "it works on my machine but not on the server."
Four AWS services to know for containers.
Amazon ECS (Elastic Container Service) is AWS's own container management service. It automatically decides which server to run each container on and handles the scheduling for you.
Amazon EKS (Elastic Kubernetes Service) lets you use Kubernetes — the industry-standard open-source container management tool — on AWS infrastructure. It is the right choice for teams that already use Kubernetes.
AWS Fargate lets you run containers without managing any EC2 servers at all. Think of it as "serverless containers." You use Fargate together with ECS or EKS.
Amazon ECR (Elastic Container Registry) is a storage service for container images (packages). It is like a warehouse for your container templates.
!EC2 versus Lambda versus Containers
Which Service Should You Use When?
| Situation | Recommended Service | |-----------|-------------------| | Need to choose and install your own operating system | Amazon EC2 | | Want code to run only when a specific event occurs | AWS Lambda | | App must run identically in multiple environments | Containers (ECS/EKS + Fargate) | | Simple website or small application | Amazon Lightsail | | Large-scale batch processing jobs | AWS Batch |
---
Exam Key Points
"Run code without managing servers, event-driven" → AWS Lambda "Maximum Lambda execution time" → 15 minutes "Choose and manage the operating system yourself" → Amazon EC2 "Template for creating a server" → AMI (Amazon Machine Image) "Run in identical environments anywhere" → Containers "Run containers without managing servers" → AWS Fargate "Managed Kubernetes service" → Amazon EKS Lambda charges only for milliseconds of actual execution — no execution means no cost