When not to use Hadoop

Hadoop is brilliant for very large, batch, on-premises data with a team to run it, and a poor choice almost everywhere else. This lesson gives you a five-question checklist (size, latency, updates, team, location), the better tool for each case Hadoop handles badly, the situations where Hadoop is still the right answer, and the cost arithmetic behind the decision. Interviewers value this judgement as much as Hadoop knowledge itself.

Module 3 · How one Hadoop cluster works⏱ 22 minBeginner → AdvancedDecision checklistRuns in your browser (Python)Test your own PC's speed8 practice problems
1 The story

“We need Hadoop!” — “Do you, though?”

Kabir's friend runs a small startup that sells home-made pickles online. He calls Kabir excitedly: “Our investors said we must be data-driven. We have 18 months of orders, 40 GB. Can you set up a Hadoop cluster for us? Ten servers should be enough, right?” Kabir, now feeling like a Hadoop expert, starts listing server specs. Arjun Sir, overhearing, raises an eyebrow.

Your data problem Fits on one machine?DuckDB, pandas,PostgreSQL Millisecondlookups?OLTP database Small team, cloud,SQL analytics?cloud warehouse Seconds-oldevents?Kafka + Flink Huge batch data,on-prem, skilled team?Hadoop / Spark 40 GB of orders, 3 people, no ops team → definitely not a 10-node Hadoop cluster Choosing not to use Hadoop is also an expert decision. myphatshala.in
Arjun Sir

Kabir, how big is 40 GB compared with your laptop's SSD?

Kabir

…Much smaller. It would fit ten times over.

Arjun Sir

And how many people in that startup will look after ten servers, Kerberos, upgrades, failed disks?

Kabir

Nobody. It's three people, and they sell pickles.

Riya

So what should they use?

Arjun Sir

A good database, or even a single machine with a fast analytical tool, or a cloud data warehouse that bills per query. Hadoop is brilliant for the problem it was built for: very large, batch, on-premises data with a team to run it. Using it for small or real-time problems wastes money and makes things slower. Today you'll learn to say “no, use this instead” with clear reasons, which interviewers value as much as knowing Hadoop itself.

2 Definition

When Hadoop is the wrong tool

Formal definition (write this in exams)

Hadoop is designed for high-throughput batch processing of very large, mostly append-only data sets on clusters operated by a skilled team. It is a poor fit when: the data comfortably fits on one machine; the workload needs low-latency reads or writes of individual records (OLTP); results must be produced in real time from streaming events; data must be updated or deleted frequently at record level; the data consists of very many small files; work is iterative or interactive and MapReduce is the engine; or the organisation lacks the operational capacity to run a distributed system, in which case managed cloud services or simpler tools have a lower total cost of ownership.

In simple words

Use Hadoop for huge data, processed in big batches, by a team that can run a cluster. Don't use it for small data, instant answers, live streams, constantly changing records, millions of tiny files, or when nobody can look after the cluster. Something simpler or more specialised will be faster and cheaper.

Words you'll meet in this lesson

OLTPOnline transaction processing: many small, fast reads and writes (orders, payments). Databases like PostgreSQL, MySQL, Oracle.
OLAPOnline analytical processing: big scans and aggregations for reports. Warehouses, Hive, Spark SQL.
TCOTotal cost of ownership: hardware + software + people + power + downtime over several years.
Cloud data warehouseManaged analytical database billed by storage and usage: BigQuery, Snowflake, Redshift, Synapse.
Embedded analytics engineA fast analytical library on one machine, such as DuckDB or Polars. Handles tens to hundreds of GB on a good laptop or server.
Stream processingProcessing events continuously as they arrive (Kafka, Flink, Spark Structured Streaming).
LakehouseFiles in cheap object storage plus table formats (Iceberg, Delta, Hudi) that add SQL tables, updates and transactions.
Over-engineeringBuilding a more complex system than the problem needs.

Rough thresholds (2026, approximate)

Up to tens of GBA laptop with pandas/Polars/DuckDB, or a single database server
Hundreds of GB to a few TBOne large server (hundreds of GB RAM, NVMe) with DuckDB/PostgreSQL, or a cloud warehouse
Tens of TB to petabytes, batchDistributed: Spark on Hadoop/YARN or Kubernetes, a lakehouse, or a cloud warehouse
Response in millisecondsOLTP database or key–value store (or HBase on HDFS), not MapReduce/Hive
Results within seconds of an eventKafka + Flink or Spark Structured Streaming

