Big data on the cloud: AWS, Azure and GCP

The cloud lets a two-person team build a data platform in a weekend, and a careless query rack up lakhs in a day. In this lesson you learn the same building blocks on AWS, Azure and Google Cloud, watch a serverless query scale out and vanish, cut a monthly bill from ₹50 lakh to ₹2.4 lakh, survive a spot machine disappearing mid-job, and see why payment data must stay in Indian regions.

Module 4 · The Ecosystem⏱ 30 minBeginner → AdvancedRuns in your browser (Python)3 real-time scenariosCloud bill estimator for your PC9 practice problems
1 The story

A ₹50 lakh surprise

TiffinGo has no data centre at all: everything runs on a public cloud. In his second month Kabir builds a small analytics setup in a weekend: files in object storage, a serverless SQL engine on top, and a Spark cluster for the nightly job. The analysts love it. Then the October bill arrives: ₹50 lakh, mostly from one line, “SQL scans”.

Cloud bill · OctoberObject storage₹1.1 LServerless SQL scans₹43.2 LSpark cluster₹5.8 LData transfer out₹0.3 LTotal ₹50.5 lakhfixSame platform, after a week of fixes✓ Parquet + date partitions + no SELECT *✓ cluster runs only for the nightly job✓ spot workers, data kept in regionTotal ₹2.4 lakh The cloud makes big data easy to start and easy to overspend. myphatshala.in
Kabir

Sir, it took me two days to build what used to take a team months. How did it also cost ₹50 lakh?

Arjun Sir

Because in the cloud you pay for what you use, and serverless SQL charges for every terabyte a query reads. Analysts ran SELECT * on 40 TB of uncompressed CSV, hundreds of times a day. The cluster also ran all night and all day, though the job needs three hours.

Riya

So the cloud is expensive?

Arjun Sir

No, Riya. The cloud is honest: it bills exactly what you do. With good file layouts, clusters that switch off and cheaper spare capacity, the same platform cost ₹2.4 lakh a month.

Kabir

And all those service names, S3, EMR, Glue, BigQuery, Databricks? It feels like learning three languages.

Arjun Sir

It’s mostly one language with three accents. Every cloud has object storage, managed Spark, a warehouse, a streaming service and an orchestrator. Today you’ll learn the map once, then see a bill shrink, a spot instance disappear mid-job, and why payment data must stay in Indian regions.

2 Definition

Big data on the cloud

Formal definition (write this in exams)

Cloud computing provides on-demand access to computing resources (storage, compute, networking and managed software services) over the internet, billed by usage. For big data, public clouds such as Amazon Web Services (AWS), Microsoft Azure and Google Cloud Platform (GCP) offer managed object storage, distributed processing, data warehouses, streaming and orchestration services that scale elastically. Service models range from IaaS (virtual machines you manage) through PaaS / managed services to serverless offerings billed per query or job, with storage and compute typically separated.

In simple words

Instead of buying and running your own servers, you rent storage and processing from a cloud company and pay only for what you use. Each cloud offers ready-made services for storing lake data, running Spark, querying with SQL and handling streams, so a small team can build a big data platform in days.

Words you’ll meet in this lesson

Region / availability zoneA region is a geographic area with data centres (for example Mumbai); a zone is one isolated data centre group within it.
IaaS / PaaS / SaaSRent machines / rent a managed platform / rent finished software.
ServerlessNo servers to choose or manage; you pay per query, per job or per data processed.
Managed serviceThe provider installs, patches, scales and backs up the software for you.
EgressData transferred out of a cloud region or out of the cloud; usually charged per GB.
Spot / preemptible instanceSpare capacity sold at a deep discount that the provider can reclaim at short notice.
FinOpsThe practice of managing cloud costs: visibility, budgets, ownership and optimisation.
Shared responsibilityThe provider secures the cloud; the customer secures what they put in it.

India regions (2026)

AWSAsia Pacific (Mumbai) and Asia Pacific (Hyderabad)
Microsoft AzureCentral India (Pune), South India (Chennai), West India (Mumbai) and additional regions with partners
Google Cloudasia-south1 (Mumbai) and asia-south2 (Delhi)

Region lists and service names change. Always check the provider’s current documentation before designing.

Big data on the cloud at three levels

Pick your level. New to this? Start at Beginner and climb.

Beginner Renting instead of buying

  • Buying servers is like buying a car: big cost up front, it sits idle most of the day, and you maintain it.
  • The cloud is like a ride-hailing app: book exactly the size you need, for as long as you need, and pay per use. Need 200 cars for one hour? Possible.
  • Managed services mean someone else runs the engine: you get storage, Spark, SQL and Kafka-like streaming as ready services, not machines to install.
  • Regions are the cities where the cloud has data centres. Indian companies usually choose Mumbai, Hyderabad, Pune, Chennai or Delhi regions.

