Hadoop in the cloud, and Cloudera

Most new Hadoop-style work now runs on clusters that exist only while a job runs, reading data from cloud object storage. Many regulated companies still run Cloudera in their own data centres, often with the cloud on the side. This lesson explains the cloud pattern, compares the managed services as of October 2026, and puts numbers on always-on versus per-job clusters using measurements from our lab.

Module 13 · Hadoop in industry today⏱ 26 minIntermediatePlatform versions checked Oct 2026Architecture diagram + 2 animationsRuns in your browser (Python)8 practice problems
1 The story

A cluster that exists for three hours a night

Kabir's new company streams cricket and films. Every night a job crunches the day's viewing logs into recommendations. Their old Hadoop cluster ran 24 hours a day for a job that needed three. Now the logs sit in cloud object storage. At 1 AM a script creates 20 machines, runs the job, writes the results back and deletes the machines. The data stays; the cluster does not.

Always-on cluster (on-prem style) job 21 idle hours, still paid for 0h24h 20 workers × 24 h × 30 days illustrative: Rs 5.76 lakh a month Transient cloud cluster object store cluster 3 h deleted 20 workers × 3 h 15 m × 30 nights illustrative: Rs 78,000 (14%) Prices are illustrative (cloud_vs_onprem.py). The shape of the saving is real: you pay for compute only while it works. myphatshala.in
Kabir

Sir, so is Hadoop dead in the cloud? We don't even have HDFS there.

Arjun Sir

The storage moved, not the ideas. Their job still runs on YARN with Spark, reads splits in parallel, shuffles by key and uses the same Hive tables. What changed is that data lives in object storage like S3, GCS or ADLS, and clusters come and go around it.

Riya

And companies that can't move everything, like banks?

Arjun Sir

Many run Cloudera on their own servers, or a mix: sensitive data on-premises, burst work in the cloud. Today we compare the options using the numbers from our own lab, and look at what each cloud offers in October 2026.

2 Definition

Hadoop in the cloud

Formal definition (write this in exams)