Thresholds move every year as single machines get faster. Measure your own workload before deciding.

The decision at three levels

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

Beginner You don't hire a truck to carry a bag

  • A truck (Hadoop) is perfect for moving a whole house. For one bag of vegetables, a scooter (a laptop or a database) is faster, cheaper and needs no special driver.
  • A truck is also wrong for delivering a pizza in 10 minutes (real-time) or for changing one item in a parcel again and again (updates).
  • And a truck needs a licensed driver and maintenance (an operations team). If you don't have one, rent a delivery service (the cloud).

Intermediate Six warning signs

  • Small data: under ~1 TB and not growing fast. One machine is simpler and often faster.
  • Point lookups: “show this customer's balance in 50 ms”. Use a database or HBase.
  • Real time: “alert within 2 seconds of a suspicious payment”. Use streaming.
  • Frequent updates: “change order status 10 times a day”. Use a database, or a lakehouse table format.
  • Millions of small files: each costs NameNode memory and a task. Combine them or use an object store.
  • No one to run it: a cluster needs patching, monitoring, security, capacity planning. Use managed services.

Advanced The modern landscape: what replaced Hadoop where

  • Engine: Spark (and Flink, Trino) replaced MapReduce for most processing, often still on YARN or now on Kubernetes.
  • Storage: cloud object storage (S3, GCS, ADLS) replaced HDFS for many new cloud platforms; separate compute and storage scale independently.
  • Tables: Iceberg, Delta Lake and Hudi brought updates, time travel and schema evolution to files, which Hive tables on HDFS lacked.
  • Warehouses: serverless warehouses let small teams query terabytes with SQL and no cluster at all.
  • Where Hadoop still wins: large on-premises estates with existing investment, strict data-residency or air-gapped environments, steady heavy batch load where owned hardware is cheaper than cloud, and teams already skilled in it.

Exam tip: For “Discuss the limitations of Hadoop” or “When should Hadoop not be used?”, list: small data, low-latency/OLTP, real-time streaming, frequent updates, small files, iterative/interactive workloads with MapReduce, operational complexity/security setup, and name a better alternative for each.

3 Types and ways to use it

Better tools for the jobs Hadoop is bad at

NeedWhy Hadoop strugglesBetter choice
Analyse 40 GB of salesCluster overhead for nothing; job start-up alone takes secondsDuckDB, Polars, pandas or PostgreSQL on one machine
Show a customer's last 10 orders in 50 msHDFS has no index for point lookups; MapReduce/Hive are batchPostgreSQL, MySQL, MongoDB, Cassandra, or HBase
Flag a fraud pattern within 2 secondsBatch jobs run every hour at bestKafka + Flink or Spark Structured Streaming
Update order status many times a dayHDFS files are write-onceA database; or Iceberg/Delta/Hudi tables for analytics
Store 500 million 10 KB sensor filesEach file costs NameNode memory and a map taskObject storage, or batch into large files/Parquet
Train an ML model with 50 iterationsMapReduce rereads data from disk every passSpark (in memory), or a single GPU machine for moderate data
Interactive BI dashboardsHive on MapReduce takes seconds to minutes per queryCloud warehouse, Trino/Impala, or an OLAP engine like ClickHouse/Druid
3-person team, no ops staffRunning a cluster is a full-time jobManaged cloud services (warehouse, EMR/Dataproc with auto-shutdown)

When Hadoop is still a strong choice

Petabytes on-premises

Large, steady batch workloads where owning hardware is cheaper than renting it for years.

Scale + cost

Data must stay inside

Regulated or air-gapped environments (government, defence, some banking) that can't use public cloud.

Residency

Existing investment

Years of pipelines, Hive tables and skilled staff. Replacing everything at once is risky; modernise step by step.

Continuity

Shared multi-engine platform

One YARN cluster running Spark, Hive and others for many teams, close to the data.

Shared compute

A good answer to “Should we use Hadoop?” starts with questions, not tools: How much data, and how fast is it growing? How quickly do you need answers? Do records change? Who will run it? Where must the data live? The answers usually make the choice obvious.

4 Step by step