Intermediate The same building blocks on every cloud

  • Storage: object storage is the foundation of every cloud lake (S3, ADLS Gen2, Cloud Storage).
  • Processing: managed Spark (EMR, Databricks, Dataproc), serverless ETL (Glue), or Apache Beam pipelines (Dataflow).
  • SQL: warehouses (Redshift, Synapse/Fabric, BigQuery, Snowflake) and serverless SQL directly over lake files (Athena, BigQuery external tables).
  • Streaming: managed event streams (Kinesis, MSK, Event Hubs, Pub/Sub, Confluent Cloud).
  • Orchestration and governance: managed Airflow (MWAA, Cloud Composer), Data Factory, Step Functions; catalogs (Glue Data Catalog, Unity Catalog, Purview, Dataplex).
  • Provisioned vs serverless: provisioned means you choose and pay for machines by the hour; serverless means you just submit work and pay per query, job or data processed.

Advanced Cost, lock-in, security and data residency

  • The four meters: storage (per GB-month), compute (per node-hour or per TB scanned), requests (per thousand API calls) and egress (data leaving a region or cloud, often the hidden cost).
  • FinOps habits: tag every resource with an owner, set budgets and alerts, partition and use columnar formats, auto-terminate idle clusters, autoscale, and use spot / preemptible capacity (much cheaper, but the cloud can take it back at short notice) for fault-tolerant work.
  • Lock-in: proprietary services are convenient but hard to leave. Open formats (Parquet, Delta Lake, Iceberg) and open engines (Spark, Kafka APIs, Airflow) keep options open.
  • Shared responsibility: the provider secures the data centres and services; you secure your data: least-privilege IAM roles, encryption, private network endpoints, no public buckets.
  • Data residency: Indian rules (for example the RBI’s 2018 requirement to store payment-system data in India) and company policies decide which regions data may live in; disaster recovery is often set up across two Indian regions.

Exam tip: Explain the advantages of cloud for big data (elasticity, pay-per-use, managed services, separation of storage and compute, global reach) and the concerns (cost control, lock-in, security, data residency). Add a mapping table of equivalent services on AWS, Azure and GCP for storage, processing, warehouse and streaming.

3 Types and ways to use it

Service models and the AWS, Azure and GCP map

IaaS: virtual machines

You rent VMs and install Hadoop, Spark or Kafka yourself. Most control, most work. Used for special needs or lift-and-shift migrations.

You run it

Managed platforms (PaaS)

Managed Spark clusters, managed Kafka, managed Airflow. You choose sizes; the provider runs the software.

They run it

Serverless

Submit SQL or a job; capacity appears and disappears automatically. Billed per TB scanned, per job or per second of use.

No servers

SaaS data platforms

Snowflake, Databricks, Confluent Cloud: run on any major cloud, billed by usage, with their own consoles.

Multi-cloud

The same job, three clouds

JobAWSMicrosoft AzureGoogle Cloud
Lake storageAmazon S3ADLS Gen2 / Blob Storage (OneLake in Fabric)Cloud Storage
Managed Spark / HadoopAmazon EMR, AWS Glue (Spark)Azure Databricks, Fabric Spark, HDInsightDataproc
Data warehouseAmazon RedshiftSynapse Analytics / Fabric WarehouseBigQuery
SQL directly on lake filesAmazon AthenaSynapse serverless SQL / FabricBigQuery external & BigLake tables
Event streamingKinesis, Amazon MSK (Kafka)Event Hubs (Kafka-compatible)Pub/Sub, Managed Kafka
Stream processingManaged Service for Apache Flink, Glue streamingStream Analytics, DatabricksDataflow (Apache Beam)
OrchestrationMWAA (Airflow), Step FunctionsData Factory, Fabric pipelinesCloud Composer (Airflow), Workflows
Catalog / governanceGlue Data Catalog, Lake FormationMicrosoft Purview, Unity CatalogDataplex, Data Catalog
Machine learningSageMakerAzure Machine LearningVertex AI

Databricks, Snowflake and Confluent run on all three clouds. Names are as of 2026 and may change.

Learn the categories, not the brand names. If you know “object storage + managed Spark + warehouse + streaming + orchestrator + catalog” and how they connect, you can work on any cloud after a week of reading its documentation.

4 Step by step