Hadoop in the cloud means running Hadoop-ecosystem engines (YARN, Spark, Hive, Trino, HBase and others) on rented virtual machines or containers, usually as a managed service such as Amazon EMR, Google Cloud Dataproc or Azure HDInsight, with data kept in object storage (Amazon S3, Google Cloud Storage, Azure Data Lake Storage) accessed through Hadoop file-system connectors (s3a://, gs://, abfs://) instead of HDFS. This separation of compute and storage allows clusters to be created per job (transient), resized automatically (autoscaling) and run partly on discounted interruptible capacity (spot or preemptible instances), while table metadata lives in a shared catalog. Cloudera provides a commercial distribution of the same open-source stack for on-premises data centres and public clouds, with central management, security and governance.

In simple words

The data sits in cheap cloud storage that never switches off. When there is work, you rent a cluster for an hour, point it at the data, and delete it afterwards. Cloudera sells the same Hadoop tools, packaged and supported, for companies that run their own servers.

Words you'll meet in this lesson

Object storageS3, GCS, ADLS: files as objects behind an HTTP API, replicated by the provider.
ConnectorHadoop FileSystem for a store: s3a://, gs://, abfs://.
Transient clusterCreated for one job or one night, then deleted.
AutoscalingThe service adds or removes workers as the YARN queue fills or empties.
Spot / preemptibleCheaper machines the provider can take back at short notice.
ServerlessYou submit a job; the service picks and pays the machines for you.
Catalog / metastoreTable definitions shared by all clusters (Hive metastore, Glue, Iceberg REST).
DistributionA tested bundle of Hadoop projects with tools and support (Cloudera).

What the platforms ship (checked 22 Oct 2026)

Amazon EMR 7.14.0Hadoop 3.4.2, Spark 3.5.8, Hive 3.1.3, HBase 2.6.4, Tez 0.10.2, ZooKeeper 3.9.3, Flink 1.20.0, Trino 479, Iceberg 1.10.1, Delta 3.3.2, Hudi 1.0.2. Pig 0.17.0 and Oozie 5.2.1 still included; Sqoop dropped from emr-7.4.0
Google Dataproc 2.3.37Released 30 Sep 2026: Hadoop 3.3.6, Spark 3.5.3, Hive 3.1.3, Trino 432 (optional), Iceberg 1.6.1 (1.10 available), Java 11, on Debian 12, Ubuntu 22 or Rocky Linux 9
Azure HDInsight5.1 (GA 1 Nov 2023) is the only supported version, in maintenance mode with no new version announced; HDInsight 4.0 retired 31 Mar 2025; HDInsight on AKS retired 31 Jan 2025
Cloudera Base on premises 7.3.2March 2026, long-term support through 2032: Hadoop 3.4, Spark 3.5, HBase 2.6.3, Ranger 2.6, Atlas 2.4, Knox 2.1; Iceberg across Hive and Impala; Ozone; JDK 17 default (8 and 11 removed)
Our lab, for comparisonApache Hadoop 3.5.0 (released 2 Apr 2026) with Spark 4.0.4 on YARN; no cloud run in this lesson, costs below are illustrative

Architecture at a glance

Left: the classic cluster, where every worker stores blocks and runs containers. Right: the cloud pattern, where storage is a service and clusters are temporary.

On-premises (HDFS + YARN together) NameNode HA · ResourceManager Hive metastore · Ranger · Cloudera Manager workerworkerworker DataNode DataNode DataNode NodeManager NodeManager NodeManager data locality: tasks run where blocks are always on · you buy disks for 3 copies scale = buy servers (weeks) Cloud (storage and compute separated) catalog / metastoreGlue · Hive · Iceberg REST IAM / identityroles instead of keytabs nightly ETL clusterYARN + Spark, 20 workerslives 3 hours SQL / serverlessTrino, serverless Sparkautoscales, spot workers object storage: S3 · GCS · ADLS s3a:// gs:// abfs:// · Parquet/ORC/Iceberg tables · always on read and write over the network no data locality, but fast networks scale = an API call (minutes) · pay per hour myphatshala.in

The cloud at three levels

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

Beginner Renting a kitchen by the hour

  • An always-on cluster is like owning a big kitchen that you use for three hours a day. Rent, electricity and staff are paid all day.
  • In the cloud the ingredients (data) stay in a cold store that never closes. You rent a kitchen (a cluster) when it is time to cook, and hand it back after.
  • The recipes (Spark, Hive, MapReduce) are the same. Only the kitchen is temporary.

Intermediate What changes when storage leaves the cluster

  • Paths: hdfs://namenode/data becomes s3a://bucket/data, gs://bucket/data or abfs://container@account.dfs.core.windows.net/data. Jobs barely change.
  • Locality: blocks are no longer on the worker, so every read crosses the network. Cloud networks are fast, and engines read columnar files (Lesson 10.2), so this is usually fine.
  • Renames are slow: in object stores a "rename" copies the data. Classic MapReduce output commit renames folders, so use the cloud-aware committers (for example the S3A "magic" committer) or table formats like Iceberg that commit by writing metadata.
  • Metadata must be shared: because clusters are deleted, the metastore or catalog runs outside them (Glue, a managed Hive metastore, an Iceberg REST catalog).

Advanced Elasticity, interruption and governance

  • Autoscaling watches pending YARN containers (Lesson 11.3) and adds workers; it removes them when the queue is empty, after graceful decommissioning (Lesson 6.4 idea).
  • Spot/preemptible workers are much cheaper but can disappear. MapReduce and Spark rerun lost tasks (Lesson 8.6), so put them on task-only nodes and keep the AM and driver on regular nodes.
  • Security moves from Kerberos keytabs (Lesson 12.5) to cloud identity (IAM roles), though Kerberos and Ranger still appear on long-running clusters and in Cloudera.
  • Cost governance becomes engineering: tags, budgets, auto-termination of idle clusters, lifecycle rules that move old objects to colder storage classes.

Exam tip: For “Compare HDFS with cloud object storage”, write four rows: locality (yes vs no), cost model (disks for three copies, always on vs pay per GB stored), operations (rename is a metadata change vs a copy), lifetime (dies with the cluster vs independent of any cluster). Add one example connector such as s3a://.

3 Types and ways to use it

Ways to run Hadoop workloads today

OptionWhere data livesClustersGood forWatch out for
Self-managed Apache HadoopHDFS on your serversLong-runningFull control, learning, steady loadYou do every upgrade and patch
Cloudera Base on premisesHDFS or Ozone on your serversLong-running, managed by Cloudera ManagerRegulated industries, large steady estatesLicence cost, hardware cycles
EMR on EC2 / Dataproc / HDInsightS3 / GCS / ADLSTransient or long-runningLift-and-shift, nightly batchIdle clusters left running; HDInsight is in maintenance mode
EMR on EKS, EMR Serverless, Dataproc ServerlessObject storageNo cluster to manageSpark jobs of all sizesLess tuning control, per-job start-up
Cloudera public cloud / data servicesObject storageManaged by Cloudera in your cloud accountSame tools on-prem and in cloud (hybrid)Two bills: Cloudera and the cloud

Migration patterns

Lift-and-shift

Copy HDFS data to object storage (DistCp, Lesson 12.2), run the same jobs on a long-running cloud cluster. Fast, but keeps on-prem habits and cost.

weeks

Re-platform

Same Spark and Hive code, but transient clusters, autoscaling, spot workers and a shared catalog. Most of the saving comes here.

months

Re-architect

Move to a lakehouse: Iceberg/Delta tables, serverless engines, streaming ingestion. MapReduce jobs are rewritten in Spark SQL.

a year+

Hybrid

Keep regulated data and steady jobs on Cloudera on-prem; burst experiments and seasonal peaks to the cloud with copies of non-sensitive data.

common in India

Animated example: one night on a transient cluster

A streaming company's nightly job 6 steps
Animated example object storage: s3a://views/2026-10-21/ (always there) 6 TB of viewing logs from the day's matches and films cluster booting: 1 master + 4 workers 01:00 · a scheduler calls the cloud API.A cluster with 4 workers boots in a few minutes. VMs 01:06 · Spark reads splits straight from object storage.No copy into HDFS; the catalog says where the table is. 01:20 · pending containers pile up → autoscale.4 more workers, on cheaper spot capacity (orange). 03:40 · results written as an Iceberg table.One spot worker was taken back; its tasks simply reran. cluster terminated · 0 machines04:00 · the job ends, the cluster is terminated.Data and catalog stay; machines and their disks are gone. the bill: about 3 hours of workers8 a.m.: the recommendations are on every phoneNext night, a fresh cluster on the newest image. myphatshala.in

The most common cloud waste is a cluster nobody remembered to stop. Every managed service has an auto-termination or idle-timeout setting; turn it on before the first job, and tag clusters with an owner and a cost centre.

4 Step by step

Deciding with numbers

We did not create cloud resources for this lesson, so there is no cloud lab output here. Instead we feed numbers we measured on our own cluster into a small calculator, cloud_vs_onprem.py, with prices clearly marked as illustrative.

  1. Measure your own throughput first

    DistCp, 5 files, 162 MB, prod → DR          25.5 s   (Lesson 12.2)
    TestDFSIO write, 1 task                     113 MB/s (Lesson 12.3)
    TestDFSIO write, 6 tasks, aggregate         ~210 MB/s on one shared laptop disk
    Spark on YARN, item revenue, wall time      ~46–50 s incl. executor start (Lesson 13.2)
    Cloud sizing starts with how fast your jobs and copies really are. Our laptop numbers are small, but the method is the same on a 200-node cluster.
  2. Compare compute: always-on vs per-night

    always_on = workers * 24 * 30 * NODE_HOUR
    transient = workers * (job_hours + 0.25) * 30 * NODE_HOUR
    always-on 20 workers : Rs 576,000 transient, 3h15m a night : Rs 78,000 (14% of always-on) transient, 4 core + 16 spot: Rs 40,560 (7%)
    The ratio is what matters: 3 h 15 min of 24 h is 14%. Spot workers cut it further. Prices are placeholders: check the provider's price page.
  3. Compare storage: three copies on disks vs object storage

    hdfs = data_tb * 3 / 0.7 * DISK_TB_MONTH   # x3 copies, disks at most 70% full
    obj  = data_tb * OBJECT_TB_MONTH
    HDFS: 429 TB of raw disk : Rs 385,714 object storage, 100 TB : Rs 170,000
    100 TB in HDFS needs about 429 TB of raw disk (three copies, 30% headroom, Lesson 12.3). Erasure coding (Lesson 7.3) or Parquet compression (Lesson 10.2) shrink both sides.
  4. Estimate the move

    mb_s = gbps * 1000 / 8 * 0.7      # 70% of the link usable
    at our lab's DistCp speed (6.4 MB/s): 191 days over a 1 Gbps link at 70% use (88 MB/s): 13.9 days over a 10 Gbps link at 70% use (875 MB/s): 1.4 days
    Migration is often limited by the network link, not by Hadoop. Large moves use dedicated links or physical transfer appliances, and DistCp with -update catches up the changes made during the copy.
  5. Change the paths, not the logic

    spark-submit job.py hdfs://namenode/user/hadoop/data/student_orders.csv   # our lab
    spark-submit job.py s3a://canteen-data/orders/                              # AWS
    spark-submit job.py gs://canteen-data/orders/                               # Google Cloud
    The Hadoop FileSystem API (Lesson 6.5) hides the store behind a URI scheme. What changes is configuration: credentials come from cloud roles, and output commit uses a cloud-aware committer.

Copying data to the cloud is easy; copying it back can cost a lot (data egress is usually billed) and take weeks. Decide early which copy is the master and keep the other in sync with DistCp -update or snapshot-diff (Lesson 12.2).

5 See it happen

The same job, two lifecycles

Six steps of one nightly job: on a long-running on-premises cluster (left in each picture) and on a transient cloud cluster.

On-prem vs cloud job lifecycle 6 steps
What you see ops@edge : ~ # on-prem: the cluster is already upyarn node -list → 20 RUNNING# cloud: create itcreate-cluster --workers 4 --auto-terminate spark-submit job.py hdfs://…/views/spark-submit job.py s3a://views/…/same code, different URI on-prem: Data-local map tasks = mostcloud: every read over the network(columnar files keep it small) on-prem: queue full → job waitscloud: autoscaling +4 workers (spot) on-prem: commit = rename in HDFScloud: magic committer / Iceberg commit(rename in object storage = copy) on-prem: cluster idles until tomorrowcloud: cluster TERMINATEDillustrative month: 5.76 lakh vs 0.78 lakh myphatshala.in
Behind the screen on-prem cloud 3 workers: DataNode + NM object storage booting 4 workers… transient cluster reads hdfs://reads s3a:// block on the same nodenetwork reads containers pending+4 spot workers rename _temporary → outcommit metadata, no rename idle until tomorrow, still paidterminateddata stays in storage myphatshala.in
6 Real-world use

Cloud and Cloudera at work

3-hour clusterevery night

1. Streaming and media: nightly transient clusters

OTT platforms process the day's viewing logs on a cluster created at night over object storage, scaling out on match days and deleting the cluster afterwards.

Viewing logs→Transient Spark cluster→Recommendations
on-premcloud

2. Banking: hybrid Cloudera

Banks often keep customer and transaction data on Cloudera clusters in their own data centres, governed by Ranger and Atlas, and use the cloud for masked or aggregated data in analytics experiments.

Core data on-prem→Masked copies→Cloud sandbox
sale-day peak

3. Retail: autoscaling for sale days

An e-commerce company's clickstream jobs need five times the usual compute during festival sales. Autoscaling with spot workers covers the peak without buying servers that sit idle the rest of the year.

Clickstream→Autoscaling cluster→Hourly dashboards
HDFS → S3DistCp + -update

4. Telecom: migrating a 2 PB estate

An operator moves call-record history to object storage in waves: DistCp for the bulk, -update runs to catch up changes, then jobs switch their URIs table by table.

HDFS history→DistCp waves→Object storage tables
serverlessno cluster

5. Research and government data: serverless Spark

Small teams processing survey or scheme data run occasional Spark jobs on serverless offerings, paying per job and never managing a cluster at all.

Files in storage→Serverless Spark→Reports

Simplified; organisations differ in tools, prices, contracts and regulations. This is not legal or financial advice.

Sources (checked 22 Oct 2026): Amazon EMR 7.x application versions · Dataproc 2.3.x release versions · HDInsight roadmap (Directions on Microsoft) · HDInsight 4.0 retirement · HDInsight on AKS retirement · Cloudera Base on premises 7.3.2 · Apache Hadoop releases

7 Run the code

Always-on vs transient: a cost and time calculator

Prices are illustrative variables, not quotes: change them to the numbers on your provider's price page. The structure of the comparison is what matters.

NODE_HOUR = 40.0            # illustrative Rs per worker-hour
workers, job_hours, nights = 20, 3, 30
setup = 0.25                # 15 minutes to create and terminate

always_on = workers * 24 * nights * NODE_HOUR
transient = workers * (job_hours + setup) * nights * NODE_HOUR
print(f"always-on : Rs {always_on:>9,.0f} a month")
print(f"transient : Rs {transient:>9,.0f} a month ({transient / always_on:.0%})")
busy = job_hours / 24
print(f"the always-on cluster is busy {busy:.0%} of the time")
always-on : Rs 576,000 a month transient : Rs 78,000 a month (14%) the always-on cluster is busy 12% of the time
  • transient = workers * (job_hours + setup) * nights * NODE_HOURYou pay only while the cluster exists, including a few minutes to boot and shut down.
  • busy = job_hours / 24Utilisation decides the winner. A cluster busy 20 hours a day is cheaper to keep running.

Run it on your PC: compare the options with your own numbers

No cloud account is needed: this lesson did not create cloud resources. cloud_vs_onprem.py takes the throughput we measured in Lessons 12.2 and 12.3 and illustrative prices, and prints the three comparisons from Part 4. Put your provider's real prices into the variables at the top before using the numbers for a decision.

Compute, storage and migration time

# cloud_vs_onprem.py: always-on cluster vs a transient (per-job) cloud cluster, and the time to
# move data to the cloud. ALL PRICES ARE ILLUSTRATIVE - check the provider's price page.
# Measured inputs come from our lab: DistCp 162 MB in 25.5 s (12.2), TestDFSIO aggregate write
# ~210 MB/s on one shared laptop disk (12.3).

# --- 1. compute: a nightly 3-hour job on 20 workers -----------------------------------------
NODE_HOUR = 40.0          # illustrative Rs per worker-hour (on-demand)
SPOT_DISCOUNT = 0.6       # illustrative: spot/preemptible workers 60% cheaper
workers, job_hours = 20, 3
always_on = workers * 24 * 30 * NODE_HOUR
transient = workers * (job_hours + 0.25) * 30 * NODE_HOUR          # +15 min to create and terminate
spot = 4 * (job_hours + 0.25) * 30 * NODE_HOUR + 16 * (job_hours + 0.25) * 30 * NODE_HOUR * (1 - SPOT_DISCOUNT)
print("1. Compute for a month (illustrative prices)")
print(f"   always-on 20 workers      : Rs {always_on:>10,.0f}")
print(f"   transient, 3h15m a night  : Rs {transient:>10,.0f}  ({transient / always_on:.0%} of always-on)")
print(f"   transient, 4 core + 16 spot: Rs {spot:>10,.0f}  ({spot / always_on:.0%})")

# --- 2. storage: 100 TB of data, HDFS x3 replication vs object storage ---------------------
data_tb = 100
DISK_TB_MONTH = 900.0     # illustrative Rs per raw TB-month of cluster disk (server + power + ops)
OBJECT_TB_MONTH = 1700.0  # illustrative Rs per TB-month of object storage (replication included)
hdfs = data_tb * 3 / 0.7 * DISK_TB_MONTH                            # x3 copies, keep disks <= 70% full
obj = data_tb * OBJECT_TB_MONTH
print("2. Storage for 100 TB a month (illustrative prices)")
print(f"   HDFS: {data_tb * 3 / 0.7:.0f} TB of raw disk  : Rs {hdfs:>10,.0f}")
print(f"   object storage, 100 TB  : Rs {obj:>10,.0f}")

# --- 3. moving data: our measured DistCp speed, and a real network link --------------------
lab_mb_s = 162 / 25.5
print("3. Moving 100 TB")
print(f"   at our lab's DistCp speed ({lab_mb_s:.1f} MB/s): {100 * 1024 * 1024 / lab_mb_s / 86400:,.0f} days")
for gbps in [1, 10]:
    mb_s = gbps * 1000 / 8 * 0.7                                      # assume 70% of the link is usable
    print(f"   over a {gbps:>2} Gbps link at 70% use ({mb_s:,.0f} MB/s): {100 * 1024 * 1024 / mb_s / 86400:5.1f} days")

# Run:  python3 cloud_vs_onprem.py
1. Compute for a month (illustrative prices) always-on 20 workers : Rs 576,000 transient, 3h15m a night : Rs 78,000 (14% of always-on) transient, 4 core + 16 spot: Rs 40,560 (7%) 2. Storage for 100 TB a month (illustrative prices) HDFS: 429 TB of raw disk : Rs 385,714 object storage, 100 TB : Rs 170,000 3. Moving 100 TB at our lab's DistCp speed (6.4 MB/s): 191 days over a 1 Gbps link at 70% use (88 MB/s): 13.9 days over a 10 Gbps link at 70% use (875 MB/s): 1.4 days

Real output of the script. The prices inside it are illustrative placeholders; the measured inputs (6.4 MB/s DistCp in our lab) are real.

8 Line by line

Which URI scheme talks to which store?

Hadoop picks a FileSystem class from the scheme of the path. Follow four paths through the lookup.

Worked examples: real problems, solved and traced in memory

Four cloud decisions from different industries, each with the numbers written out. All prices are illustrative.

Example 1BeginnerCost · media

A streaming company: always-on or nightly cluster?

Problem statement

A nightly recommendation job needs 30 workers for 4 hours. A worker costs ₹50 an hour (illustrative). Compare a month of an always-on cluster with a cluster created each night (add 15 minutes for start and stop).

Input
30 workers · 4 h a night · ₹50/hour · 30 nights
Expected output
always-on Rs 1,080,000, transient Rs 191,250 (18%)

Approach

  1. Always-on: workers × 24 h × 30 nights × price.
  2. Transient: workers × (4 + 0.25) h × 30 nights × price.
  3. Compare the ratio.

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 2IntermediateStorage · healthcare

A hospital archive: HDFS or object storage?

Problem statement

A hospital network keeps 40 TB of de-identified imaging metadata. On HDFS it needs 3 copies with disks at most 70% full, at ₹900 per raw TB-month; object storage costs ₹1,700 per TB-month (both illustrative). Which is cheaper per month?

Input
40 TB · ×3 / 0.7 · ₹900 vs ₹1,700
Expected output
HDFS 171 TB raw: Rs 154,286 | object store: Rs 68,000

Approach

  1. Raw HDFS disk = 40 × 3 / 0.7.
  2. Multiply each by its price.
  3. Remember what each price includes (servers, power, staff vs a service).

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 3IntermediateMigration · telecom

How long to move 2 PB to the cloud?

Problem statement

A telecom operator wants to move 2 PB of call-record history. Its link to the cloud is 10 Gbps, and 70% can be used for the move. How many days does the bulk copy take?

Input
2 PB · 10 Gbps · 70%
Expected output
28 days at 875 MB/s

Approach

  1. Usable speed in MB/s = 10,000 / 8 × 0.7.
  2. Size in MB = 2 × 1024 × 1024 × 1024.
  3. Days = size / speed / 86,400.

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 4AdvancedChoice · fintech

Which platform for a payments analytics team?

Problem statement

A fintech must keep raw payment data in India, runs a steady 18-hour-a-day ETL, and has bursty fraud-model training a few days a month. Score three options: (A) Cloudera on-prem only, (B) cloud only, (C) hybrid: Cloudera on-prem for raw data and ETL, cloud for training on masked data.

Input
3 options · 4 criteria
Expected output
A on-prem  total 9  (residency, steady, burst, ops) = [3, 3, 1, 2]
B cloud    total 9  (residency, steady, burst, ops) = [2, 1, 3, 3]
C hybrid   total 10  (residency, steady, burst, ops) = [3, 3, 3, 1]

Approach

  1. List the criteria: residency, steady load cost, burst cost, operations effort.
  2. Score each option 1–3 (illustrative judgement).
  3. Add up, then sanity-check the winner against the hard rule (residency).

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 13.3 in one screen

  • Cloud pattern: data in object storage (S3, GCS, ADLS via s3a://, gs://, abfs://), clusters transient and autoscaled, metadata in a shared catalog.
  • Trade-offs: no data locality; renames are copies (use cloud-aware committers or table formats); pay per hour; egress costs.
  • Spot/preemptible workers for task nodes; keep the AM/driver on regular nodes.
  • Oct 2026: EMR 7.14.0 (Hadoop 3.4.2, Spark 3.5.8, Iceberg 1.10.1); Dataproc 2.3.37 (Hadoop 3.3.6, Spark 3.5.3); HDInsight 5.1 maintenance mode; Cloudera Base on premises 7.3.2 LTS to 2032.
  • Migration path: lift-and-shift → re-platform (transient, autoscale) → re-architect (lakehouse). Hybrid is common for regulated data.
  • Illustrative calculator: 20 workers, 3 h a night → transient ≈ 14% of always-on; 100 TB on HDFS needs ≈ 429 TB raw disk.

Interview and viva questions

Is Hadoop still used in the cloud?

Its pieces are. Managed services such as Amazon EMR and Google Dataproc run YARN, Spark, Hive, HBase and other Hadoop-ecosystem projects, and Hadoop's FileSystem connectors (s3a, gs, abfs) are how those engines read cloud storage. What is used less is HDFS as the main store: data usually lives in object storage and clusters are temporary.

What is the difference between HDFS and Amazon S3 for Hadoop jobs?

HDFS stores blocks on the cluster's own disks with three copies, gives data locality and cheap renames, but lives and dies with the cluster. S3 is a separately billed object store, independent of any cluster, without data locality and where a rename is a copy. Jobs switch by changing hdfs:// to s3a:// and using a suitable committer.

What is a transient cluster?

A cluster created for a job or a batch window and deleted when the work finishes. Because the data is in object storage and table definitions are in a shared catalog, nothing is lost when the machines go away, and you pay only for the hours they ran.

What does Cloudera offer today?

A supported distribution of the open-source data stack (Hadoop, Hive, Impala, Spark, HBase, Kafka, Ranger, Atlas and others) for your own data centres (Cloudera Base on premises, with 7.3.2 announced in March 2026 as an LTS release supported through 2032) and for public clouds, managed with Cloudera Manager. Hortonworks merged into Cloudera in 2019, and MapR's platform became HPE Ezmeral Data Fabric.

Should a company move its Hadoop cluster to the cloud?

It depends on utilisation, data rules and skills. Bursty or mostly idle workloads usually save money on transient cloud clusters; steady, heavily used clusters may be cheaper on owned hardware; regulated data may need to stay in a specific location. Many organisations choose a hybrid. Compare with your own measured throughput and real prices, and treat this lesson's numbers as illustrative.

Practice problems

Cloud and Cloudera exercises using our lab measurements and illustrative prices.

P1Easy

Utilisation

A cluster runs jobs 6 hours a day. What percentage of the day is it busy?

Input
6 / 24
Expected output
25% busy
Show solution and explanation
print(f"{6 / 24:.0%} busy")
25% busy

How it works: 25%: three quarters of an always-on cluster's cost pays for idle time.

P2Easy

Change the path

Rewrite the input path hdfs://namenode/data/orders for S3 bucket "shop" and for GCS bucket "shop".

Input
one path, two stores
Expected output
s3a://shop/data/orders
gs://shop/data/orders
Show solution and explanation
path = "hdfs://namenode/data/orders"
rest = path.split("/", 3)[3]
print("s3a://shop/" + rest)
print("gs://shop/" + rest)
s3a://shop/data/orders gs://shop/data/orders

How it works: s3a://shop/data/orders and gs://shop/data/orders: the job code stays the same.

P3Easy

Raw disk for HDFS

How much raw disk does 25 TB of data need on HDFS with 3 copies and disks at most 70% full?

Input
25 × 3 / 0.7
Expected output
107 TB
Show solution and explanation
print(f"{25 * 3 / 0.7:.0f} TB")
107 TB

How it works: About 107 TB: object storage bills you for the 25 TB you store.

P4Medium

Break-even hours

Transient clusters cost 15 extra minutes per run. Above how many busy hours a day does always-on become cheaper, if spot gives no discount?

Input
hours + 0.25 vs 24
Expected output
6 transient cheaper
12 transient cheaper
18 transient cheaper
23 transient cheaper
23.75 always-on cheaper or equal
24 always-on cheaper or equal
Show solution and explanation
for h in [6, 12, 18, 23, 23.75, 24]:
    print(h, "transient cheaper" if h + 0.25 < 24 else "always-on cheaper or equal")
6 transient cheaper 12 transient cheaper 18 transient cheaper 23 transient cheaper 23.75 always-on cheaper or equal 24 always-on cheaper or equal

How it works: Only above 23.75 hours: without other differences, per-run clusters win almost always on compute; in practice storage, start-up delays and staff time decide.

P5Medium

Spot savings

A nightly job uses 10 workers for 5 hours at ₹40/hour; 8 of them can be spot at 60% off (illustrative). What is the monthly saving?

Input
10 workers · 5 h · 30 nights
Expected output
Rs 60,000 -> Rs 31,200, saving Rs 28,800
Show solution and explanation
full = 10 * 5 * 30 * 40
spot = 2 * 5 * 30 * 40 + 8 * 5 * 30 * 40 * 0.4
print(f"Rs {full:,.0f} -> Rs {spot:,.0f}, saving Rs {full - spot:,.0f}")
Rs 60,000 -> Rs 31,200, saving Rs 28,800

How it works: ₹60,000 → ₹31,200, saving ₹28,800 a month (illustrative), as long as reruns after reclaimed workers stay rare.

P6Medium

Transfer at lab speed

At our lab's DistCp speed (162 MB in 25.5 s), how many hours does a 100 GB daily increment take?

Input
100 GB · 6.35 MB/s
Expected output
4.5 hours
Show solution and explanation
mb_s = 162 / 25.5
print(f"{100 * 1024 / mb_s / 3600:.1f} hours")
4.5 hours

How it works: About 4.5 hours on our laptop lab; production clusters copy with many maps in parallel and much faster disks and networks.

P7Business problem

Idle cluster alarm

A forgotten 50-worker cluster at ₹40/hour (illustrative) runs over a long weekend of 72 hours. What does it cost, and what setting prevents it?

Input
50 × 72 × ₹40
Expected output
Rs 144,000
Show solution and explanation
print(f"Rs {50 * 72 * 40:,}")
Rs 144,000

How it works: ₹1,44,000 for nothing; enable auto-termination or an idle timeout and tag clusters with an owner.

P8Advanced

Pick the platform

Write a function that suggests on-prem, cloud or hybrid from three answers: data must stay on own premises (yes/no), average utilisation (0–1), burstiness (low/high).

Input
3 inputs
Expected output
(True, 0.8, 'high') -> hybrid: regulated data on-prem, masked data to the cloud for peaks
(False, 0.15, 'high') -> cloud with transient clusters
(False, 0.85, 'low') -> compare carefully: steady load can be cheaper on owned hardware
(True, 0.5, 'low') -> on-prem (e.g. Cloudera Base)
Show solution and explanation
def suggest(on_prem_rule, utilisation, burst):
    if on_prem_rule and burst == "high":
        return "hybrid: regulated data on-prem, masked data to the cloud for peaks"
    if on_prem_rule:
        return "on-prem (e.g. Cloudera Base)"
    if utilisation > 0.7 and burst == "low":
        return "compare carefully: steady load can be cheaper on owned hardware"
    return "cloud with transient clusters"
for case in [(True, 0.8, "high"), (False, 0.15, "high"), (False, 0.85, "low"), (True, 0.5, "low")]:
    print(case, "->", suggest(*case))
(True, 0.8, 'high') -> hybrid: regulated data on-prem, masked data to the cloud for peaks (False, 0.15, 'high') -> cloud with transient clusters (False, 0.85, 'low') -> compare carefully: steady load can be cheaper on owned hardware (True, 0.5, 'low') -> on-prem (e.g. Cloudera Base)

How it works: A simple rule of thumb in code. Real decisions also weigh skills, contracts and exit costs.

Real-world scenario questions (asked in company interviews)

Cloud-migration and platform questions are common for senior data engineers and architects.

Cloud · basicsFresher

“How is running Spark on EMR or Dataproc different from our Hadoop cluster?”

An interviewer checks whether you understand the cloud pattern.

The interviewer is checking: compute–storage separation.

Show a strong answer
  • Same engines (YARN, Spark, Hive), but data in object storage via s3a:// or gs://, not HDFS.
  • Clusters can be transient and autoscaled; you pay per hour; spot workers for task nodes.
  • Differences to handle: no data locality, renames are copies (use the right committer), shared catalog outside the cluster.
Migration · designExperienced

Plan the migration of a 1 PB on-prem cluster to the cloud

Hundreds of Hive tables, nightly Spark and MapReduce jobs, a 6-month deadline.

The interviewer is checking: phasing and risk control.

Show a strong answer
  • Inventory tables, jobs, owners and dependencies; decide what to retire.
  • Bulk copy with DistCp in waves, keep in sync with -update or snapshot-diff; migrate the metastore.
  • Move jobs table by table with parallel runs and result comparison; then switch, then decommission. Estimate network time first (1 PB at 10 Gbps ≈ 2 weeks of pure transfer).
Cost · operationsExperienced

“Our cloud bill doubled after moving off Hadoop. Why?”

A manager expected savings.

The interviewer is checking: cloud cost habits.

Show a strong answer
  • Lift-and-shift kept always-on clusters sized for peak; enable autoscaling, auto-termination and spot task nodes.
  • Check egress, small files and full-table scans (use Parquet/ORC, partitioning).
  • Tag resources per team and set budgets and alerts.
Platform · strategyArchitect

A bank asks: Cloudera on-prem, cloud, or both?

Regulated customer data, steady ETL, bursty data-science work.

The interviewer is checking: balanced reasoning without legal claims.

Show a strong answer
  • Start from data rules (confirmed with compliance), then utilisation and burst patterns.
  • Steady, regulated workloads fit on-prem (e.g. Cloudera Base with Ranger/Atlas); bursts fit cloud with masked data.
  • Plan one identity, one catalog and one policy model across both, or the hybrid becomes two silos.