Hey everyone ๐
If you're learning AWS or cloud computing in general, you've probably seen the word compute thrown around a lot. When I first heard it, I assumed it just meant โrun stuff on the internet,โ and I wasnโt totally wrongโฆ but thereโs a lot more to it.
AWS gives you tons of ways to run your applications โ from virtual machines to serverless functions โ and each has its own pros, cons, and use cases.
Let me break it down the way I wish someone had explained it to me ๐
๐ ๏ธ Think of Compute Like a Coffee Shop
Imagine your app is a coffee shop. Customers (users) show up and place orders (requests). Someone has to take those orders and prepare the drinks (handle the backend logic).
In AWS, compute services are the baristas that do the work. But AWS gives you lots of ways to set up your barista crew:
- Some you manage directly (like hiring and scheduling your own team).
- Some you outsource completely (like Uber Eats handling everything).
Letโs walk through your optionsโฆ
๐ป EC2 โ Your DIY Virtual Servers
Amazon EC2 is like renting a virtual machine (aka a computer in the cloud) where you install whatever software you want.
You choose the โsizeโ based on what your app needs: more memory, more CPU, more storage? Thereโs an instance type for that.
You also choose how to pay:
- On-Demand: Rent by the hour โ like a short-term Airbnb
- Reserved: Book long-term, save money
- Spot: Bid on spare capacity โ super cheap but may get kicked out
- Savings Plans: Flexible contracts that work across EC2, Lambda, Fargate
๐ง Why use EC2?
Use it when you need full control โ like choosing the OS, installing custom software, or running legacy apps.
๐ EC2 Auto Scaling โ Add Baristas as Needed
Your coffee shop gets busier in the morning โ wouldn't it be great if extra baristas showed up automatically?
EC2 Auto Scaling does that for your virtual machines. It watches traffic and spins up (or removes) EC2 instances based on demand.
๐งญ Elastic Load Balancer โ The Smart Door Host
When customers walk in, how do they know which barista to go to?
Elastic Load Balancing (ELB) is like a host who directs people to the least-busy register. It spreads incoming traffic evenly across your EC2 instances โ so no one gets overwhelmed.
โ๏ธ Messaging: SQS & SNS โ Keep Things Decoupled
If your barista goes on break, should the cashier stop taking orders? Nope!
SQS acts like an order board: the cashier posts the orders, and the barista picks them up when ready. This keeps your system loosely coupled.
SNS is more like shouting the order to everyone โ subscribers like SMS, email, or other apps all get notified when something happens.
โก AWS Lambda โ No Servers. Just Code.
Donโt want to hire baristas at all? Want a magic robot that appears, takes an order, and vanishes?
Thatโs AWS Lambda. You upload a function, set a trigger (like a new upload or API call), and Lambda runs it โ automatically scaled and fully managed.
๐ง When to use Lambda?
Perfect for quick, short tasks (under 15 mins), like resizing images, handling form submissions, or processing background jobs.
๐ณ ECS & EKS โ Running Docker Containers
Maybe your app is already built with Docker โ small, portable environments that contain everything your app needs to run.
- ECS (Elastic Container Service): AWSโs own orchestration tool
- EKS (Elastic Kubernetes Service): AWS-managed Kubernetes
You still need somewhere to run these containers โ usually on EC2โฆ unless you use:
๐ AWS Fargate โ Serverless Containers
Fargate is like hiring AWS to run your containers for you โ no need to manage the servers.
It works with ECS or EKS, and you only pay for what you use.
๐ง Use Fargate if:
- You want containers
- But donโt want to manage EC2 instances
๐ Quick Recap Table
Use Case | AWS Service |
---|---|
Full control over OS, install software | EC2 |
Scale automatically based on demand | EC2 Auto Scaling |
Spread traffic across servers | Elastic Load Balancer |
Decouple processes with queues | SQS |
Send notifications to multiple endpoints | SNS |
Run code without servers | Lambda |
Run Docker containers | ECS / EKS |
Run containers without managing servers | Fargate |
๐งฉ Final Thoughts
Compute in the cloud isnโt a one-size-fits-all thing. AWS gives you the freedom to build how you want โ whether itโs full control with EC2, fully serverless with Lambda, or somewhere in the middle with containers and Fargate.
For me, the magic was realizing that these are just tools โ and you can mix-and-match them depending on your needs. And once you understand them, building in the cloud becomes way more fun ๐
Let me know how you're using AWS compute in your projects! Iโd love to connect on LinkedIn and learn together ๐ฌ
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.