Building a small cloud data platform

  1. Pick a region and create the lake bucket

    Kabir creates a bucket in the Mumbai region with folders by zone: bronze/, silver/, gold/, versioning on, encryption on, public access blocked.

    The region decides latency, price and legal residency. Security settings are your job under the shared-responsibility model.
  2. Stream app events into the lake

    App events flow into a managed stream (Kinesis, MSK, Event Hubs or Pub/Sub) and a delivery service writes them to bronze/ every few minutes as compressed files.

    No Kafka brokers to patch. The trade-off: you pay per shard, partition or GB, and you accept the provider’s limits.
  3. Catalog the tables

    A crawler or a table format registers the files as tables (schema, partitions, location) in a catalog so SQL engines and Spark can find them by name.

    The catalog is what turns a bucket of files into a lake people can query, and where access permissions are managed.
  4. Transform with managed Spark

    nodes, rate = 20, 40       # node-hours at illustrative Rs 40
    print("always on :", nodes * 24 * 30 * rate, "rupees/month")
    print("3 h a day :", nodes * 3 * 30 * rate, "rupees/month")
    always on : 576000 rupees/month 3 h a day : 72000 rupees/month
    A managed Spark cluster (EMR, Databricks, Dataproc) or a serverless Spark job builds silver and gold tables. Starting it only for the job instead of leaving it on is the easiest big saving.
  5. Query with serverless SQL, carefully

    lake_tb, scan_fraction = 40, 0.01
    price_per_tb = 450       # illustrative rupees per TB scanned
    print("SELECT * (whole table):", lake_tb * price_per_tb, "rupees per query")
    print("one day, 2 columns    :", lake_tb * scan_fraction * price_per_tb, "rupees per query")
    SELECT * (whole table): 18000 rupees per query one day, 2 columns : 180.0 rupees per query
    Per-TB-scanned engines reward Parquet, partitions and selecting only needed columns. The same question can cost a hundred times less with a good layout.
  6. Watch the bill like a metric

    Every resource is tagged with a team and project; a budget alert fires at 80% of the monthly limit; a weekly report shows the most expensive queries and idle resources.

    In the cloud, cost is an engineering metric, just like latency and errors. Teams that watch it daily rarely get bill shocks.
5 See it happen

One serverless query: what Kabir sees, and what the cloud does

Step through the six frames. Left: Kabir running a query. Right: how a serverless engine plans, scales out, bills and disappears.

What Kabir sees, and what the cloud does 6 steps
What you see Query editorSELECT city, SUM(amount)FROM gold.ordersWHERE day = '2026-10-19'GROUP BY cityRun ▶Query editorSELECT city, SUM(amount)FROM gold.ordersWHERE day = '2026-10-19'GROUP BY cityQueued… 1 sQuery editorSELECT city, SUM(amount)FROM gold.ordersWHERE day = '2026-10-19'GROUP BY cityRunning… 6 sResultsPune₹38.4 LMumbai₹35.1 LThane₹9.8 LNashik₹4.2 L4 rows · 9 sResultsData scanned: 14 GBCost ≈ ₹6shown under every queryWorkspaceIdlenothing running, nothing billed myphatshala.in
Behind the screen SQL engineserverlessNo cluster is running yet.The query is just text sent to the service.plannerReads the catalog: table location, partitions, schema.Only partition day=2026-10-19 matches.workers start200 workers read Parquet files from object storage(only the city and amount columns)aggregatePartial sums are combined into 4 result rows.Meter: 14 GB scanned× ₹450 per TB (illustrative) ≈ ₹6Billed per byte read, not per second of compute.workers releasedstorage stays (₹ per GB-month)Compute exists only while queries run.Storage and compute are separate. myphatshala.in
6 Real-world use

Real-time scenarios: cost, capacity and compliance

Three live scenarios: a monthly bill cut by 95% (real numbers from the program below), a spot worker reclaimed mid-job, and an advanced look at data residency, disaster recovery, egress and lock-in.

Real-time scenario 1

From ₹50 lakh to ₹2.4 lakh a month

These figures come from the program in “Run it on your PC” below, with illustrative prices. Watch each fix shrink TiffinGo’s monthly bill.