A five-question checklist, applied to the pickle startup

  1. How big is the data, and how fast is it growing?

    gb, growth, years = 40, 0.5, 3
    print(round(gb * (1 + growth) ** years), "GB in 3 years")
    135 GB in 3 years
    Even growing 50% a year, it stays small enough for one server. Distributed storage adds nothing.
  2. How fast must answers come?

    The website needs order status in milliseconds; the founders want a sales dashboard updated daily.

    The website needs an OLTP database (they already have one). The daily dashboard is light analytics, not a batch job over terabytes.
  3. Do records change?

    Orders change status (placed → packed → shipped → delivered).

    Frequent updates fit a database, not write-once files.
  4. Who will run it?

    Three people, none of them infrastructure engineers.

    A self-managed cluster would need monitoring, upgrades, security and disk swaps. That is a job they cannot staff.
  5. Decision

    Keep PostgreSQL for the app; copy data nightly into DuckDB or a small cloud warehouse for dashboards. Revisit if data reaches many TB.

    Cost: close to zero extra. Time to first dashboard: days, not months. Kabir has just given his first expert “no”.
5 See it happen

Three projects, three answers: the request, and the reasoning behind it

Arjun Sir reviews three project requests that all say “use Hadoop”. Left: the request. Right: the checklist and the recommendation.

Is Hadoop the right tool? 6 steps
The request Pickle startup• 40 GB of orders, +50% a year• daily sales dashboard• 3 people, no ops team“Set up a 10-node Hadoop cluster” Payments company• 5 crore transactions a day• block fraud within 2 seconds• also: monthly risk reports on 3 years“Use Hadoop for fraud detection” Telecom operator• 4 PB of call records, on-premises• must stay in own data centre• nightly batch reports, 12-person team“Keep and extend our Hadoop cluster” myphatshala.in
The reasoning size · latency · updates · team · location size : 40 GB → fits one machinelatency : daily batch is enoughteam : nobody to run a cluster NO HadoopPostgreSQL for the app +DuckDB or a small cloud warehouse fraud : 2 s → batch is far too slowreports : 3 years, TBs → big batchtwo workloads, two tools SPLIT the problemreal time: Kafka + Flink + fast key–value storehistory + reports: Spark on Hadoop or a lakehouse(batch also trains the fraud model) size : 4 PB → distributedlocation : must stay on-premisesteam : 12 skilled engineers YES, Hadoop fitsmodernise inside it: Spark instead ofMapReduce, erasure coding for cold data,Iceberg tables for updates myphatshala.in
6 Real-world use

Real decisions about Hadoop

laptopDuckDB · 30 GB

1. Analysts moving back to one machine

Many analytics teams found that most of their queries touch tens of GB, not TB. Fast single-machine engines answer them in seconds on a laptop or one server, without a cluster queue.

Medium data→Single-node engine→Answers in seconds

2. Migrations from Hadoop to the cloud

A common project today: move Hive tables and Spark jobs from an ageing on-prem cluster to cloud object storage and a lakehouse or warehouse. Engineers who understand Hadoop lead these migrations.

HDFS + Hive→Copy + rewrite jobs→Cloud lakehouse

3. Real-time fraud with a batch partner

Payment companies use streaming systems to score each transaction in milliseconds, while large batch jobs (on Hadoop or a lakehouse) train the models on years of history every night. Neither replaces the other.

Live events→Streaming score→Model from nightly batch
on-premdata stays here

4. Government and regulated data

Organisations bound by strict data-residency rules or air-gapped networks keep large on-premises clusters, where Hadoop (with Spark on YARN) remains a practical platform.

Sensitive data→Own data centre→Hadoop + Spark
10 KB × croressmall files

5. IoT data that needed a different shape

Teams that wrote one tiny file per sensor reading into HDFS hit NameNode memory limits. The fix was to stream readings through Kafka and write hourly Parquet files, or to use object storage.

Tiny readings→Batch into big files→Healthy storage

Examples describe common patterns, not any single company. Thresholds are approximate and change as hardware improves.

7 Run the code

A tool-recommendation function

This function applies the five-question checklist from Part 4 to a workload and recommends a tool. Run it on the three projects from the animation, then try the challenges.

