The big data ecosystem map: every tool in its place

Kafka, Spark, Hive, Airflow, Iceberg, BigQuery… the big data world seems to have a new tool every week. This lesson gives you one map that never changes: six jobs that every data platform does. Follow a single food order through all six, watch the platform live at lunch rush and at 2 am, and learn the open-source and cloud names for each job.

Module 4 · The Ecosystem⏱ 25 minBeginner → AdvancedRuns in your browser (Python)3 real-time scenarios9 practice problems
1 The story

Kabir's first day: 40 tool names and one diagram

Riya's friend Kabir has just joined TiffinGo, a food-delivery startup in Pune, as a data intern. On day one his manager shows him the “data platform” diagram. It has more than forty logos on it. Kabir messages Riya in panic, and she brings him to Arjun Sir.

KafkaHadoopAirflowHive SparkHDFSFlinkPrestoS3 HBaseYARNIcebergNiFi Power BICassandraSnowflakedbt KinesisBigQueryDelta sort by job 1 · INGESTKafka, NiFi, Kinesis 2 · STOREHDFS, S3, HBase, Cassandra 3 · PROCESSSpark, Flink, dbt 4 · QUERYHive, Presto, Snowflake, BigQuery 5 · VISUALISEPower BI, Tableau 6 · ORCHESTRATEAirflow (runs all the others) Forty logos, but only six jobs. myphatshala.in
Kabir

Sir, Kafka, Flink, Hive, Iceberg, Airflow… it's like a different language. Do I have to learn all of them this week?

Arjun Sir

No. Here is the secret: almost every tool on that diagram does one of just six jobs. Bring data in, keep it, change it, ask questions of it, show it, and run all of that on a schedule.

Riya

Like a restaurant kitchen! Groceries arrive, go in the store-room, get cooked, get served, and the head chef decides the order of work.

Arjun Sir

Exactly, Riya. And Kabir, when you see a new logo, ask just one question: which of the six jobs does this do? The name changes; the job doesn't.

Kabir

So Kafka is… the delivery van bringing groceries?

Arjun Sir

Perfect. Today we'll follow one TiffinGo order through all six jobs, watch the platform at lunch rush and at 2 am, and by the end you'll be able to draw that diagram yourself.

2 Definition

What is the big data ecosystem?

Formal definition (write this in exams)

The big data ecosystem is the collection of tools and services that together form a data platform: they ingest data from sources, store it at scale, process it in batch or in real time, make it available for querying and analysis, serve the results to people and applications, and orchestrate, monitor and govern every step. Each tool specialises in one or two of these layers, and a working platform combines several of them into data pipelines.

In simple words

No single tool does everything. A data platform is a team of tools: one brings data in, one keeps it, one cleans and calculates, one answers questions, one draws the charts, and one acts as the manager who decides what runs when.

Words you'll meet in this lesson

Data sourceWhere data is born: an app, a website, a database, a sensor, a log file.
IngestionBringing data from sources into the platform, continuously or in batches.
Data pipelineA chain of steps that moves data from a source to a useful result.
TopicIn Kafka, a named stream of events, like orders or payments.
Data lakeCheap, huge storage that keeps raw files of any format (more in Lesson 4.3).
Data warehouseOrganised, clean tables built for fast SQL questions.
DAGDirected Acyclic Graph: a list of tasks with arrows showing which must finish first. Airflow pipelines are DAGs.
OrchestratorThe tool that schedules tasks, runs them in the right order and retries failures.

The six layers at a glance

1. IngestCollect data from apps, databases and devices · Kafka, NiFi, Debezium, Flume, Sqoop (older)
2. StoreKeep data safely at huge scale · HDFS, Amazon S3 / Azure ADLS / Google Cloud Storage, HBase, Cassandra
3. ProcessClean, join, aggregate · Spark, Flink, MapReduce (older), Kafka Streams, dbt
4. Query & analyseAnswer questions with SQL · Hive, Trino/Presto, Spark SQL, Snowflake, BigQuery, Redshift
5. Visualise & serveShow results to people and apps · Power BI, Tableau, Superset, APIs, ML models
6. Orchestrate & governSchedule, monitor, secure, catalogue · Airflow, Oozie (older), YARN/Kubernetes, data catalogs

The same map at three levels

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

Beginner The restaurant kitchen