FinOps in five steps 5 steps
Animated example Monthly bill (₹ lakh, illustrative prices)Naive₹50.5 LCSV files, SELECT * all day, cluster always on.“SQL scans” alone: ₹43.2 lakh.Monthly bill (₹ lakh, illustrative prices)Naive₹50.5 L+ Parquet & partitions₹8.3 LParquet + date partitions + only needed columns:each query scans 0.02 TB instead of 0.8 TB.Monthly bill (₹ lakh, illustrative prices)Naive₹50.5 L+ Parquet & partitions₹8.3 L+ auto-shutdown₹3.3 LStart the Spark cluster for the 3-hour job only,instead of 24 hours a day.Monthly bill (₹ lakh, illustrative prices)Naive₹50.5 L+ Parquet & partitions₹8.3 L+ auto-shutdown₹3.3 L+ spot workers₹2.8 LRun workers on spot capacity, about 70% cheaper here.Spark retries any task on a reclaimed node.Monthly bill (₹ lakh, illustrative prices)Naive₹50.5 L+ Parquet & partitions₹8.3 L+ auto-shutdown₹3.3 L+ spot workers₹2.8 L+ no egress₹2.4 LStop copying data out of the region every day.Result: 95% lower bill, same dashboards. myphatshala.in
Real-time scenario 2

A spot worker disappears in the middle of the job

Spot (or preemptible) machines are spare cloud capacity at a deep discount, with one catch: the provider can take them back at short notice. Watch why they suit Spark batch jobs.

Spot capacity 5 steps
Animated example driveron-demandW1spotW2spotW3spotW4spotW5spotW6spotW7spotW8spotNightly Spark job: driver on a regular machine,8 workers on spot capacity at a big discount.driveron-demandW1spotW2spotW3reclaimedW4spotW5spotW6spotW7spotW8spotThe cloud needs capacity back: W3 gets a shortwarning, then is reclaimed mid-job.driveron-demandW1spotW2spotW3reclaimedW4spotW5spotW6spotW7spotW8spotSpark notices the lost executor and re-runs W3’stasks on the other workers (lineage, Lesson 1.4).driveron-demandW1spotW2spotW3new spotW4spotW5spotW6spotW7spotW8spotThe cluster manager requests a replacement nodeto keep the job on schedule.driveron-demandW1doneW2doneW3doneW4doneW5doneW6doneW7doneW8doneThe job finishes about 6 minutes late,at a fraction of the on-demand price. myphatshala.in
Real-time scenario 3 · advanced

Where may the data live? Residency, DR, egress and lock-in

Choosing a cloud region is not only about price and speed. Watch four decisions an Indian fintech data team must get right before writing any pipeline.

Region and risk decisions 5 steps
Animated example Mumbai regionpayments lake (primary)Singapore regioncheaper this month?Proposal: move payment data to SingaporeNot allowed: payment-system data must be storedin India (RBI, 2018). Region choice is a legal decision.Mumbai regionprimaryHyderabad regiondisaster recoveryDisaster recovery inside IndiaAsync replication to a second Indian region.If one region fails, switch over without leaving India.Cloud A lake60 TBOther cloud / officedaily full copyThe hidden meter: egressMoving data OUT of a region or cloud is billed per GB.Copy only what is needed, incrementally, and compress it.Avoiding lock-in• open table formats: Parquet + Delta Lake / Iceberg• open engines and APIs: Spark, Kafka protocol, Airflow, SQLProprietary services are fine, but keep the data itselfin open formats so it can move later.Security checklist• no public buckets · encryption at rest and in transit• least-privilege roles · private endpoints · audit logs• keys managed in a KMS, rotatedThe provider secures the cloud; you secure your data. myphatshala.in

How Indian companies use the cloud for data

1. Start-ups: cloud-native from day one

Food, travel, ed-tech and fintech start-ups build lakes on object storage with managed Spark or a SaaS platform, a cloud warehouse for BI and managed Kafka, without owning a single server.

Apps→Managed cloud services→Dashboards + ML

2. Banks and insurers: hybrid

Regulated companies often keep core systems on premises and use cloud regions in India for analytics, ML and customer apps, with strict controls on what data moves where.

Core banking (on-prem)→Controlled transfer→Cloud analytics in India
₹ budget

3. FinOps teams

Larger companies run FinOps practices: tagging, monthly cost reviews per team, rightsizing, spot usage targets and alerts on expensive queries, because cloud spend can rival salaries.

Usage data→Tags + budgets + reviews→Lower unit cost

4. Hadoop to cloud migrations

Many enterprises are moving older on-premises Hadoop clusters to cloud lakehouses: data copied to object storage, Hive tables converted to Delta or Iceberg, jobs moved to managed Spark.

On-prem HDFS→Copy + convert→Cloud lakehouse
7 Run the code

Translate a design between clouds

A small dictionary maps each job in a data platform to a service on each cloud. The program prints the same architecture on AWS, Azure and Google Cloud. Then try the challenges: compare scan costs, always-on vs on-demand clusters, spot savings, egress and storage tiers.

