Cloud Intermediate: Services, Networks and Automation
Compute, Storage and Databases
In this lesson you will
- Compare virtual machines, containers and serverless
- Choose between object, block and file storage
- Explain why managed databases are popular
Introduction
Every major cloud provider offers hundreds of services, but they fall into a few families. Learn the families, and you can find your way around any provider. Names differ (Amazon Web Services, Microsoft Azure and Google Cloud each use their own), but the ideas match.
Compute: where your code runs
Virtual machines (VMs) are the closest to a normal server. You choose the CPU, memory and operating system, and you manage the software. Flexible, and you handle patching and scaling.
Containers package an app with its dependencies, so it runs the same anywhere. Providers offer services to run containers for you, from simple "run this container" services to full Kubernetes.
Serverless functions run small pieces of code only when triggered by a request or an event, and you pay for the time they run. You do not manage servers at all, but functions have time and memory limits, and long-lived tasks are awkward.
| Option | You manage | Good for |
|---|---|---|
| Virtual machine | OS, runtime, app | Full control, legacy software |
| Container service | The app image | Modern apps, consistent deployment |
| Serverless function | Just the code | Event-driven tasks, spiky or low traffic |
Quick quiz
Which compute option runs your code only when it is triggered and bills for the time it runs?
Storage: three kinds
- Object storage keeps files as objects in buckets, accessed by web addresses or APIs. Very cheap, very durable and almost unlimited. Ideal for images, videos, backups, logs and static websites. You cannot edit part of an object, only replace it.
- Block storage acts like a hard disk attached to a VM. Fast, and used for operating systems and databases. Usually attached to one machine at a time.
- File storage is a shared network drive that many machines can use at once, with folders and file locking.
Choose object storage first when you can, since it is cheapest and simplest, and use block or file storage when your software needs a real disk or shared folder.
Also learn storage classes: frequently used data costs more to store but less to read, while archive data is very cheap to store but slow or costly to retrieve.
Databases
You can install a database on a VM, but then you handle backups, patches, replication and failover. Managed databases do this for you.
- Relational (SQL) databases such as PostgreSQL and MySQL, for structured data and transactions
- NoSQL databases such as document, key-value and wide-column stores, for flexible structure or massive scale
- In-memory caches such as Redis, for very fast temporary data
- Data warehouses, for analysing huge datasets
Managed services give you automatic backups, point-in-time recovery, easy scaling and security patches. You trade some control and pay more than the raw cost of a VM, but you save a lot of work and reduce risk.
Choosing sensibly
- Start with the simplest option that meets the need.
- Think about how data is accessed: many small reads, big scans, or files?
- Consider durability, backup and recovery from the start.
- Avoid lock-in where it matters, for example by using standard database engines and containers.
Try it yourself
For a small photo-sharing app, choose how you would store the photos, the user accounts, and a cache of popular pages. Name the type of service for each, and say why.
Summary
- Compute comes as virtual machines, containers or serverless functions, with less management and more convenience as you go up.
- Object storage is cheap and durable, block storage acts as a disk, and file storage is a shared drive.
- Managed databases handle backups, patching and failover, so you can focus on your app.
Lesson complete
+20 XP
Nice work. Keep going while it is fresh.
Sources and further reading