Module 5 · Beginner · How the internet and websites work

What is the cloud? Cloud computing basics

Cloud computing basics: what the cloud is, IaaS vs PaaS vs SaaS, AWS, Azure and Google Cloud, regions, pay-as-you-go pricing, and how to start safely.

By theprogrammers team · · 11 min read

Your photos are "backed up to the cloud", your college uses Google Drive, and job listings ask for "AWS experience". But where is the cloud, actually? It isn't in the sky. The cloud means computers in someone else's data centre, which you rent over the internet instead of buying and running your own. Cloud computing is renting servers, storage, databases and other services by the hour or by usage, and turning them on or off in minutes.

Before the cloud, a start-up that wanted to launch an app had to buy servers, find space for them, and guess how many it would need. Too few, and the app crashed on launch day; too many, and money sat unused. Now the same start-up can rent one small server for a few hundred rupees a month and add a hundred more during a sale. This lesson explains what the cloud is, the main kinds of cloud services, the big providers, how pricing works, and how to try it without getting a surprise bill.

What you need first: how the internet works and frontend, backend and databases.

Key terms

  • Cloud computing: renting computing resources (servers, storage, databases, software) over the internet, paying for what you use.
  • Cloud provider: a company that runs data centres and rents out services, such as AWS, Microsoft Azure or Google Cloud.
  • Data centre: a building full of servers, with power, cooling, network and security.
  • Virtual machine (VM): a software computer that runs on a real server, sharing its hardware with other VMs.
  • Region: a geographic area where a provider has data centres, such as Mumbai or Singapore.
  • Pay-as-you-go: paying only for the resources you use, often by the second, hour or gigabyte.
  • On-premises (on-prem): running your own servers in your own building, the opposite of cloud.

The cloud is someone else's computer

When you upload a photo to Google Photos, it's stored on disks in Google's data centres. When you open Netflix, the video streams from servers Netflix rents and runs. "The cloud" is a friendly name for those remote computers, reached over the internet.

Owning your own servers (on-prem)Cloud
Starting costBuy hardware up frontNothing up front
Time to get a serverWeeks (order, deliver, set up)Minutes
PayingSame cost whether used or notPay for what you use
GrowingBuy more hardwareAdd more with a click or a script
MaintenanceYour team replaces disks, handles power and coolingThe provider does it
ControlTotalLess; you work within the provider's options

A useful comparison: electricity. You don't build a power plant for your home; you plug into the grid and pay per unit used. The cloud does the same for computing.

What you can rent

Cloud providers offer hundreds of services, but most fall into a few groups:

GroupWhat it gives youExample services
ComputeMachines to run codeAWS EC2, Azure Virtual Machines, Google Compute Engine; serverless functions like AWS Lambda
StorageSpace for filesAWS S3, Azure Blob Storage, Google Cloud Storage
DatabasesManaged databasesAWS RDS, Azure SQL, Google Cloud SQL, DynamoDB, Firestore
NetworkingPrivate networks, load balancers, DNS, CDNsVPC, load balancers, Route 53, CloudFront
AI and dataMachine learning models, data warehousesAmazon Bedrock and SageMaker, Azure OpenAI, Google Vertex AI and BigQuery

IaaS, PaaS and SaaS

Cloud services are grouped by how much the provider manages for you:

ModelYou manageProvider managesExample
IaaS (Infrastructure as a Service)Operating system, software, your app, dataHardware, network, data centreRenting a Linux VM on AWS EC2
PaaS (Platform as a Service)Your app and dataEverything underneath, including the OS and scalingDeploying code to Heroku, Render, Google App Engine or Azure App Service
SaaS (Software as a Service)Just your data and settingsThe whole applicationGmail, Google Docs, Zoom, Salesforce

The pizza comparison is popular for a reason:

  • On-prem: make pizza at home. You buy everything and do everything.
  • IaaS: buy a ready pizza base and cook it at home. Some work is done for you.
  • PaaS: order pizza delivery. You just choose the toppings (your code).
  • SaaS: eat at the restaurant. Everything is done; you just enjoy it.

As a developer, you'll mostly use IaaS and PaaS to run your apps, and SaaS tools (like GitHub and Slack) to work.

Serverless goes one step beyond PaaS: you upload a function, and the provider runs it only when a request arrives, charging per call. There are still servers; you just never see or manage them.

The big providers

ProviderNotes
Amazon Web Services (AWS)The largest by market share; the widest range of services
Microsoft AzureSecond largest; popular with companies already using Microsoft products
Google Cloud (GCP)Strong in data, analytics and AI
OthersOracle Cloud, IBM Cloud, DigitalOcean, Linode (Akamai), and Indian providers

The ideas (VMs, storage buckets, managed databases, regions) are the same across all of them, with different names. Learn one well, and switching is mostly learning new names.

Regions and availability zones

Providers have data centres all over the world, grouped into regions. AWS, Azure and Google Cloud all have regions in India, including Mumbai, plus more in other cities.

Choose a region close to your users, because data takes time to travel. A server in Mumbai answers a user in Pune faster than one in Virginia, USA. Some Indian rules, for example for certain financial and government data, also require data to be stored in India.

Each region is split into availability zones: separate data centres a few kilometres apart, with their own power and network. Running your app in two zones means a fire or power cut in one doesn't take it down.

How cloud pricing works

You pay for what you use, measured in units like:

ResourceUsually billed by
Virtual machinesPer second or hour of running time, by size (CPUs and RAM)
StoragePer GB per month
Data transfer out to the internetPer GB (data coming in is usually free)
DatabasesPer hour of running time, plus storage
Serverless functionsPer request and per unit of compute time

A quick estimate in Python, using made-up example prices (real prices vary by provider, region and size):