services = {
    "lake storage":   {"AWS": "S3",         "Azure": "ADLS Gen2",       "GCP": "Cloud Storage"},
    "managed Spark":  {"AWS": "EMR / Glue", "Azure": "Databricks",      "GCP": "Dataproc"},
    "warehouse":      {"AWS": "Redshift",   "Azure": "Synapse/Fabric",  "GCP": "BigQuery"},
    "event stream":   {"AWS": "Kinesis/MSK","Azure": "Event Hubs",      "GCP": "Pub/Sub"},
    "orchestration":  {"AWS": "MWAA",       "Azure": "Data Factory",    "GCP": "Cloud Composer"},
}
design = ["event stream", "lake storage", "managed Spark", "warehouse", "orchestration"]

for cloud in ["AWS", "Azure", "GCP"]:
    print(f"{cloud:5}: " + " -> ".join(services[job][cloud] for job in design))
AWS : Kinesis/MSK -> S3 -> EMR / Glue -> Redshift -> MWAA Azure: Event Hubs -> ADLS Gen2 -> Databricks -> Synapse/Fabric -> Data Factory GCP : Pub/Sub -> Cloud Storage -> Dataproc -> BigQuery -> Cloud Composer
  • "lake storage": {"AWS": "S3", "Azure": "ADLS Gen2", "GCP": "Cloud Storage"},Every cloud has the same categories; only the product names differ.
  • design = ["event stream", "lake storage", "managed Spark", "warehouse", "orchestration"]Design in categories first, then pick the product on the chosen cloud.

Run it on your PC: estimate and shrink a cloud bill

This program estimates the monthly bill of a small cloud data platform (storage, SQL scans, a Spark cluster and data transfer) with illustrative prices, then applies five fixes one by one: columnar files and partitions, auto-shutdown, spot workers and keeping data in region. Change the assumptions at the top and run it again. Save it as cloud_bill.py.

A cloud bill, before and after FinOps

"""Estimate a monthly cloud bill for a small data platform, and see what
partitioning, columnar files, spot instances and auto-shutdown save.
All prices are ILLUSTRATIVE round numbers in rupees, not a real price list."""

PRICE = {
    "storage_per_tb_month": 1_900,     # object storage, standard tier
    "scan_per_tb": 450,                # serverless SQL, charged per TB scanned
    "node_hour_on_demand": 40,         # one Spark worker node
    "node_hour_spot": 12,              # same node as spot / preemptible capacity
    "egress_per_tb": 7_000,            # data sent out of the cloud region
}
LAKE_TB = 60
QUERIES_PER_DAY = 400
NIGHTLY_NODES, NIGHTLY_HOURS = 20, 3


def bill(scan_tb_per_query, spot, cluster_always_on, egress_tb):
    storage = LAKE_TB * PRICE["storage_per_tb_month"]
    scans = scan_tb_per_query * QUERIES_PER_DAY * 30 * PRICE["scan_per_tb"]
    rate = PRICE["node_hour_spot"] if spot else PRICE["node_hour_on_demand"]
    hours = 24 if cluster_always_on else NIGHTLY_HOURS
    compute = NIGHTLY_NODES * hours * 30 * rate
    egress = egress_tb * PRICE["egress_per_tb"]
    return {"storage": storage, "queries": scans, "compute": compute, "egress": egress}


def show(name, b):
    total = sum(b.values())
    parts = ", ".join(f"{k} {v / 1e5:.1f}L" for k, v in b.items())
    print(f"{name:37} Rs {total / 1e5:6.1f} lakh/month  ({parts})")
    return total


before = show("1. Naive: CSV, SELECT *, always on", bill(0.8, False, True, 5))
step2 = show("2. + Parquet, partitions, columns", bill(0.02, False, True, 5))
step3 = show("3. + cluster only for the 3-hour job", bill(0.02, False, False, 5))
step4 = show("4. + spot workers", bill(0.02, True, False, 5))
after = show("5. + keep data in-region (no egress)", bill(0.02, True, False, 0))
print(f"\nSaving: {(1 - after / before) * 100:.0f}% of the original bill")

# In a terminal:  python cloud_bill.py
1. Naive: CSV, SELECT *, always on Rs 50.5 lakh/month (storage 1.1L, queries 43.2L, compute 5.8L, egress 0.3L) 2. + Parquet, partitions, columns Rs 8.3 lakh/month (storage 1.1L, queries 1.1L, compute 5.8L, egress 0.3L) 3. + cluster only for the 3-hour job Rs 3.3 lakh/month (storage 1.1L, queries 1.1L, compute 0.7L, egress 0.3L) 4. + spot workers Rs 2.8 lakh/month (storage 1.1L, queries 1.1L, compute 0.2L, egress 0.3L) 5. + keep data in-region (no egress) Rs 2.4 lakh/month (storage 1.1L, queries 1.1L, compute 0.2L, egress 0.0L) Saving: 95% of the original bill

