What is “The Cloud” in Plain Words?
The cloud is simple: you rent someone else’s computer and pay for what you use.
That’s it. No magic. No buzzwords.
When you run code on your laptop, you’re using your computer. When you run code “in the cloud,” you’re using Amazon’s computers (or Google’s, or Microsoft’s). You pay them money, and they let you use their machines.
Three Ways to Run Your Code
There are three main ways to run code. Each has pros and cons.
1. Local (Your Laptop)
What it is: Code runs on your computer.
Pros:
- Free (you already own the computer)
- Fast to start
- Easy to debug
- Full control
Cons:
- Only works when your laptop is on
- Not accessible from the internet
- You manage everything
- Limited by your hardware
When to use: Development, testing, personal projects.
2. Virtual Machine (IaaS - Infrastructure as a Service)
What it is: You rent a virtual computer in the cloud. You manage the operating system and everything on it.
Example: AWS EC2, Google Compute Engine, Azure VMs.
Pros:
- Full control over the environment
- Can run any software
- Predictable costs (pay per hour)
- Good for long-running services
Cons:
- You manage the server (updates, security, scaling)
- Pay even when not using it
- Need to configure everything
- More complex
When to use: Long-running services, databases, complex applications.
3. Serverless Functions (FaaS - Function as a Service)
What it is: You write a function. The cloud runs it when someone calls it. You don’t manage servers.
Example: AWS Lambda, Google Cloud Functions, Azure Functions.
Pros:
- No server management
- Pay only when code runs
- Auto-scales
- Simple deployment
Cons:
- Cold starts (first request can be slow)
- Time limits (usually 15 minutes max)
- Less control over environment
- Can be expensive at high volume
When to use: APIs, event handlers, small to medium workloads.
Visual Comparison
Regions and Availability Zones
AWS has data centers all over the world. These are organized into:
Regions: Geographic locations (like us-east-1 for US East, eu-west-1 for Europe).
Availability Zones (AZs): Separate data centers within a region. Usually 2-6 per region.
Why it matters:
- Pick a region close to your users (lower latency)
- Regions are isolated (if one goes down, others work)
- Some services are region-specific
For this tutorial: Pick any region. We’ll use us-east-1 in examples.
Pricing Basics
Pay Per Hour (VMs)
You rent a server. You pay for every hour it runs, even if no one uses it.
Example: $0.01 per hour = $7.20 per month if running 24/7.
Good for: Services that run constantly.
Pay Per Request (Serverless)
You pay only when someone calls your function.
Example: First 1 million requests free per month, then $0.20 per million.
Good for: APIs called occasionally or with unpredictable traffic.
Why Serverless is Good for Small Projects
If your API gets called 100 times per day:
- VM: Pay $7.20/month even if you only get 100 requests
- Serverless: Pay $0 (within free tier)
For small side projects, serverless is usually cheaper.
Quick Check
Question: You have an API called a few times a day. Which model is usually cheaper?
Answer: Serverless. You pay per request, not per hour. For low traffic, this is almost always cheaper.
Key Takeaways
Before moving on, remember:
- Cloud = renting computers - No magic, just someone else’s hardware
- Three models: Local (free, but not accessible), VM (pay per hour, full control), Serverless (pay per request, no server management)
- Regions matter - Pick one close to your users
- Serverless is cheap for small projects - Pay only when code runs
What’s Next?
In the next page, we’ll design the Notes API we’re going to build. You’ll see the complete picture before we start coding.