def recommend(size_tb, latency_s, updates, ops_team, must_be_onprem):
    if latency_s < 1:
        return "OLTP database or key-value store"
    if latency_s < 60:
        return "Stream processing (Kafka + Flink / Spark Streaming)"
    if size_tb < 1:
        return "One machine: PostgreSQL / DuckDB / pandas"
    if not ops_team and not must_be_onprem:
        return "Managed cloud warehouse or lakehouse"
    if updates:
        return "Lakehouse tables (Iceberg/Delta/Hudi) on Spark"
    return "Hadoop + Spark (batch, distributed)"

projects = {
    "pickle startup": (0.04, 86400, True, False, False),
    "fraud alerts":   (50, 2, False, True, False),
    "telecom CDRs":   (4000, 86400, False, True, True),
}
for name, p in projects.items():
    print(f"{name:15} -> {recommend(*p)}")
pickle startup -> One machine: PostgreSQL / DuckDB / pandas fraud alerts -> Stream processing (Kafka + Flink / Spark Streaming) telecom CDRs -> Hadoop + Spark (batch, distributed)
  • def recommend(size_tb, latency_s, updates, ops_team, must_be_onprem):The five questions as parameters: size, how fast answers are needed, whether records change, whether a team can run a cluster, and where the data must live.
  • if latency_s < 1:The order of the checks matters: latency rules out batch tools first, whatever the data size.
  • print(f"{name:15} -> {recommend(*p)}")*p unpacks the tuple into the five arguments.

Run it on your PC: how much can one computer do?

Before reaching for a cluster, measure a single machine. This program writes 20 lakh fake orders to a CSV file and totals them per item with plain Python on one core. Save it as one_machine.py and run it.

Millions of rows per second, no cluster

# one_machine.py: how much data can ONE ordinary computer aggregate quickly?
import random, time, csv, os, tempfile

random.seed(1)
items = ["chai", "vada pav", "samosa", "poha", "idli", "dosa", "thali", "lassi"]
rows = 2_000_000
path = os.path.join(tempfile.gettempdir(), "orders_2m.csv")

t0 = time.time()
with open(path, "w", newline="") as f:
    w = csv.writer(f)
    for i in range(rows):
        w.writerow([i, random.choice(items), random.randint(10, 300)])
t1 = time.time()

totals = {}
with open(path, newline="") as f:
    for _, item, amount in csv.reader(f):
        totals[item] = totals.get(item, 0) + int(amount)
t2 = time.time()

size_mb = os.path.getsize(path) / 1024 / 1024
print(f"Rows: {rows:,}  File: {size_mb:.0f} MB")
print(f"Write: {t1 - t0:.1f} s   Group-by in plain Python: {t2 - t1:.1f} s")
print("Top item:", max(totals, key=totals.get))
print(f"Rough speed: {rows / (t2 - t1) / 1e6:.1f} million rows per second on one core")
os.remove(path)

# In a terminal:  python one_machine.py
Rows: 2,000,000 File: 35 MB Write: 2.3 s Group-by in plain Python: 1.1 s Top item: vada pav Rough speed: 1.8 million rows per second on one core

Recorded on a small cloud machine with Python 3. Your numbers will differ. Plain Python is the slow option: engines like DuckDB or Polars are typically many times faster and use all cores. At these speeds, a few hundred million rows are a single-machine job.

8 Line by line

The checklist, one line at a time

Follow one workload (2 TB, answers needed within 2 seconds) through the decision function. Watch which condition decides.

Worked examples: real problems, solved and traced in memory

Three decisions a data team really makes: whether a data set needs a cluster at all, what each option costs over three years, and how to score options fairly. Each runs live and is traced in memory.

Example 1BeginnerAnalytics · sizing

Does this data set need a cluster?

Problem statement

For each data set, decide: “one machine” if it is under 1 TB and grows less than 2× a year, otherwise “consider distributed”. Data sets: sales 80 GB (+30%/yr), clickstream 3 TB (+80%/yr), HR records 2 GB (+5%/yr), sensor data 600 GB (+300%/yr).

Input
sales 80 GB +30% · clicks 3 TB +80% · HR 2 GB +5% · sensors 600 GB +300%
Expected output
sales       :   0.08 TB, +30%/yr -> one machine
clickstream :    3.0 TB, +80%/yr -> consider distributed
hr          :  0.002 TB, +5%/yr -> one machine
sensors     :    0.6 TB, +300%/yr -> consider distributed