Recorded from a real run with Python 3.13. The prices are round illustrative numbers, not any provider's price list; use your cloud's pricing calculator for real estimates. The pattern is what matters: badly laid-out data scanned many times and idle clusters usually dominate the bill.

8 Line by line

Adding up a cloud bill, one line at a time

Three meters are added: storage, compute and scans. Watch the total grow, and notice which meter dominates.

Worked examples: real problems, solved and traced in memory

Four cloud decisions, from mapping services to estimating a spot-instance plan. Each runs live and is traced.

Example 1BeginnerCloud basics · mapping

Find the equivalent service

Problem statement

A team moving from AWS to Google Cloud lists the AWS services it uses. Print the Google Cloud equivalent of each.

Input
S3, EMR, Redshift, Kinesis, MWAA
Expected output
S3         -> Cloud Storage
EMR        -> Dataproc
Redshift   -> BigQuery
Kinesis    -> Pub/Sub
MWAA       -> Cloud Composer
QuickSight -> no direct match: check docs

Approach

  1. Store an AWS → GCP mapping in a dictionary.
  2. Look up each service.
  3. Print “no direct match” for anything missing.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 2IntermediateFinOps · scans

Cost of a dashboard on a pay-per-scan engine

Problem statement

A dashboard has 6 charts, refreshed every 15 minutes during 12 working hours. Each chart scans 25 GB. At an illustrative ₹450 per TB, what does it cost per month (22 working days), and what if refreshed hourly from a small aggregate table scanning 0.5 GB per chart?

Input
6 charts, every 15 min × 12 h, 25 GB each, 22 days
Expected output
every 15 min, raw table  :   154.7 TB scanned, Rs     69,609 per month
hourly, aggregate table  :     0.8 TB scanned, Rs        348 per month

Approach

  1. Refreshes per day = 12 hours × 4.
  2. TB per month = charts × refreshes × days × GB ÷ 1024.
  3. Cost = TB × price.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 3IntermediateArchitecture · provisioned vs serverless

When does a fixed cluster beat serverless?

Problem statement

Serverless costs ₹450 per TB scanned. A provisioned warehouse costs ₹3 lakh per month regardless of use. Find the break-even monthly scan volume and decide for teams scanning 150 TB and 1,200 TB a month.

Input
₹450/TB vs ₹3 lakh/month · 150 TB, 1,200 TB
Expected output
break-even: 667 TB per month
marketing   : serverless Rs 67,500 vs fixed Rs 300,000 -> serverless
data science: serverless Rs 540,000 vs fixed Rs 300,000 -> provisioned

Approach

  1. Break-even TB = fixed cost ÷ price per TB.
  2. Below it, serverless is cheaper; above it, provisioned is.
  3. Compare both teams.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

Example 4AdvancedCompute planning · spot

Plan a spot-heavy Spark cluster

Problem statement

A nightly job needs 160 node-hours. On-demand costs ₹40/hour, spot ₹12/hour. History shows 15% of spot node-hours are lost to reclaims and must be redone. The driver and 2 core nodes stay on-demand for the full 4-hour run. Compare all-on-demand with the mixed plan.

Input
160 node-hours, ₹40 vs ₹12, 15% rework, 3 on-demand nodes × 4 h
Expected output
all on-demand: Rs 6400
mixed plan   : Rs 2522 (170 spot node-hours incl. rework)
saving       : 61%

Approach

  1. All on-demand: node-hours × ₹40 (the 3 fixed nodes are part of the 160).
  2. Mixed: 12 on-demand node-hours plus the rest on spot, inflated by 15% rework.
  3. Compare costs.

Solution: run it live

What happens in memory, step by step

Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.

9 Quiz and revision

Check yourself

Quick revision

Lesson 4.6 in one screen

  • Cloud = on-demand, pay-per-use, managed services, elastic; storage and compute separated.
  • Models: IaaS (VMs) → managed PaaS → serverless → SaaS platforms (Databricks, Snowflake, Confluent).
  • Map: storage S3 / ADLS Gen2 / Cloud Storage · Spark EMR-Glue / Databricks / Dataproc · warehouse Redshift / Synapse-Fabric / BigQuery.
  • Streaming Kinesis-MSK / Event Hubs / Pub/Sub · orchestration MWAA / Data Factory / Cloud Composer.
  • Cost meters: storage, compute, scans, requests, egress. FinOps: tags, budgets, layouts, auto-shutdown, spot.
  • Spot/preemptible: cheap but reclaimable → stateless, retryable work only.
  • Security is shared; avoid lock-in with open formats; payment data stays in Indian regions (RBI).