hours_per_month = 24 * 30
vm_per_hour = 1.50          # ₹ per hour, example only
storage_per_gb = 2.00       # ₹ per GB per month, example only

vm_cost = vm_per_hour * hours_per_month
storage_cost = storage_per_gb * 50          # 50 GB of files

print(f"VM: ₹{vm_cost:,.0f}")
print(f"Storage: ₹{storage_cost:,.0f}")
print(f"Total: ₹{vm_cost + storage_cost:,.0f} per month")
print(f"If the VM runs only 8 hours a day: ₹{vm_per_hour * 8 * 30 + storage_cost:,.0f}")
VM: ₹1,080
Storage: ₹100
Total: ₹1,180 per month
If the VM runs only 8 hours a day: ₹460

The last line shows the big idea: turn things off when you don't need them, and you stop paying for them. Providers publish official pricing calculators to estimate real costs.

Why companies use the cloud

  • Speed: new servers in minutes, so teams ship faster.
  • Scaling: handle a festival-sale rush by adding servers, then remove them afterwards.
  • No hardware to look after: no failed disks or air-conditioning to manage.
  • Global reach: run near users in any country.
  • Managed services: databases with automatic backups, ready-made AI models, and so on, without building them.
  • Reliability: spread across zones and regions to survive failures.

The trade-offs: costs can grow fast if no one is watching, you depend on the provider (moving away is hard), and you still have to secure your own data and settings.

Shared responsibility

The provider secures the cloud itself: buildings, hardware and its network. You secure what you put in it: who can log in, your passwords and keys, firewall settings, and whether your storage buckets are public. Many real data leaks happen because someone left a storage bucket open to the internet, not because the provider was hacked.

Trying the cloud safely

All three big providers offer free tiers or trial credits for new accounts, so you can learn without paying much. Before you start:

  1. Set a billing alert or budget on day one, so you get an email if spending passes a small amount, such as ₹500.
  2. Turn on two-factor authentication for the account.
  3. Never put access keys in code or on GitHub; bots find leaked cloud keys within minutes and use them to run expensive servers.
  4. Delete what you're done with: stopped VMs may still charge for their disks, and forgotten resources keep billing.
  5. Pick the smallest sizes while learning.

A good first project: put a static website in a storage bucket, or deploy a small Python app to a PaaS like Render or Azure App Service.

Practice

  1. Is each of these IaaS, PaaS or SaaS? (a) Google Docs. (b) Renting an Ubuntu VM and installing everything yourself. (c) Pushing your Flask app's code to a platform that runs it for you.
Show the answer

(a) SaaS. (b) IaaS. (c) PaaS.

  1. Your users are mostly in India. Which region should you choose, and why?
Show the answer

An Indian region such as Mumbai. Data travels a shorter distance, so pages load faster, and some data rules require storage in India.

  1. Using the example prices above, what would a VM cost for a month if it ran only on weekdays, 10 hours a day (22 weekdays)?
Show the answer
vm_per_hour = 1.50
print(f"₹{vm_per_hour * 10 * 22:,.0f}")
₹330

Compared with ₹1,080 for running all month, switching it off outside working hours saves a lot.

  1. A friend's cloud bill is ₹18,000 after a weekend of "just testing". Name two likely causes and two things that would have prevented it.
Show the answer

Likely causes: a large VM or GPU left running, or leaked access keys used by someone else to run servers. Prevention: a billing budget with email alerts, deleting resources after testing, choosing small sizes, and keeping keys out of code and GitHub. (Contact the provider's support too; they sometimes help first-time users with accidental charges.)

  1. What does "shared responsibility" mean? Give one thing the provider handles and one you handle.
Show the answer

Security is split. The provider handles the physical data centre, hardware and its core network. You handle your account's access, passwords and keys, firewall rules, and settings like whether a storage bucket is public.

Interview questions

What is the difference between IaaS, PaaS and SaaS?

IaaS provides virtual infrastructure (VMs, storage, networks) where you manage the OS and above. PaaS provides a managed platform where you deploy code and the provider runs the OS, runtime and scaling. SaaS provides a complete application used over the internet, where you only manage your data and settings.

What are regions and availability zones?

A region is a geographic area containing a provider's data centres. An availability zone is one or more isolated data centres within a region, with independent power and networking. Deploying across zones protects against a single data-centre failure; across regions, against a regional outage.

What is the shared responsibility model?

The cloud provider is responsible for security of the cloud (physical facilities, hardware, the virtualisation layer and its network). The customer is responsible for security in the cloud: identity and access, data, application security, network configuration and encryption settings.

Key takeaways

  • The cloud is renting computers and services in a provider's data centres over the internet, paying for what you use.
  • IaaS gives you virtual machines, PaaS runs your code for you, and SaaS is a finished app.
  • AWS, Azure and Google Cloud are the biggest providers; their core ideas are the same.
  • Choose regions near your users, and use several availability zones for reliability.
  • Set billing alerts, keep keys secret and delete unused resources from day one.

Frequently asked questions

Is the cloud safe?

The big providers secure their data centres very well, often better than a single company could. Most cloud security problems come from customer mistakes, like weak passwords, leaked keys or public storage buckets. Used carefully, the cloud is safe for most data.

Which cloud should I learn first?

AWS has the most jobs and learning material, so it's a common first choice. Azure is a strong choice if you target companies using Microsoft tools, and Google Cloud for data and AI work. The concepts transfer between them.

Do I need to learn the cloud as a beginner?

Not in your first months. Learn programming and the basics of Linux, networking and Git first. Add the cloud when you want to deploy your projects or move towards backend, DevOps or data engineering.

What to learn next

  1. Learn how apps are shipped to the cloud in what is DevOps?
  2. See how cloud systems are built in system design for beginners.
  3. Learn how content reaches users fast in what is a CDN?