Approach

  1. Convert sizes to TB.
  2. Check both rules: size and growth.
  3. Print a verdict for each.

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 2IntermediateFinance · TCO

3-year cost: own cluster vs cloud warehouse

Problem statement

A company has 20 TB and runs reports for 6 hours a day. Option A: an 8-node on-prem cluster at Rs 12 lakh per node, plus Rs 30 lakh per year for 1.5 engineers, power and space. Option B: a cloud warehouse at Rs 2,000 per TB stored per month plus Rs 25,000 per day of query compute. Compare 3-year costs (illustrative prices).

Input
A: 8 × 12 L + 30 L/yr · B: 20 TB × Rs 2,000/month + Rs 25,000/day · 3 years
Expected output
A on-prem cluster : Rs 186 lakh
B cloud warehouse : Rs 288 lakh (storage 14 + compute 274)
Cheaper: A

Approach

  1. A = hardware once + yearly running cost × 3.
  2. B = (storage per month × 36) + (compute per day × 365 × 3).
  3. Compare in lakh.

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 3AdvancedArchitecture · decision matrix

Score the options with a weighted decision matrix

Problem statement

A bank compares three platforms for a 200 TB analytics workload. Criteria weights: cost 0.3, data residency 0.3, team skills 0.2, time to deliver 0.2. Scores (1–5): Hadoop+Spark on-prem (3, 5, 4, 3), cloud warehouse (4, 2, 3, 5), cloud lakehouse (4, 3, 3, 4). Compute weighted totals and pick the winner.

Input
weights 0.3/0.3/0.2/0.2 · three options with four scores each
Expected output
Hadoop+Spark on-prem  : 3.8
Cloud warehouse       : 3.4
Cloud lakehouse       : 3.5
Choose: Hadoop+Spark on-prem

Approach

  1. Weighted score = sum of weight × score for each criterion.
  2. Compute for every option.
  3. The highest total wins; show all totals so the decision is transparent.

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

  • Hadoop fits: huge, batch, mostly append-only data, run by a skilled team, often on-premises.
  • Not Hadoop: small data (one machine), ms lookups (database), real time (streaming), frequent updates (DB / table formats).
  • Also bad: millions of small files, iterative/interactive work on MapReduce, no ops team.
  • Checklist: size + growth · latency · updates · team · location.
  • Rough sizes: ≤ tens of GB laptop · ≤ few TB one big server / warehouse · tens of TB+ distributed.
  • Still wins: petabytes on-prem, data residency, existing investment, shared multi-engine platform.
  • Modern replacements: Spark (engine), object storage (HDFS), Iceberg/Delta/Hudi (tables), cloud warehouses.
  • Decide with numbers: TCO over 3 years and a weighted decision matrix.

Interview and viva questions

What are the limitations of Hadoop?

High latency (batch-oriented), unsuitable for real-time processing and point lookups, inefficient with many small files because of NameNode memory and task overhead, write-once files that make updates difficult, slow iterative processing with MapReduce, and considerable operational and security complexity. For small data it is slower and costlier than single-machine tools.

When would you not recommend Hadoop?

When the data fits comfortably on one machine; when the workload needs millisecond responses or frequent record updates; when results are needed in real time; when data arrives as huge numbers of tiny files; or when the organisation has no team to operate a cluster and can use managed cloud services instead.

What are alternatives to Hadoop?

For processing: Spark, Flink, Trino. For storage: cloud object storage with table formats (Iceberg, Delta Lake, Hudi). For analytics: cloud data warehouses (BigQuery, Snowflake, Redshift, Synapse) and OLAP engines (ClickHouse, Druid). For small data: PostgreSQL, DuckDB, Polars, pandas. For streams: Kafka with Flink or Spark Structured Streaming.

Is Hadoop still worth learning?

Yes, as a foundation. Many enterprises still run it, migrations from it are common, and its concepts (distributed storage, replication, data locality, MapReduce, resource management) underlie modern platforms. Knowing its limits is part of knowing it well.

How would you decide between Hadoop and a cloud data warehouse?

Compare requirements and total cost: data volume and growth, query patterns, latency, data-residency rules, existing skills and investments, and three-year TCO including staff. Steady, very large on-premises workloads with residency rules may favour Hadoop/Spark; smaller teams with variable, SQL-centric workloads often favour a managed warehouse.