Interview and viva questions

What are the benefits of cloud computing for big data?

Elastic scaling to handle peaks and shrinking afterwards, pay-per-use pricing without large upfront hardware purchases, managed services that remove installation and maintenance work, separation of storage and compute so each scales independently, global regions for low latency and disaster recovery, and fast experimentation with new tools.

Compare the big data services of AWS, Azure and GCP.

For storage: Amazon S3, Azure Data Lake Storage Gen2/Blob, Google Cloud Storage. Managed Spark/Hadoop: Amazon EMR and AWS Glue, Azure Databricks/Fabric/HDInsight, Google Dataproc. Data warehouses: Amazon Redshift, Azure Synapse Analytics/Microsoft Fabric, Google BigQuery. Streaming: Amazon Kinesis and MSK, Azure Event Hubs, Google Pub/Sub. Orchestration: Amazon MWAA and Step Functions, Azure Data Factory, Google Cloud Composer. Databricks, Snowflake and Confluent run on all three.

What is serverless in the context of big data?

A model where you submit queries or jobs without choosing or managing servers; the provider allocates capacity automatically and bills by usage, such as per TB scanned (Athena, BigQuery on-demand), per job or per second of processing (serverless Spark, Dataflow). It is convenient for spiky workloads but needs care to control costs.

How do you control cloud costs for a data platform?

Tag resources by team and project, set budgets and alerts, use columnar formats and partitioning to reduce scans, select only needed columns, build aggregate tables for dashboards, auto-terminate idle clusters and autoscale, use spot capacity for fault-tolerant jobs, apply storage lifecycle tiers, reduce egress, and review the most expensive queries and resources regularly (FinOps).

What is vendor lock-in and how can it be reduced?

Lock-in is the difficulty and cost of moving away from a provider because your data, code and processes depend on its proprietary services. It can be reduced by keeping data in open formats (Parquet, Delta Lake, Iceberg), using open engines and APIs (Spark, Kafka protocol, Airflow, standard SQL), infrastructure-as-code, and isolating provider-specific code behind clear interfaces.

Practice problems

Cloud cost and design exercises with illustrative prices. The last two are business tasks.

P1Easy

Storage bill

Store 25 TB at Rs 1,900 per TB-month. Print the monthly cost.

Input
25 TB
Expected output
47500
Show solution and explanation
print(25 * 1900)
47500

How it works: Storage is billed per GB- or TB-month of data kept.

P2Easy

Scan cost

A query scans 300 GB at Rs 450 per TB. Print its cost.

Input
300 GB
Expected output
131.84
Show solution and explanation
print(round(300 / 1024 * 450, 2))
131.84

How it works: Convert GB to TB, then multiply by the price.

P3Easy

Service look-up

Print the Azure service for event streaming.

Input
event streaming
Expected output
Event Hubs
Show solution and explanation
azure = {"storage": "ADLS Gen2", "spark": "Azure Databricks", "event streaming": "Event Hubs"}
print(azure["event streaming"])
Event Hubs

How it works: Event Hubs is Azure's managed streaming service.

P4Medium

Idle cluster waste

A 12-node cluster at Rs 40/node-hour runs 24 h/day but is busy only 5 h. Print the monthly cost of idle hours.

Input
12 nodes, 19 idle h/day
Expected output
273600
Show solution and explanation
print(12 * 40 * 19 * 30)
273600

How it works: Auto-termination after a job removes this waste.

P5Medium

Pruned scan

A 36 TB table is partitioned into 360 days and has 18 equal columns. A query reads 7 days and 3 columns. Print TB scanned.

Input
36 TB, 7/360 days, 3/18 columns
Expected output
0.117 TB
Show solution and explanation
print(round(36 * 7 / 360 * 3 / 18, 3), "TB")
0.117 TB

How it works: Partitions cut rows; columnar storage cuts columns.

P6Advanced

Spot vs on-demand

300 node-hours. On-demand Rs 40, spot Rs 12 with 20% rework. Print both costs.

Input
300 nh
Expected output
on-demand: 12000 | spot: 4320
Show solution and explanation
print("on-demand:", 300 * 40, "| spot:", round(300 * 1.2 * 12))
on-demand: 12000 | spot: 4320

How it works: Even with rework, spot is much cheaper for retryable work.

P7Advanced

Break-even reservation

