Choosing compute and managed services
🎯You'll be able to
Choose between virtual machines, managed containers, Kubernetes and serverless functions, and decide when a managed database or storage service is worth its price.
🏠The everyday picture
For a family function you can cook everything yourself, hire a cook to use your kitchen, or order from a caterer who brings food, staff and plates. Each step up costs more per plate and saves you work and risk.
📘What it really is
- Compute choices, from most control to least work:
- virtual machines (EC2, Compute Engine, Azure VMs): you manage the operating system, patches and scaling;
- managed containers (ECS on Fargate, Cloud Run, Azure Container Apps): you give an image and settings; the provider runs and scales it. A good fit for RouteRani's API;
- managed Kubernetes (EKS, GKE, AKS): the most flexible for many services, with the most to learn (CD5);
- serverless functions (AWS Lambda, Cloud Run functions, Azure Functions): code that runs per event and costs nothing when idle; good for small, spiky tasks, with limits on run time and some start-up delay ("cold starts").
- Managed data services:
- databases (Amazon RDS and Aurora, Cloud SQL, Azure Database for PostgreSQL) handle backups, patching, standby copies and failover;
- object storage (S3, Cloud Storage, Azure Blob Storage) for files, backups and static websites, priced per gigabyte stored and transferred;
-
queues and caches (SQS, Pub/Sub, ElastiCache/Memorystore).
-
Choosing: prefer the most managed option that meets your needs, and spend your team's time on the product. Reasons to choose less managed: special software, strict control requirements, or cost at very large scale.
-
Infrastructure as code for all of it: the same Terraform workflow as CD3, with the provider's resources, for example (not verified):
hcl resource "aws_db_instance" "routerani" { identifier = "routerani-prod" engine = "postgres" instance_class = "db.t4g.medium" allocated_storage = 50 multi_az = true storage_encrypted = true username = "routerani" password = random_password.db.result deletion_protection = true }
📝A worked example
Input: compare running RouteRani's database in a container on a VM with Amazon RDS Multi-AZ.
Expected output:
| Task | Container on a VM | RDS Multi-AZ |
|---|---|---|
| Backups and point-in-time restore | you set up and test them | built in; you choose retention |
| Standby in another zone and failover | you build it | built in, usually a minute or two |
| Operating system and PostgreSQL patches | you | the provider, in a maintenance window you choose |
| Monthly price | lower | higher |
| Engineer time | several hours a month | much less |
🌍Where it's used
- Startups use managed containers and databases so a small team can ship features.
- Large platforms combine Kubernetes for services with managed databases.
- Event processing: image resizing, notifications and webhooks often run as serverless functions.
📝Case scenario
A school ERP company ran PostgreSQL on its own VM to save money. Backups had silently failed for two months when the disk failed; they lost a week of attendance records. Moving to a managed database with automatic backups and point-in-time restore cost more per month than the VM, but less than one day of the incident.
🖱️Try it
For each RouteRani piece (load balancer, API, database, booking-confirmation emails, nightly reports), pick a compute or managed service and write one sentence why. Success: each choice names a reason (managed, cost when idle, control, or limits).
⚠️Common mistakes
- Running everything on VMs by habit. Sign: engineers patch servers instead of building features. Fix: choose managed services where they fit.
- Serverless for long or steady work. Sign: time-outs or high bills for always-busy functions. Fix: containers for steady services.
- No deletion protection on data. Sign: a database deleted by a mistaken change. Fix:
deletion_protection,prevent_destroyand backups.
🛠️For your project
Your capstone's cloud design table should name the compute and database services you'd use for RouteRani, with reasons.
✅Quick check
What does a managed database take off your hands?
Show the answer
Backups, patching, standby copies and failover.
When do serverless functions fit well?
Show the answer
Small, event-driven or spiky tasks that can be idle much of the time.