Practice problems

Decision and cost exercises. Each one asks you to justify “Hadoop or not?” with numbers.

P1Easy

Fits on the laptop?

A laptop has a 1 TB SSD and the data is 120 GB. Will it fit with 50% of the disk kept free?

Input
1 TB SSD · 120 GB · 50% free
Expected output
Fits: True
Show solution and explanation
print("Fits:", 120 <= 1024 * 0.5)
Fits: True

How it works: 120 GB is well under 512 GB. No cluster needed to store it.

P2Easy

Grow the data

Data is 300 GB and grows 40% a year. How big in 4 years?

Input
300 GB · +40% · 4 years
Expected output
1152 GB
Show solution and explanation
print(round(300 * 1.4 ** 4), "GB")
1152 GB

How it works: About 1,152 GB: crossing 1 TB. Time to plan, not to panic; one big server may still do.

P3Easy

Classify latency needs

Classify each response-time need as "OLTP" (< 1 s), "streaming" (< 1 min) or "batch".

Input
[0.05, 5, 3600]
Expected output
0.05 s -> OLTP
5 s -> streaming
3600 s -> batch
Show solution and explanation
for s in [0.05, 5, 3600]:
    print(s, "s ->", "OLTP" if s < 1 else "streaming" if s < 60 else "batch")
0.05 s -> OLTP 5 s -> streaming 3600 s -> batch

How it works: Only the last one is a natural fit for Hadoop-style batch processing.

P4Medium

Startup overhead share

A job has 20 s of fixed start-up and processes 50 MB/s. For inputs of 100 MB, 10 GB and 1 TB, print the share of total time spent on start-up.

Input
20 s · 50 MB/s · [100 MB, 10 GB, 1 TB]
Expected output
     100 MB: start-up is 90.9% of the time
   10240 MB: start-up is 8.9% of the time
 1048576 MB: start-up is 0.1% of the time
Show solution and explanation
for mb in [100, 10 * 1024, 1024 * 1024]:
    work = mb / 50
    print(f"{mb:>8} MB: start-up is {20 / (20 + work):.1%} of the time")
100 MB: start-up is 90.9% of the time 10240 MB: start-up is 8.9% of the time 1048576 MB: start-up is 0.1% of the time

How it works: For 100 MB, start-up is 91% of the time; for 1 TB it is negligible (a single task here; real jobs split the work). Small jobs are wasteful on batch frameworks.

P5Medium

Small files combined

50 lakh sensor files of 20 KB each are combined into 256 MB files. How many files before and after?

Input
50,00,000 × 20 KB · 256 MB
Expected output
5000000 -> 382 files
Show solution and explanation
import math
files = 50_00_000
total_mb = files * 20 / 1024
print(files, "->", math.ceil(total_mb / 256), "files")
5000000 -> 382 files

How it works: About 382 files instead of 50 lakh: thousands of times less NameNode memory and far fewer map tasks.

P6Medium

Pick by rules

Write a function that returns "Hadoop" only if size ≥ 10 TB, latency ≥ 1 hour, and there is an ops team; otherwise "something else". Test three cases.

Input
(50, 7200, True) · (5, 7200, True) · (50, 7200, False)
Expected output
(50, 7200, True) -> Hadoop
(5, 7200, True) -> something else
(50, 7200, False) -> something else
Show solution and explanation
def fits(size_tb, latency_s, ops):
    return "Hadoop" if size_tb >= 10 and latency_s >= 3600 and ops else "something else"
for c in [(50, 7200, True), (5, 7200, True), (50, 7200, False)]:
    print(c, "->", fits(*c))
(50, 7200, True) -> Hadoop (5, 7200, True) -> something else (50, 7200, False) -> something else

How it works: All conditions must hold. Missing any one (size, batch latency, team) is a reason to look elsewhere.

P7Business problem

Engineers are the biggest cost

A 10-node cluster costs Rs 1.2 crore in hardware (5-year life). Running it needs 2 engineers at Rs 25 lakh per year each, plus Rs 8 lakh per year for power and space. What share of the yearly cost is people?