On-demand costs Rs 40/hour; a 1-year commitment costs Rs 2,10,000 per node for the year. Above how many hours per year of use is the commitment cheaper?

Input
Rs 40/h vs Rs 2.1 lakh/year
Expected output
5250 hours per year ( 60 % of the year )
Show solution and explanation
hours = 2_10_000 / 40
print(round(hours), "hours per year (", round(hours / 8760 * 100), "% of the year )")
5250 hours per year ( 60 % of the year )

How it works: Commitments pay off for steady, always-on workloads; on-demand or spot for spiky ones.

P8Business problem

Monthly platform estimate

Storage 50 TB (Rs 1,900/TB), 10 TB scanned per day (Rs 450/TB), a 15-node cluster 4 h/day (Rs 40/node-hour). Print the monthly total in lakh.

Input
as given
Expected output
Rs 3.02 lakh per month
Show solution and explanation
total = 50 * 1900 + 10 * 30 * 450 + 15 * 4 * 30 * 40
print(f"Rs {total / 1e5:.2f} lakh per month")
Rs 3.02 lakh per month

How it works: A first estimate like this belongs in every design document.

P9Business problem

Cost per order

The data platform costs Rs 2.4 lakh per month and the company handles 30 crore orders a month. Print the data-platform cost per 1,000 orders.

Input
Rs 2.4 lakh, 30 crore orders
Expected output
Rs 0.80 per 1,000 orders
Show solution and explanation
print(f"Rs {2.4e5 / 30e7 * 1000:.2f} per 1,000 orders")
Rs 0.80 per 1,000 orders

How it works: Unit cost makes platform spend comparable as the business grows.

Real-world scenario questions (asked in company interviews)

Cloud questions from real projects and interviews. Decide your answer first, then open the model answer.

Cloud architectureFresher

Design a small analytics platform on a cloud

A start-up wants daily dashboards from app events and its PostgreSQL database, on any one cloud, with a tiny team.

The interviewer is checking: can you assemble the standard building blocks and justify them?

Show a strong answer
  • Ingest: app events to a managed stream, delivered to object storage; database changes extracted nightly (or with change data capture).
  • Store: object storage lake with bronze/silver/gold zones, Parquet with Delta Lake or Iceberg, in an Indian region.
  • Process: serverless or managed Spark jobs, or SQL/dbt in a cloud warehouse.
  • Serve: warehouse or serverless SQL for BI dashboards.
  • Orchestrate: managed Airflow.
  • Govern and secure: catalog, IAM roles, encryption, budgets and tags from day one.

Avoid: listing ten services without explaining how data flows or what it costs.

FinOps · cost1–3 years

The query bill tripled this month

Serverless SQL costs tripled. Data volume grew only 10%.

The interviewer is checking: can you investigate and fix cloud cost problems?

Show a strong answer
  1. Find the top queries by bytes scanned and who ran them (query history, cost reports by tag).
  2. Look for SELECT *, missing partition filters, dashboards refreshing every minute and new unpartitioned tables.
  3. Fix the layout: Parquet, partitions, clustering; create small aggregate tables for dashboards.
  4. Add guardrails: per-user or per-workgroup scan limits, required partition filters, budget alerts.
  5. Share a weekly cost report with teams.

Avoid: switching to a bigger fixed cluster without finding what changed.

Compliance · data residency1–3 years

Can we use a cheaper overseas region?

A fintech’s finance team notices that an overseas region is cheaper and asks to move the payments analytics lake there.

The interviewer is checking: do you know that region choice is a compliance decision?

Show a strong answer

Payment-system data in India must be stored in India under the RBI’s 2018 direction on storage of payment system data, and other data may have contractual or DPDP-related obligations. Keep the lake in Indian regions, use a second Indian region for disaster recovery, and reduce cost through layout, lifecycle tiers, reserved or committed-use discounts and spot capacity instead. Involve the compliance team before moving any regulated data.

Avoid: deciding on price alone.

Fundamentals · interviewFresher

“What are the advantages and risks of cloud for big data?”

A common question in data engineering interviews.

The interviewer is checking: can you give a balanced answer with examples?

Show a strong answer

Advantages: elasticity (scale up for peaks and down afterwards), pay-per-use, managed services that save operations work, separation of storage and compute, global regions, fast experimentation. Risks: uncontrolled costs (scans, idle clusters, egress), vendor lock-in, security misconfiguration (public buckets, broad permissions), data-residency rules, and dependence on provider outages. Mitigations: FinOps practices, open formats, least-privilege security, region planning and multi-zone designs.

Avoid: saying only “the cloud is cheaper”.