DEV Community

1suleyman
1suleyman

Posted on

โ˜๏ธ What Is Compute in the Cloud? (And Why AWS Gives You So Many Options)

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.