Input
Rs 1.2 crore / 5 years · 2 × Rs 25 L · Rs 8 L
Expected output
Yearly: Rs 82 lakh; people = 61%
Show solution and explanation
hardware = 120 / 5
people = 2 * 25
other = 8
total = hardware + people + other
print(f"Yearly: Rs {total:.0f} lakh; people = {people / total:.0%}")
Yearly: Rs 82 lakh; people = 61%

How it works: People are about 61% of the yearly cost (illustrative figures). For small data, that cost alone outweighs any benefit of a cluster.

P8Business problem

Break-even for owning a cluster

A cloud option costs Rs 1.5 lakh per TB-year of data analysed. An on-prem cluster costs Rs 90 lakh per year whatever the size (up to its capacity). Above how many TB is on-prem cheaper?

Input
Rs 1.5 L per TB-year · Rs 90 L per year fixed
Expected output
On-prem cheaper above 61 TB
Show solution and explanation
import math
print("On-prem cheaper above", math.floor(90 / 1.5) + 1, "TB")
On-prem cheaper above 61 TB

How it works: Above about 61 TB (illustrative). Below it, pay-per-use wins; well above it and steady, owning hardware can win. Real decisions also weigh residency, skills and flexibility.

Real-world scenario questions (asked in company interviews)

Interviewers often test judgement with a “should we use Hadoop?” question. Practise answering with questions, numbers and alternatives.

Startup · architectureFresher

“Our 50 GB database is slow, so let's move to Hadoop”

A startup's PostgreSQL reports take minutes. Someone proposes moving everything to Hadoop “because it's built for big data”.

The interviewer is checking: do you diagnose before prescribing, and do you know that 50 GB is not big data?

Show a strong answer
  • 50 GB is small. A cluster would add overhead and operations work, and probably be slower for these queries.
  • First diagnose: missing indexes, reports running on the live transactional database, poor query design.
  • Options: add indexes and summary tables; run reports on a read replica; copy data nightly to DuckDB or a small cloud warehouse for analytics.
  • Revisit distributed tools if the data grows to many TB.

Avoid: recommending Hadoop because it is “the big data tool”.

Payments · real time1–3 years

Use Hive for live fraud alerts?

A payments team stores all transactions in Hive and runs a fraud query every 15 minutes. Fraudsters complete their attacks in under 5 minutes.

The interviewer is checking: can you separate real-time and batch needs?

Show a strong answer
  • A 15-minute batch loop can never stop a 5-minute attack. Scoring must happen on each transaction as it arrives.
  • Stream transactions through Kafka; score them with Flink or Spark Structured Streaming using features kept in a fast store; block or flag in milliseconds to seconds.
  • Keep Hive/Spark on the history to train and evaluate the models nightly, and for investigations.

Avoid: “Run the Hive query every minute.” Batch start-up and scan costs make that impractical and still too slow.

IoT · storage1–3 years

The NameNode keeps running out of memory

A smart-meter project writes every reading (a few KB) as its own file into HDFS. After six months the NameNode heap is full and restarts take hours.

The interviewer is checking: do you recognise the small-files problem and its fixes?

Show a strong answer
  • Hundreds of millions of tiny files mean hundreds of millions of file and block objects in NameNode memory.
  • Short term: compact existing files into large Parquet or SequenceFiles per hour/day, and archive old ones (HAR).
  • Long term: send readings to Kafka and write large files in batches; or store raw readings in an object store or a time-series database designed for many small writes.

Avoid: only increasing the NameNode heap; it delays the problem and makes pauses worse.

Enterprise · strategy3+ years

“Should we shut down our Hadoop cluster and move to the cloud?”

A bank runs a 150-node Hadoop cluster with 3 PB. The CIO hears “Hadoop is dead” and asks for a recommendation.

The interviewer is checking: can you give a balanced, requirement-driven recommendation?

Show a strong answer
  1. Constraints: can this data legally be in a public cloud region? Many banking rules require data to stay in India and under specific controls.
  2. Cost: compare 3–5 year TCO, including migration effort, cloud egress and staff, against hardware refresh costs.
  3. Workloads: which jobs are steady and heavy (cheaper on owned hardware) and which are spiky or new (better in the cloud)?
  4. Path: often a phased or hybrid approach: modernise on-prem (Spark, table formats), move suitable workloads first, keep the rest until hardware refresh.

Avoid: deciding on fashion (“Hadoop is dead”) or on fear of change.