Think of TiffinGo's data platform as a big restaurant kitchen:

  • Ingest = the delivery van that brings vegetables every few minutes.
  • Store = the store-room and fridge. Everything is kept, even things you might need later.
  • Process = the cooks who wash, cut and cook raw vegetables into dishes.
  • Query = the order counter, where anyone can ask “how many thalis today?”
  • Visualise = the menu board and the plated food: results people can see.
  • Orchestrate = the head chef with a timetable: dal must be ready before rice is served.

If you remember the kitchen, you can place any tool. That is all you need for now.

Intermediate What each layer must handle, and how to pick a tool

  • Ingest must cope with many sources and bursts. Use Kafka for continuous events (orders, clicks), CDC tools like Debezium to copy database changes, and file or API pulls for daily batches.
  • Store must be cheap, huge and safe. Raw files go to HDFS or cloud object storage (S3, ADLS, GCS); fast lookups by key go to NoSQL (HBase, Cassandra).
  • Process splits into batch (Spark on yesterday's data) and stream (Flink or Spark Streaming on events as they arrive). That's Lesson 4.2.
  • Query gives analysts SQL: Hive/Trino on lake files, or a warehouse like Snowflake or BigQuery for clean tables.
  • Orchestrate: Airflow runs the daily DAG: check data arrived → Spark job → load warehouse → refresh dashboard, and retries failures.

Quick rule: “Need it live?” → stream tools. “Need SQL?” → query engine or warehouse. “Need it every night at 2 am?” → orchestrator.

Advanced How real platforms are designed today

  • Storage and compute are separated. Data sits in object storage; Spark, Trino or a warehouse start compute only when needed, and scale independently. Old Hadoop clusters tied both to the same machines.
  • Open table formats (Apache Iceberg, Delta Lake, Apache Hudi) add database features (transactions, schema changes, time travel) to files in a lake. This is the lakehouse idea, covered in Lesson 4.3.
  • Resource managers moved: many teams now run Spark and Flink on Kubernetes instead of Hadoop's YARN. Kafka 4.0 removed its ZooKeeper dependency in favour of its built-in KRaft mode.
  • Legacy you will still meet: MapReduce, Sqoop (retired by Apache in 2021), Flume and Oozie appear in exams and older clusters, but are rarely chosen for new projects.
  • Managed vs self-hosted: cloud services (EMR, Dataproc, Databricks, BigQuery) trade higher unit prices and some lock-in for far less operations work. The right answer depends on team size, scale and cost.
  • Governance is a layer, not an afterthought: a catalog (what data exists), lineage (where it came from), access control and data-quality checks.

Exam tip: Draw the layered architecture: sources → ingestion → storage → processing (batch + stream) → query/analysis → visualisation, with orchestration and governance down the side. Name two tools per layer. This one diagram answers most “explain the Hadoop / big data ecosystem” questions.

3 Types and ways to use it

Three ways to build the same platform

Classic Hadoop (on-premises)

HDFS for storage, YARN for resources, MapReduce/Hive/Spark for processing, Oozie for scheduling, all on the company's own servers.

2008 → still in banks, telecom, government

Cloud-native, open source

Object storage (S3/ADLS/GCS), Spark or Flink on Kubernetes, Kafka, Trino, Airflow. You run the tools; the cloud provides machines.

Flexible

Fully managed cloud

Kinesis or Pub/Sub, a cloud warehouse (BigQuery, Snowflake, Redshift), managed Spark (Databricks, EMR, Dataproc), managed Airflow.

Least ops work

One layer, three names: open source vs the big clouds

LayerOpen sourceAWSAzureGoogle Cloud
Ingest (stream)KafkaKinesis, MSKEvent HubsPub/Sub
Store (lake)HDFSS3ADLS Gen2Cloud Storage
ProcessSpark, FlinkEMR, GlueDatabricks, Synapse SparkDataproc, Dataflow
Query / warehouseHive, TrinoAthena, RedshiftSynapse, FabricBigQuery
OrchestrateAirflowMWAA, Step FunctionsData FactoryCloud Composer
VisualiseSupersetQuickSightPower BILooker

Cloud product names change often; the layers don't. Learn the layer first, then the local name.

Which tool for which question?

If the question is……you're in this layerTypical tool
“How do app events reach us within a second?”Ingest (stream)Kafka
“Where do we keep five years of raw logs cheaply?”StoreS3 / HDFS
“Clean and join 2 TB of orders every night”Process (batch)Spark
“Alert if a kitchen gets 50 orders in 5 minutes”Process (stream)Flink, Spark Streaming
“Analysts want SQL on all of it”QueryTrino, Hive, a warehouse
“Run all of the above at 2 am, in order, with retries”OrchestrateAirflow

Kafka is not Airflow. A common beginner mix-up: Kafka moves data continuously; Airflow schedules jobs and moves no data itself. One is the delivery van, the other is the head chef's timetable.

4 Step by step

Follow one TiffinGo order through all six layers

  1. Source: the app creates an event

    {"order_id": 90017, "user": "kabir", "kitchen": "K12", "city": "Pune",
     "item": "veg thali", "amount": 120, "ts": "2026-10-19T12:31:08"}
    The moment Kabir taps Place order, the app sends this event. At lunch rush thousands of phones send events like this every minute.
  2. Ingest: Kafka receives it

    kafka-console-producer --topic orders --bootstrap-server broker1:9092
    The event is appended to the orders topic. Kafka doesn't process it; it keeps events in order, durably, and lets many systems read them: the live dashboard, the fraud checker and the lake loader.
  3. Store: raw copy in the lake

    s3://tiffingo-lake/raw/orders/date=2026-10-19/hour=12/part-0003.json
    A loader writes Kafka events into the lake every few minutes, in folders by date and hour. Raw data is never changed, so it can always be reprocessed if a bug is found later.
  4. Process: Spark cleans and joins

    orders = spark.read.json("s3://tiffingo-lake/raw/orders/date=2026-10-19/")
    kitchens = spark.read.parquet("s3://tiffingo-lake/clean/kitchens/")
    daily = (orders.dropDuplicates(["order_id"])
                   .join(kitchens, "kitchen")
                   .groupBy("city", "kitchen_name").sum("amount"))
    daily.write.mode("overwrite").parquet("s3://tiffingo-lake/gold/daily_sales/date=2026-10-19/")
    This is real PySpark (you'll write it in the Spark course). Spark splits the day's files across many executors, removes duplicate events, joins kitchen names and totals sales, exactly the partition → process → combine pattern from Lesson 1.3.
  5. Query: SQL on the result

    SELECT city, SUM(amount) AS revenue
    FROM gold.daily_sales
    WHERE date = '2026-10-19'
    GROUP BY city ORDER BY revenue DESC;
    Trino, Hive or a warehouse runs this SQL directly over the Parquet files or loaded tables. Analysts never need to know where the files live.
  6. Visualise and orchestrate

    The Power BI dashboard refreshes, and the city manager sees yesterday's sales at 6 am.

    Behind all of it, an Airflow DAG ran at 2 am: check raw data arrived → run Spark job → check row counts → load warehouse → refresh dashboard. If Spark fails, Airflow retries it and alerts the on-call engineer.
5 See it happen

One order: what Kabir sees, and what the platform does

Step through the six frames. Left: Kabir's phone and his manager's dashboard. Right: the layer that is working at that moment.

An order travels the ecosystem 6 steps
What you see TiffinGo Veg thali ₹120 Place order Order placed Kitchen K12 confirmed Arriving in 24 min Rider is on the way City manager · Daily sales 02:00 · the dashboard is still showing the day before yesterday… Yesterday, by city (₹ lakh) Pune 14.9 Mumbai 11.2 Nashik 6.7 Updated 05:42 ✓ ready before 06:00 Kabir's ₹120 is inside the Pune bar. myphatshala.in
Behind the screen Source Ingest · Kafka Store · S3 Process · Spark Query · SQL Visualise · BI Source {"order_id": 90017, "kitchen": "K12","city": "Pune", "amount": 120,"ts": "2026-10-19T12:31:08"} The app turns the tap into an event. Ingest · Kafka topic: orders 90017 → live dashboard→ fraud checker→ lake loader Appended to the end of the log; many readers. Store · S3 raw/orders/date=2026-10-19/hour=12/part-0003.json ← here Raw copy kept forever, organised by date. Process · Spark executor 1 executor 2 executor 3 executor 4 dedupe → join kitchens → sum by city 02:10 · yesterday's files processed in parallel. Query · SQL Visualise · BI SELECT city, SUM(amount)FROM gold.daily_sales GROUP BY city;Pune 14.9 L · Mumbai 11.2 L · … The dashboard runs SQL over the clean table. Airflow DAG · daily_sales · 02:00 check raw spark job row checks load DW refresh each box waits for the one before it The orchestrator ran every layer, in order. myphatshala.in
6 Real-world use

The ecosystem in real time: three live scenarios

The same layers behave very differently at lunch rush, at 2 am and when a company moves to the cloud. Watch all three.

Real-time scenario 1

Lunch rush: the streaming path saves a kitchen

12:00 to 13:00 on a weekday. Orders flow through Kafka into a stream processor (Flink) that counts orders per kitchen every minute. Watch what happens when one kitchen is overloaded.

Live orders per kitchen 5 steps
Animated example orders in the last 5 minutes · limit 40 limit K11K12K13 12:00 · calm. Each order event updates its kitchen's count. 12:25 · offices break for lunch. Counts climb every minute. 12:41 · K12 crosses 40 orders in 5 min → ALERTdetected 2 seconds after the 41st order arrived App shows K12 as “busy, +15 min”new customers pick K11 and K13 instead 13:00 · load balanced, no late deliveriesa nightly batch report would have found this tomorrow myphatshala.in
Real-time scenario 2

2 am: the orchestrator handles a failure while everyone sleeps

The nightly daily_sales DAG starts at 02:00. Halfway through, a cloud machine running the Spark job disappears. Watch Airflow deal with it.

An Airflow night 5 steps
Animated example check raw spark job row checks load DW refresh BI check raw ✓ running… failed ✗ retry 1… spark job ✓ row checks ✓ load DW ✓ refresh BI ✓ 02:00 DAG daily_sales started 02:03 check raw: 288 files found ✓ 02:04 spark job submitted (40 executors) 02:20 stage 3 of 5 … 02:31 ERROR executor lost (machine reclaimed) 02:31 downstream tasks wait: upstream_failed 02:36 retry 1 of 3 after 5 min delay 02:36 Slack alert sent to on-call (info) 03:58 spark job succeeded 05:42 dashboard refreshed ✓ Nothing after the failed task runs on bad data.The dashboard keeps showing the last good numbers. Recovered without anyone waking up.The on-call engineer reads the alert over breakfast. myphatshala.in
Real-time scenario 3 · Advanced

Moving to the cloud: same layers, new names

TiffinGo's investors want it on the cloud. The team maps every layer of their open-source stack to a managed service. Watch the map change, and notice what stays the same.

One platform, four stacks 5 steps
Animated example IngestStoreProcessQueryOrchestrate OpenKafkaHDFSSparkHiveAirflow AWSKinesisS3EMRAthenaMWAA AzureEvent HubsADLSDatabricksSynapseData Factory GCPPub/SubGCSDataprocBigQueryComposer Today: the open-source stack TiffinGo runs itself. On AWS, each layer gets a managed service. Azure has its own names for the same jobs… …and so does Google Cloud. Read down a column: one job, four names.Learn the layers once; switching clouds is just new vocabulary. myphatshala.in

Where you'll see the ecosystem at work

1. Food delivery: live ETAs

Rider GPS pings every few seconds go through Kafka to a stream processor that updates arrival times. The same pings are stored in the lake and used overnight to retrain the ETA model.

GPS pings→Kafka → Flink · lake → Spark→ETA on your phone
₹

2. Banking: regulatory reports

Core banking databases are copied nightly with CDC into the lake, Spark builds risk and compliance tables, and orchestrated jobs produce the reports banks must file with regulators on time.

Core banking DB→CDC → lake → Spark → warehouse→Regulatory report

3. Smart electricity meters

Smart meters send readings every 15 minutes. Utilities ingest them as streams, store years of history for billing disputes, and run batch jobs to forecast demand and find power theft patterns.

Meter readings→Stream ingest → lake → batch models→Bills + forecasts

4. E-commerce search

Every search and click is ingested, stored in the lake, and processed daily to improve search ranking. Analysts query the click tables with SQL to find searches that return nothing useful.

Searches + clicks→Kafka → lake → Spark + Trino→Better results

5. Streaming video: what to watch next

Play, pause and skip events feed both a real-time path (what's trending right now) and a batch path (recommendations recomputed nightly), all scheduled and monitored by an orchestrator.

Viewing events→Stream + batch on one platform→Your home screen

Simplified to show the layers. Real platforms vary by company.

7 Run the code

Build a tiny data platform in Python

Each function below plays the role of one layer. ingest accepts every event like Kafka, store keeps raw copies like a data lake, process cleans like Spark, serve answers a question like a SQL engine, and the last three lines are the orchestrator. Notice how the corrupted event and the wrong data type are handled in process, never by changing the raw copy.

import json

raw_events = [
    '{"order": 1, "city": "Pune", "item": "thali", "amount": 120}',
    '{"order": 2, "city": "Mumbai", "item": "biryani", "amount": 250}',
    '{"order": 3, "city": "Pune", "item": "thali", "amount": 120}',
    '{"order": 4, "city": "Pune", "item": "dosa", "amount": "90"}',
    'CORRUPTED###',
]

def ingest(events):                 # like Kafka: accept everything, in order
    print("INGEST :", len(events), "events received")
    return list(events)

def store(events, lake):            # like a data lake: keep the raw copy
    lake["raw/orders"] = events
    print("STORE  :", len(events), "raw events saved")

def process(lake):                  # like Spark: parse, clean, fix types
    clean = []
    for e in lake["raw/orders"]:
        try:
            r = json.loads(e)
        except json.JSONDecodeError:
            continue                # skip broken events (real systems log them)
        r["amount"] = int(r["amount"])
        clean.append(r)
    lake["clean/orders"] = clean
    print("PROCESS:", len(clean), "clean rows")

def serve(lake):                    # like Hive / a warehouse: answer a question
    by_city = {}
    for r in lake["clean/orders"]:
        by_city[r["city"]] = by_city.get(r["city"], 0) + r["amount"]
    print("SERVE  : revenue by city ->", by_city)

# ORCHESTRATE: like Airflow, run each layer in the right order
lake = {}
store(ingest(raw_events), lake)
process(lake)
serve(lake)
INGEST : 5 events received STORE : 5 raw events saved PROCESS: 4 clean rows SERVE : revenue by city -> {'Pune': 330, 'Mumbai': 250}
  • lake["raw/orders"] = eventsThe raw copy is saved before cleaning. If the cleaning code has a bug, you fix it and reprocess from raw. That is why lakes keep raw data.
  • except json.JSONDecodeError:One broken event must not stop the platform. The processing layer skips it; real pipelines also write it to an error table for checking.
  • r["amount"] = int(r["amount"])Order 4 sent the amount as text "90". Fixing types is a typical processing job.
  • store(ingest(raw_events), lake)The last three lines are the orchestrator: they decide the order. Swap process and serve and see what breaks.
8 Line by line

One pipeline, one line at a time

A smaller pipeline: three raw events, a process layer and a serve layer. Watch the lake dictionary gain a "clean" copy while "raw" stays untouched, and watch each layer get its own frame on the stack.

Worked examples: real problems, solved and traced in memory

Four problems, from first-week intern to platform architect. Each runs live and is traced line by line.

Example 1BeginnerFirst week · reading a diagram

Sort a stack into layers, and spot the gap

Problem statement

Your team's platform uses Spark, Kafka, Power BI, S3, Airflow and Hive. Print the tools under each of the six layers, and flag any layer with no tool.

Input
stack: Spark, Kafka, Power BI, S3, Airflow, Hive
Expected output
Ingest       ['Kafka']
Store        ['S3']
Process      ['Spark']
Query        ['Hive']
Visualise    ['Power BI']
Orchestrate  ['Airflow']

Approach

  1. Keep a lookup table from tool to layer.
  2. Group the stack into a dictionary of lists with setdefault.
  3. Print the six layers in order, showing “(missing!)” where a list is empty.

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 2IntermediateFood delivery · latency

When does an order appear on each dashboard?

Problem statement

An order can reach a dashboard by two paths. The streaming path: app → Kafka (0.2 s) → Flink (0.5 s) → live dashboard (1 s). The batch path: app → Kafka (0.2 s) → hourly dump to S3 (up to 3,600 s) → nightly Spark job (up to 6 hours) → report (10 minutes). Print the worst-case delay for each.

Input
two lists of (stage, seconds)
Expected output
Streaming path: 1.7 seconds
Batch path    : 7.2 hours

Approach

  1. Write a function that adds up the seconds in a path.
  2. Call it for both paths.
  3. Show the result in readable units: seconds and hours.

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 3IntermediatePlatform team · orchestration

Work out the run order of a DAG by hand

Problem statement

Four tasks: ingest needs nothing, clean needs ingest, features needs clean, report needs clean. Find an order that respects every dependency, the way an orchestrator does.

Input
needs: clean←ingest, features←clean, report←clean
Expected output
['ingest', 'clean', 'features', 'report']

Approach

  1. Repeatedly pick tasks whose requirements are all done.
  2. Mark them done and add them to the order.
  3. Stop when every task is done.

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 4AdvancedCloud migration · architecture

Translate an open-source stack to a cloud

Problem statement

TiffinGo will move to one cloud. Given the open-source tool for each layer, print the typical managed service on AWS, Azure or Google Cloud.

Input
stack per layer + chosen cloud
Expected output
Ingest      Kafka    -> Pub/Sub
Store       HDFS     -> Cloud Storage
Process     Spark    -> Dataproc
Query       Hive     -> BigQuery
Orchestrate Airflow  -> Cloud Composer

Approach

  1. Store one mapping per cloud: layer → service.
  2. Keep the current stack as layer → open-source tool.
  3. Print “open-source → managed” for each layer of the chosen cloud.

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.1 in one screen

  • Six jobs: Ingest → Store → Process → Query → Visualise, with Orchestrate & govern across all of them.
  • Ingest: Kafka, NiFi, CDC · Store: HDFS, S3/ADLS/GCS, HBase, Cassandra · Process: Spark, Flink.
  • Query: Hive, Trino, Spark SQL, Snowflake, BigQuery · Visualise: Power BI, Tableau · Orchestrate: Airflow.
  • Kafka moves data; Airflow schedules jobs. Don't mix them up.
  • Keep the raw copy; clean in the processing layer; reprocess from raw when logic changes.
  • Cloud names differ, layers don't: Kinesis/Event Hubs/Pub/Sub are all “ingest”.
  • Advanced: storage–compute separation, open table formats (lakehouse), Kubernetes, governance and lineage.

Interview and viva questions

Explain the Hadoop / big data ecosystem.

A big data platform is built in layers. Ingestion tools (Kafka, Flume, Sqoop, NiFi) bring data in; storage (HDFS, HBase, cloud object storage) keeps it; processing engines (MapReduce, Spark, Flink) transform it in batch or streaming mode; query tools (Hive, Pig historically, Trino) give SQL access; visualisation tools present it; and coordination and scheduling (YARN, ZooKeeper, Oozie/Airflow) manage resources and workflows. Each tool specialises in one layer and they are combined into pipelines.

What is the difference between Kafka and Airflow?

Kafka is a distributed, durable event log: it moves streams of events continuously from producers to consumers. Airflow is a workflow orchestrator: it schedules and monitors batch tasks (like a Spark job) in dependency order. Kafka carries data; Airflow carries none, it only tells other tools when to run.

What is a data pipeline?

A sequence of steps that moves data from sources to a useful destination: extract or ingest, store, transform (clean, join, aggregate) and load into a place where it is queried or served. Pipelines can be batch (scheduled) or streaming (continuous).

Why do companies use managed cloud services instead of running Hadoop themselves?

Managed services remove the work of installing, patching, scaling and monitoring clusters, let compute scale up and down with demand, and separate storage from compute. The trade-offs are cost at large steady scale, less control, and some dependence on one provider.

What is the role of orchestration and governance in the ecosystem?

Orchestration schedules pipelines, runs tasks in the right order, retries failures and alerts people. Governance makes data trustworthy and safe: catalogues of what data exists, lineage of where it came from, access control, and data-quality checks.

Practice problems

From reading a platform diagram to reasoning like an architect. Problems are marked Easy, Medium, Advanced and Business.

P1Easy

Count tools per layer

Count how many tools in the list belong to each layer.

Input
Kafka:Ingest, NiFi:Ingest, S3:Store, Spark:Process, Flink:Process, Hive:Query
Expected output
{'Ingest': 2, 'Store': 1, 'Process': 2, 'Query': 1}
Show solution and explanation
tools = [("Kafka", "Ingest"), ("NiFi", "Ingest"), ("S3", "Store"),
         ("Spark", "Process"), ("Flink", "Process"), ("Hive", "Query")]
count = {}
for name, layer in tools:
    count[layer] = count.get(layer, 0) + 1
print(count)
{'Ingest': 2, 'Store': 1, 'Process': 2, 'Query': 1}

How it works: A dictionary counter: the most-used pattern in data engineering code.

P2Easy

Total pipeline delay

Stages take 2, 45, 300 and 30 seconds. Print the total delay in minutes.

Input
[2, 45, 300, 30]
Expected output
6.3 minutes
Show solution and explanation
print(round(sum([2, 45, 300, 30]) / 60, 1), "minutes")
6.3 minutes

How it works: 377 seconds ≈ 6.3 minutes from source to dashboard.

P3Easy

Which layers are missing?

A startup has tools for Ingest, Store and Visualise only. Print the missing layers.

Input
have: Ingest, Store, Visualise
Expected output
['Orchestrate', 'Process', 'Query']
Show solution and explanation
all_layers = {"Ingest", "Store", "Process", "Query", "Visualise", "Orchestrate"}
have = {"Ingest", "Store", "Visualise"}
print(sorted(all_layers - have))
['Orchestrate', 'Process', 'Query']

How it works: Set difference gives what is in the first set but not the second.

P4Medium

Find the bottleneck stage

Given stage durations, print the slowest stage and its share of the total time.

Input
ingest 5, store 20, spark 900, load 60, refresh 15 (seconds)
Expected output
spark takes 90 % of the time
Show solution and explanation
stages = {"ingest": 5, "store": 20, "spark": 900, "load": 60, "refresh": 15}
slowest = max(stages, key=stages.get)
share = stages[slowest] / sum(stages.values()) * 100
print(slowest, "takes", round(share), "% of the time")
spark takes 90 % of the time

How it works: Speed up the bottleneck first; improving a 5-second stage changes almost nothing.

P5Medium

Raw vs Parquet size

The lake receives 500 GB of raw JSON a day. Converted to compressed Parquet it is about one fifth of the size. Print the yearly size of each in TB.

Input
500 GB/day, ratio 1/5
Expected output
Raw JSON    : 178.2 TB per year
Parquet     : 35.6 TB per year
Show solution and explanation
raw_tb = 500 * 365 / 1024
print("Raw JSON    :", round(raw_tb, 1), "TB per year")
print("Parquet     :", round(raw_tb / 5, 1), "TB per year")
Raw JSON : 178.2 TB per year Parquet : 35.6 TB per year

How it works: Columnar, compressed formats are why the processing layer rewrites raw data. More in Lesson 4.3.

P6Advanced

What must be skipped after a failure?

Given which tasks depend on which, print every task that cannot run because clean failed (all tasks downstream of it).

Input
clean→features, clean→report, features→model, report→email
Expected output
Skipped: ['features', 'report', 'model', 'email']
Show solution and explanation
downstream = {"clean": ["features", "report"], "features": ["model"],
              "report": ["email"], "model": [], "email": []}
to_skip, queue = [], ["clean"]
while queue:
    task = queue.pop(0)
    for nxt in downstream[task]:
        if nxt not in to_skip:
            to_skip.append(nxt)
            queue.append(nxt)
print("Skipped:", to_skip)
Skipped: ['features', 'report', 'model', 'email']

How it works: A breadth-first walk over the DAG: exactly how an orchestrator marks tasks as upstream_failed.

P7Advanced

Hot and cold storage tiers

Data is kept 30 days in fast “hot” storage (Rs 2 per GB-month) and then moved to “cold” archive (Rs 0.3 per GB-month) for 1 year. With 100 GB arriving per day, print the monthly cost once the system is full (illustrative prices).

Input
100 GB/day, hot 30 days, cold 365 days
Expected output
Hot : 3000 GB
Cold: 36500 GB
Monthly cost: Rs 16950
Show solution and explanation
hot_gb = 100 * 30
cold_gb = 100 * 365
cost = hot_gb * 2 + cold_gb * 0.3
print("Hot :", hot_gb, "GB")
print("Cold:", cold_gb, "GB")
print("Monthly cost: Rs", round(cost))
Hot : 3000 GB Cold: 36500 GB Monthly cost: Rs 16950

How it works: Most data is cold. Tiering is a standard storage-layer design decision.

P8Business problem

Is the dashboard fresh?

Each dashboard must be updated within its freshness limit (hours). Print which ones are stale.

Input
sales: 5h old, limit 24 · fraud: 2h old, limit 1 · stock: 30h old, limit 24
Expected output
sales  OK
fraud  STALE
stock  STALE
Show solution and explanation
dashboards = {"sales": (5, 24), "fraud": (2, 1), "stock": (30, 24)}
for name, (age, limit) in dashboards.items():
    print(f"{name:6}", "OK" if age <= limit else "STALE")
sales OK fraud STALE stock STALE

How it works: Freshness checks are a governance task: someone must notice before the business does.

P9Business problem

Managed or self-hosted?

Self-hosting needs 2 engineers at Rs 1.5 lakh/month each plus Rs 1 lakh of servers. A managed service costs Rs 3.2 lakh/month and needs 0.5 engineer. Print both monthly costs (illustrative).

Input
as given
Expected output
Self-hosted: Rs 4.0 lakh
Managed    : Rs 3.95 lakh
Show solution and explanation
self_hosted = 2 * 1.5 + 1.0
managed = 3.2 + 0.5 * 1.5
print("Self-hosted: Rs", self_hosted, "lakh")
print("Managed    : Rs", managed, "lakh")
Self-hosted: Rs 4.0 lakh Managed : Rs 3.95 lakh

How it works: People cost often outweighs machine cost. That is why many teams choose managed services despite higher unit prices.

Real-world scenario questions (asked in company interviews)

Questions that test whether you understand the ecosystem, not just its names. Decide your answer first, then open the model answer.

Any company · first weekFresher

“Walk me through our platform diagram”

In your first week, your lead points at a diagram with 25 logos and asks you to explain how data flows from the mobile app to the CEO's dashboard.

The interviewer is checking: can you organise tools by job and tell a clear story, instead of listing names?

Show a strong answer

Follow one record through the layers, naming the tool at each step:

  1. Source → ingest: the app sends events to Kafka.
  2. Store: a loader writes raw events into the lake (S3/HDFS), partitioned by date.
  3. Process: Spark cleans, de-duplicates and joins them nightly; Flink handles the live path.
  4. Query: results land in warehouse tables; analysts use SQL.
  5. Visualise: the BI dashboard reads those tables.
  6. Orchestrate and govern: Airflow schedules the nightly steps; the catalog documents the tables.

Avoid: reading the logos left to right without saying what each one does.

Startup · tool confusionFresher

“Can't we just use Kafka to schedule our nightly jobs?”

A product manager notices Kafka is already installed and asks why the team also needs Airflow.

The interviewer is checking: do you know the difference between moving data and orchestrating work?

Show a strong answer

Kafka moves events continuously from producers to consumers; it has no idea of “run the Spark job at 2 am, then load the warehouse, retry three times if it fails”. Airflow does exactly that: schedules, dependencies, retries, alerts and a history of every run. They solve different problems and are commonly used together.

Avoid: claiming one tool can replace every layer.

E-commerce · debugging1–3 years

At 11 am the dashboard still shows the day before yesterday

The sales head complains the dashboard is a day behind. Nobody received an alert. Where do you look, and in what order?

The interviewer is checking: can you debug a pipeline layer by layer, starting from the orchestrator?

Show a strong answer
  1. Orchestrator first: did last night's DAG run? Which task failed or is still running? Why was no alert sent?
  2. Ingestion: did yesterday's raw files arrive in the lake (count, size, partition)? Is the Kafka loader lagging?
  3. Processing: did the Spark job fail, or succeed with zero rows?
  4. Load and serve: was the warehouse table updated? Did the dashboard refresh, or is it cached?
  5. Fix, re-run from the failed task, then fix the missing alert and add a freshness check.

Avoid: re-running the whole pipeline blindly before knowing which layer broke.

Telecom · cloud migration3+ years

Moving an on-premises Hadoop cluster to the cloud

A telecom company runs a 200-node Hadoop cluster (HDFS, YARN, Hive, Spark, Oozie). Leadership wants to move to the cloud. What maps to what, and what really changes?

The interviewer is checking: do you understand the architectural shift, not only the product names?

Show a strong answer
  • Mapping: HDFS → object storage; YARN → managed Spark or Kubernetes; Hive tables → a catalog over the lake or a cloud warehouse; Oozie → Airflow (managed).
  • Real change: storage and compute separate. Clusters become temporary: start for a job, shut down after. Cost moves from fixed hardware to pay-per-use, so idle clusters and inefficient queries now cost real money.
  • Plan: migrate data in waves, run old and new in parallel and compare outputs, convert to columnar formats, set up access control and cost monitoring from day one.

Avoid: “lift and shift” of the same always-on 200 nodes into cloud VMs, which usually costs more and gains little.