Cloud Computing Basics
Cloud Costs and Scaling
In this lesson you will
- Explain pay-as-you-go pricing
- Describe vertical and horizontal scaling
- Use simple habits to control cloud costs
Introduction
The cloud can be very cheap for a small project and very expensive if it is left unwatched. Knowing how bills grow and how apps scale makes you a safer builder.
How you are billed
Most services charge for things you use. Common meters are:
- Compute: how long servers or functions run
- Storage: how much data you keep
- Data transfer: how much data leaves the provider (often called egress)
- Requests: how many times a service is called
Many providers offer a free tier with limited free usage, which is great for learning. Always check its limits.
Scaling
Scaling means handling more users.
- Vertical scaling (scale up): use a bigger machine, with more memory or a faster processor. Simple, but there is a limit.
- Horizontal scaling (scale out): run more copies of the app and share the work. This is how large services cope with huge traffic.
Auto scaling adds or removes copies automatically as demand changes, so you are not paying for idle machines.
Quick quiz
What is horizontal scaling?
Habits that prevent surprise bills
- Set a budget and alerts in your account so you are told early.
- Turn off what you do not use. Idle servers and forgotten test projects still cost money.
- Tag resources with a project name so you know what each cost belongs to.
- Choose the right size. Do not pay for a large server when a small one works.
- Delete old data and backups you no longer need.
- Protect your keys. Stolen cloud keys are often used to run expensive workloads.
The practice of managing cloud money well is sometimes called FinOps.
Try it yourself
Imagine a website that is quiet most of the day but very busy during a weekly sale. Explain how auto scaling would help, and what budget alert you would set.
Summary
- You pay for compute, storage, data transfer and requests that you use.
- Scale up uses a bigger machine, scale out uses more machines.
- Budgets, alerts and switching off unused resources prevent surprises.
Lesson complete
+20 XP
Nice work. Keep going while it is fresh.
Sources and further reading