Skip to main content
Data Management for Machine Learning

Big Data Systems: Distributed Storage and Distributed Processing

Published: 2026-08-07
Level: postgraduate
Audience: Postgraduate students in Machine Learning

Prerequisite Knowledge

This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.

Previously Covered in This Subject

  • Metadata — covered in Lecture 5 (Metadata, Privacy, and Your Role in Data Management)
  • Traditional vs big data analytics — covered in Lecture 2 (Why Traditional Systems Fall Short)
  • The seven Vs of big data — covered in Lectures 2 and 4 (The Seven V's of Big Data)
  • HDFS distributed storage — covered in Lecture 4 (HDFS: Distributed Storage with Replication)
  • MapReduce distributed processing — covered in Lecture 4 (MapReduce: Distributed Parallel Processing)
  • The Hadoop ecosystem — covered in Lectures 2, 4, and 10 (The Big Data Ecosystem)
  • Apache Spark — covered in Lecture 10 (Apache Spark vs MapReduce)
  • Stream processing — covered in Lecture 10 (Batch vs Stream Processing)
  • Big data in the cloud — covered in Lecture 10 (Cloud Equivalents: AWS and Google)

12.1 Metadata: The Backbone of the Data Pipeline

12.1.1 Recap: Experimentation and Why Metadata Matters

Hook: A month from now, can you find the exact model, data set, and settings that produced your best test score? If the answer needs more than a few clicks, your pipeline is already broken. Metadata is the reason this question has an answer at all.

The session starts where the previous one ended: how we train machine learning models, how we split data, and why metadata governs everything that follows. The model-building workflow ran through several stages. We decide how to select the model. We do feature engineering. We tune hyperparameters. We augment data to get more training material, and we validate the model. On the data side, we talked about training data versus test data, how to split the data using the 80-20 rule, and cross-validation.

Cross-validation has variants, including leave-one-out cross-validation, where each single sample takes its turn as the validation set while everything else trains the model. The split can also be randomized and shuffled, so the same data set can produce different train-test splits each time.

Intuition: All of this experimentation produces artifacts — a trained model, a cleaned data set, a tuned set of hyperparameters. Think of a kitchen shelf of identical unlabeled jars: without labels, every jar is useless, because you cannot tell which spice is which. Artifacts without labels are equally useless later. That is where metadata enters the picture — metadata is the label on every jar.

Metadata is the key to the whole data pipeline. It is what makes discovery possible: you can find a data set, an experiment, or a model again. It helps you understand the relationships between data sets. It governs data access and permissions, so the right people can reach the right data and no one else. It specifies the technicality of the data — its format, its schema, how it was produced — and it carries statistical descriptions about the data, like counts, ranges, and distributions.

Working from the reference material, these roles split into two broad classes you will be asked to classify:

Class What it holds Examples
Administrative metadata Who, when, where, and how the artifact was created or changed Dataset provenance, responsible team, creation date, permissions, license terms
Structural metadata What the artifact is made of and how it is organized Schema, column types, formats, feature definitions, pipeline steps

Exam note: the professor was explicit about the exam value of this topic: metadata is a very likely source of good questions in the comprehensive exam. Questions are still being drafted, and the expectation is that you will be able to tell the types of metadata apart, classify a given item as administrative metadata or structural metadata, and say what each kind does for your pipeline. Practice that classification now, artifact by artifact.

12.1.2 The Metadata Artifacts: Dataset, Feature, Label, Model, and Pipeline

Every artifact in an experiment needs a reference: what the artifact is and what version it is. The discussion walked through the main artifact classes one by one.

Dataset metadata describes the whole data set: where the data set lives, how it was collected, what its location is, and when it was created. It also records restrictions on using the data — any licenses attached to it. License and usage restrictions matter most in the healthcare domain and the retail domain, where data carries compliance weight. Reference material adds a few fields worth remembering: dataset provenance (where did the data come from — a lookup table of logs, an external provider key, or the code that generated it), the responsible person or team, the first date the data set was used, and any use restrictions from licensing or governance rules. All of this makes later analysis and compliance checks possible without asking a human who remembers.

Feature metadata exists for every particular feature. Each column of the data set gets its own metadata describing what the feature means, its type, and how it behaves. You do not describe features once at the data-set level; you describe every feature individually. The reference treatment tracks a feature version definition (a reference to the code that reads the raw data and turns it into the feature), the responsible person or team, creation and update dates, and use restrictions. Feature restrictions can be subtle: a feature may be legal to use in one jurisdiction but illegal in another, so the metadata must carry the conditions.

Label metadata captures the labeling process: why each label was assigned the way it was, and what version of the labeling rules was used. When a label changes meaning, the version tells you which convention a given sample follows. The reference adds label set version (because labels get corrected or new labels get added, and an older model may need the older label set for a fair comparison), label source (the human, the licensed provider, or the algorithm that produced the label), and label confidence (an automated labeler may earn less trust than a trained human labeler).

Model metadata records everything about the trained model: what parameters were used for training, what parameters were used for evaluation, how the model was used, which data set version trained it, and what the weights were. These are all very important pieces of the record. A model management system built on this metadata can answer: what configuration and hyperparameters produced this model, who authored it, which features it uses, and which snapshot of weights is in production.

Pipeline metadata describes the pipeline itself — data about the data pipeline. It becomes especially important when you build pipelines with advanced packages such as TensorFlow, because those pipelines are directed acyclic graphs (DAGs) of steps. In fact, we saw that data drift, concept drift, and performance drift can appear as a model moves from development, through training and staging, and into production; pipeline metadata is what lets you compare behavior across those stages. Reference material notes that some training systems record this automatically — ML Metadata (MLMD) is included in TensorFlow Extended (TFX) and stores artifacts about training runs, which pipeline run produced them, and which binaries produced them.

12.1.3 Experimentation Best Practices and the Model Package

Intuition: a chef who writes down every ingredient, temperature, and timing for a new dish can recreate it exactly, and so can the next chef. A chef who "just remembers" cannot. Experimentation without a record is the same: you cannot reproduce the win or diagnose the loss.

During experimentation, one best practice is to capture everything about the run. The list recorded in class covers both the what and the why of each item:

Worked example — the complete experiment record. Take one training run and log all of the following, exactly as recorded in class:

# What to capture Why it matters
1 Data version used The model only means something if you know which data it saw
2 Configuration of the run The settings that defined the run
3 Environment The base system the code ran on
4 Number of CPUs available Hardware context for speed and cost
5 Amount of memory Hardware context, and a check for OOM behavior
6 YAML configuration file The exact config, versioned as text
7 Dockerfile used to build the environment Anyone can rebuild the same environment later
8 Makefile The exact build and run commands
9 Documentation (MD) file The human-readable intent behind the run
10 Code version Which commit produced the results
11 Hyperparameters being used The knobs you tuned
12 Training metrics Loss, accuracy, and friends during training
13 Hardware metrics (CPU and memory utilization) Where the run spent its resources
14 Evaluation record and performance The final score and how it was measured

Keeping all of this turns a single experiment into evidence you can compare later. Without the record, a model that scored well on Tuesday cannot be reproduced, explained, or trusted on Wednesday.

A proper model package bundles the artifacts together: the model version, the evaluation record, the experiment versions, and the original model creator (the author). It also tracks modification and maintenance history, the downstream data sets that consume the model, and the artifacts used by the pipeline. Without this packaging, a model that worked in training cannot be reproduced or trusted in production.

In industry, this is exactly what modern ML platforms productize — experiment tracking systems that log data versions, environments, and metrics the way this lecture describes doing manually. The manual list and the productized tool solve the same problem: an unlabeled model is a liability, a labeled one is an asset.

12.1.4 Metadata Store, Repository, or Registry?

A metadata system can be built as one system or as multiple systems. You can decide which fits your pipeline; each option has pros and cons. The three forms discussed were the metadata store, the metadata repository, and the metadata registry.

A metadata store is a centralized place — one store, like an app store such as the Apple iStore or the Play Store. Inside it sits a metadata dashboard and a metadata database, and you access the whole thing through that central point. The store lets you see when metadata was logged and when it was updated, display the metadata, compare one version against another version, organize it, filter it, and query it.

A metadata repository is the choice when you want something like a GitHub-style place — the code base and everything around it living in one version-controlled space you can browse and understand. If you mainly need to access artifacts later, a registry (like a file registry) is the lighter option. The professor's mental model: for a model you might want a metadata store that works like a Wikipedia or a big repository — you go there to select the metadata you need for this model.

Dimension Metadata store Metadata repository Metadata registry
Mental picture App store GitHub code base File registry
Core feature Central dashboard + database, version comparison, query and filter Version-controlled space you can browse and understand Lightweight access to artifacts later
When to pick it You want one central point to see, compare, and query metadata You want everything around the code base in one browsable space You mostly need to find and fetch artifacts later

The decision connects to how you structure the pipeline itself. You can go pipeline-first or model-first — feeding the pipeline as a first-class object, or feeding the model and the experiment as first-class objects. Whatever you choose, orchestration tools such as Kubeflow and TensorFlow (which we studied with orchestration earlier) can drive the flow.

Recap + bridge: metadata is the label system for every artifact your pipeline produces — data sets, features, labels, models, and pipelines themselves — and the store, repository, or registry is the shelf that organizes those labels. Keep this mental model: the next sections of the lecture scale the pipeline itself up from a single machine to distributed systems, and every concept that follows (blocks, nodes, replication) is itself described by metadata. The name node of a distributed file system, which we will meet in section 12.5, is nothing but the metadata brain of that system.

Exam note: be ready to identify the metadata type of a given artifact, and to explain what that metadata does for your pipeline — this classification skill was called out as a likely question area.

12.2 Traditional Data Analytics vs Big Data Analytics

12.2.1 Why Traditional Pipelines Fail at Scale

Hook: A query, a report, a dashboard — done. That is data analytics when the data is small. So why does the same recipe fall apart the moment the data gets huge? Because the pipeline that worked at a thousand rows was never built for a billion.

Everything so far was a recap. Now the lecture moved to a new theme: big data systems, distributed systems, and scalable systems — and the difference between traditional data processing and feature engineering versus big data systems. When you have a small amount of data, with little variation, it is easy to handle: a query, a report, a dashboard, done. When data is huge, has lots of variations, and carries so much complexity, the traditional pipeline data processing does not work as you expect. That is why big data systems exist: they combine with data science, machine learning, and deep learning to provide a better data pipeline. The two pillars underneath are distributed storage and distributed processing — you will meet both of them in detail later in this session, and every big data system in the world rests on these two ideas.

The whole data management story — building databases, building pipelines, building repositories, building metadata — exists for one reason: analytics. You mine data, you build data lakes, you build data pipelines, to derive some insight, to get business intelligence, to improve the business, to cut cost, to improve a process, or to do something right. Big data, or distributed data, is an umbrella term, much like cloud computing is an umbrella term. The data that forces this scale is everywhere: Netflix, Amazon, Flipkart, YouTube, Facebook, Twitter, and social media in general generate huge amounts of data that must be organized, stored, and pre-processed — and that is exactly where the data pipeline comes into the picture.

Intuition — the professor's analogy: AI and big data belong together. The analogy used in class is that if AI is the father, big data is the mother — you cannot separate the two. AI without data has nothing to learn from, and big data without AI is an unread mountain. The analogy holds wherever you look: every AI success story in industry is sitting on a big data foundation.

The human genome is a powerful example: processing genome data used to take 10 years; today it can be done in about a week by combining big data systems with AI. That is a roughly 500-fold speedup from architecture, not from waiting. Traditional database management systems and Excel files are still there, but beyond them sits the big data layer with its masses of data — even government data: census data, geographical data, and catalogs of government services all need to be collected and organized.

12.2.2 The Nature of the Data

Intuition — the professor's analogy: the first contrast is the nature of data analytics. Traditional data analytics is like a book where you can find a solution to your problems. Big data analytics is like a big library where all the answers to all the questions are there — but it is difficult to find the answers to your questions. The book is fast and direct; the library is complete but needs a search strategy. Big data systems are that search strategy.

The scale problem is not about the data alone: suppose you pull customer data from one source, from one system — that is easy. The same customer data coming from 20 different sources is difficult to manage. That is big data analytics — not a switch but a continuum. As more sources join, a normal approach stops being viable. There is no single line where "small data" becomes "big data"; the pipeline simply degrades gradually as sources multiply, and at some point the traditional approach stops being viable. The same data, at 1 source or 20 sources, is a different problem.

12.2.3 The Structure of the Data

Second is the structure of data. Data analytics mostly handles structured data: it analyzes structured tables to answer complex business queries and find solutions to business challenges. Big data deals with unstructured and raw data, and the main aim of big data is to convert raw data into meaningful data. This is one of the famous V characteristics — variety, which gets its own treatment in section 12.3.3. Data is not just a SQL structured table; it may be unstructured, semi-structured, audio, video, or a mix of everything.

The pipeline implication: a structured table has a fixed schema, so a traditional query planner knows exactly what it is looking at. Unstructured data has no such promise, so the pipeline's first job is often to impose structure — parse the text, decode the video frames, tag the audio — before any analysis can run. That is why "converting raw data into meaningful data" is the stated aim of big data, not a side effect.

12.2.4 The Tools and Technologies

Third is the tooling. Traditional analytics uses simple queries and reporting tools: you run a query, you build a report, you work in Power BI or Tableau, no problem. But when you try to combine so many things and push toward automation or reporting, it becomes very difficult. Big data needs sophisticated technological tools — automation tools, parallel computing tools, distributed computing, distributed processing — to manage the volume.

Pitfalls: a few traps show up every time a team moves from traditional to big data tooling:

  • Reaching for a dashboard tool first. Power BI and Tableau are excellent at rendering a report; they are not engines for processing petabytes. Choose the tool for the volume, then visualize the output.
  • Assuming one tool does everything. Traditional analytics often lives in one product; big data tooling is a stack — storage here, processing there, orchestration on top — and each layer needs its own choice.
  • Porting the old query unchanged. A query that is fine on a terabyte-scale warehouse can stall for hours on distributed data. The translation to distributed processing is real work, not a copy-paste.

12.2.5 The Types of Industry

Fourth is the type of industry. Data analytics serves IT industries, travel industries, and healthcare industries; it helps them create new developments by using historical data and analyzing past trends and patterns. Big data is used by banking industries, retail industries, and many more; it helps them take strategic business decisions. Both matter, but they answer different questions: past trends versus strategy under scale.

Dimension Traditional data analytics Big data analytics
Nature of the data One or few sources; easy to find the answer (a book) Many sources (20+); the answer exists but is hard to find (a library)
Structure Mostly structured tables with fixed schema Unstructured, semi-structured, raw; needs conversion into meaningful data
Tools Queries, reports, dashboards; Power BI, Tableau Automation, parallel and distributed computing, distributed processing
Industry IT, travel, healthcare; historical trends and patterns Banking, retail, and more; strategic decisions under scale
Question answered "What happened, and what does the past say?" "What decision do we take now, at this scale?"

When to pick which: if the data fits comfortably in one system and the question is about past trends, traditional analytics is faster, simpler, and cheaper. The moment the data spreads across many sources, loses its schema, or outgrows one machine, move to big data analytics — the switch is not a style choice but a scale choice.

Recap + bridge: traditional analytics works when data is small, structured, and local; big data analytics exists because the data we actually face is huge, messy, and scattered — and the two differ in the nature, structure, tools, and industries of the data they serve. Next, the lecture defines exactly what makes data "big" through the seven Vs, starting with the size of the data itself.

12.3 The Seven Vs of Big Data

12.3.1 Volume

Hook: A traffic light, a YouTube upload, a credit card swipe — each one is a speck of data. Multiply by every traffic light, every upload, every swipe on earth, and you have a pile no single machine can hold. The first V is about the size of that pile.

Big data refers to massive, complex data sets that traditional data management systems cannot handle. Such data has to be properly collected, managed, and analyzed. It is more than gigabytes: it is terabytes, petabytes, even zettabytes. The first V, volume, is the size of the data. The Internet of Things (IoT) is generating a lot of data — a traffic light generates data, YouTube generates data, Facebook and every social media platform generate data, transaction records generate data. You cannot deal with all of that in one store.

Even the database vendors hit this wall. In the old days one Oracle data file had a limitation of 2 GB, then they raised it, and now they make data files in terabytes, so a single big file can be terabyte-sized. The scale reference points are worth memorizing: a gigabyte is about \(10^9\) bytes, a terabyte about \(10^{12}\), a petabyte about \(10^{15}\), and a zettabyte about \(10^{21}\) — the size of the whole internet in the mid-2010s. Volume is the reason "one store" stops being the answer.

12.3.2 Velocity

Velocity is the speed at which data appears and disappears. The professor showed it with the live class itself: questions and answers, and the actions visible on video — data appearing and disappearing at speed. Traffic data, stock data, transaction data, log data, server data, heat generator data, temperature sensor data — all of it comes at high speed, appears, disappears, and pours into the pipeline. With such rapid data you need to make quick decisions.

The distinction that matters: volume asks "how much is sitting there?" while velocity asks "how fast is it moving past you?" A sensor reading every millisecond generates small data per reading but enormous data per hour — that is velocity doing the damage. Decisions that wait for the whole day's data may be decisions taken too late, which is why velocity is the V that motivates streaming (section 12.11).

12.3.3 Variety

Variety is the different types of data: structured, unstructured, semi-structured; Excel files, CSV files, JSON files, stream data, IoT data, image data, video data. There is no strict schema. That is why MongoDB became so popular — a document database does not force one schema on everything.

The mental model: a relational table demands every row have the same columns — that is a strict schema. Big data arrives in every shape, and a system that refuses to accept a shape cannot even hold the data, let alone analyze it. Variety is the V that pushed the industry toward schema-flexible storage: NoSQL document stores, object storage for raw files, and lakes that accept anything and sort it out later.

12.3.4 Veracity

Veracity refers to the accuracy and reliability of data. Big data comes in such great quantities and from so many sources that it can contain noise or errors, which can lead to poor decision making. Veracity applies to normal systems too. This is why data engineering exists — the cleaning step of the pipeline. When you do data engineering, you clean the data; in big data the cleaning is very, very big cleaning, because there is so much data and some of it is incomplete and noisy.

Worked example — the credit card story. A customer went shopping and used a credit card. Only two of three transactions were captured for monitoring; the third, a very big transaction, was missed by the system. When the bank considered offering a bigger credit card, it saw a customer who spends only 20,000 a month — and possibly raised charges instead. The decision was wrong twice: the customer looked low-value (missing data), and the bank even considered charging them more (bad decision from bad data). If the third transaction had been captured, the picture would have been the opposite — a high-value customer worth retaining.

So you must make sure data entering a big data system is as accurate as possible, and when it is not, you do something about it: correct it, remove the noise, normalize the data. This is the data quality dimension work we studied before — data should be as accurate as possible and as relevant as possible.

12.3.5 Value

Value is the relevance of the data — the real-world benefits an organization can get from big data. High volume, high velocity, high variety, and accuracy are all nice, but for what? Finally, any data system exists to give value: value to the organization, value to the process, value to the people, value to the society, value to the company. If it is not valuable, why do we need it?

Value is the question that keeps the other Vs honest. A system can nail volume, velocity, variety, and veracity and still be pointless if no one can name what the data is for. In industry the value test is concrete: does the data change a decision, cut a cost, or improve a process? If not, the whole pipeline is an expensive hobby.

12.3.6 Variability

Variability is about preserving the context of the data. A coffee-ordering example: a customer ordered a coffee, but the system did not capture what blend, what sugar level — so next day the recommendation system suggests a different coffee because it did not capture the context correctly. The dosa example works the same way: in the morning the customer ordered a ghee dosa, in the afternoon an onion dosa, at night an egg dosa. If the context is not carried properly, you cannot make the right decision. Variability covers different blends, the unpredictability of customer behavior, and extreme conditions; the question is how you capture enough so the data is processed correctly.

Intuition: a bare record "coffee, 9:00 AM" is not the same record as "ghee dosa, morning" — the meaning lives in the surrounding detail. Variability is the V that asks: did we keep the situation, not just the event? A recommendation system that stores only the item name is blind to the very pattern it is supposed to learn. Where you log the order is as important as what you log.

12.3.7 The Seventh V: Visualization

Two more Vs complete the list beyond volume, velocity, variety, veracity, and value. The professor named variability, and then said the data has to be visualized — a common convention, so the seventh V is visualization: big data is of little use until it is shown to humans in a form they can act on.

The point is a closing loop. The first six Vs describe the data and its handling; the seventh describes the output. A human cannot hold a petabyte in their head, but they can hold a chart. Visualization is the translation step that turns the analyzed result into a decision — a dashboard a manager can read, a chart an operator can watch for anomalies, a map a city planner can act on. It is also the step that pays for everything else: an insight that is never seen is an insight that never happened.

12.3.8 Veracity vs Variability: Do Not Confuse Them

The single most important caution of this section: do not confuse veracity with variability. Veracity is data being as accurate as possible — the noise and error problem. Variability is preserving the context — the coffee blend, the sugar level, the time of day the order happened. One asks "is the record true?", the other asks "did we keep what makes the record meaningful?"

Pitfall — the classic mix-up: the two get mixed up because both sound like "data quality," but they point at different failures and need different fixes. A record that is perfectly accurate (veracity fixed) can still be useless if its context was dropped (variability broken), and a record with full context is still dangerous if it is wrong. When you see an exam question about a wrong number in the data, that is veracity; when you see a question about a lost detail — the blend, the sugar level, the time of day — that is variability. Repair the noise for one; repair the capture for the other.

Veracity Variability
Question it answers Is the record true? Did we keep what makes the record meaningful?
Failure mode Noise, errors, missing transactions Lost context: blend, sugar level, time of day
Fix Clean, correct, normalize the data Capture the right fields, preserve the situation
Example The missed third credit card transaction The coffee order without blend and sugar level

Recap + bridge: the seven Vs — volume, velocity, variety, veracity, value, variability, and visualization — are the vocabulary of "what makes data big." Remember the veracity-vs-variability split: accuracy versus context. With the Vs in hand, the lecture turns to what big data analytics is actually for — faster decisions, processing near the data, and the real challenges that come with the scale.

12.4 Goals, Use Cases, and Challenges of Big Data Analytics

12.4.1 What Big Data Analytics Is For

Hook: A bank that spots fraud a month later has not spotted it at all. Big data analytics exists for one reason above all others: faster, real-time decisions.

Big data analytics exists for faster, real-time decision making — technology-enabled analytics. It uses AI and supports both online and offline processing. The process runs: collect the data, store the data, pre-process the data, analyze the data, and get the results. The main thing to manage is latency: with lots of data spread across different systems, you need to extract, transform, load, perform analytics, and produce knowledge. Every step in that chain has to happen at scale.

Latency is the time between an event in the world and the decision that responds to it. A query over a small table answers in milliseconds; the same question over a distributed pile can take minutes or hours unless the pipeline is designed for speed. That is why the lecture names latency, not storage, as the main thing to manage: storage you can buy, but latency is a property of the whole chain — how fast data is collected, stored, pre-processed, analyzed, and turned into results.

12.4.2 The Principle of Locality

A key principle is locality: process where the data is. Locality means you go and fetch the data where it resides — relevant data, time-wise and space-wise — and you move the code near to the data.

Intuition — the professor's living analogy: the class is coming closer because being close lets them learn more; being close lets questions get answers. The same idea applies to computation: move the processing code near to where the data resides. Otherwise you drag everything across the network.

The concrete version: stock data arrives at a location, and you want to flag high-volatility stocks. So you put some code at a location nearby, do the processing there, and transfer only the result to the next system. Fetching raw data from far away costs time and creates latency issues; locality avoids them. The flow is: keep data where it naturally lands, push the computation to the data, and move only the small output, never the large input.

This is not a minor optimization — it is the reason distributed file systems scatter data across machines and then schedule work on the machines that hold the data. Section 12.5 and 12.6 will build the mechanism (blocks on nodes, map tasks on the nodes that own the blocks); locality is the principle underneath both. Reference material states the same rule: the standard approach with HDFS and MapReduce is to locate the data blocks that need scanning and push individual map jobs out to those blocks, so the scan and processing stay local.

12.4.3 Real-World Use Cases

Real-world use cases — big data analytics in named companies:

  • Amazon uses big data analytics to understand the customer shopping experience — what customers are using — and to personalize advertisements: based on what you buy, related items pop up. The same machinery runs customer segmentation and fraud detection, and it powers ride price recommendations.
  • Alexa does voice analysis on the same stack.
  • Ginger (ginger dot) looks at mental health symptoms from user data.
  • Kia Motors uses big data to identify patterns and anomalies — including potential issues in water quality and car control.

The point: these are not volume games for tech companies only. A car maker and a mental health app face the same two pillars — distributed storage and distributed processing — because they face the same scale of data.

12.4.4 What Big Data Is Not

Scope — what big data is not: big data is not just a volume game, and it is not another technology that replaces RDBMS. It is not meant to replace the data warehouse. It is not for big data companies alone.

The one-size-fits-all approach — an RDBMS with shared disk and shared memory — breaks when data grows and IT budgets stay limited. The same query that a relational database answers in seconds on one machine takes longer than anyone can wait when the data is scattered across many machines; that is the boundary where big data tools start, not the place where they replace everything else. Big data systems sit alongside the RDBMS and the warehouse — they handle the load those systems were never built for, and they hand results back to the systems that serve users.

12.4.5 Challenges and How to Address Them

The challenge list is real: data integrity issues, quality issues, privacy issues, security, and compliance. You must define your objectives precisely, based on the challenges — what you want to do with big data, how you deal with a massive amount of data, how you will store it. Infrastructure must exist and scale. You need proper people. A data integration policy and a quality assurance policy are key — this is the core. Regular pipeline infrastructure and regular storage infrastructure are not enough; you must go for distributed storage and distributed processing.

Challenge Response
Data integrity and quality issues Be clear about what you want and about the data quality you need in your particular domain; a quality assurance policy is core
Privacy and security Put proper security measures and proper encryption techniques in place wherever you collect data
Compliance Define objectives precisely up front; the policy is what keeps the pipeline defensible
Infrastructure that does not scale Define a scalable infrastructure; regular storage and pipeline infrastructure are not enough — use distributed storage and distributed processing
Skills gap in people Understand the skill gap and give the right training
Real-time processing Decide how to deal with real-time data processing explicitly
Rising cost Accept it — you buy many systems, many CPUs, much memory — and plan for it
Culture Expect a cultural change from traditional to big-data thinking

Recap + bridge: big data analytics exists for faster, real-time decisions; the way to get them is to process near the data (locality) and to answer the challenge list — quality, privacy, security, compliance, skills, real-time, cost — with explicit policy. Now the lecture builds the machinery: distributed storage with HDFS, where a file becomes blocks scattered across nodes.

12.5 Distributed Storage with HDFS

12.5.1 From One File to Many Blocks

Hook: One file, one machine, one point of failure. The whole history of distributed storage starts with a simple act of cutting: a single file sliced into pieces, and the pieces scattered across many machines. Nothing about big data works until you accept that cutting.

The old way: everything stored in one file, in one place. The big data way: break the file into multiple blocks. Whatever the input — customer data, log data, a video file — it is split into blocks. For simplicity, think of a file split into five blocks. Block sizes vary: 2 MB, 4 MB, 16 MB are all normal, and the sizes step through a kilobytes series — 2 KB, 4 KB, 8 KB, 16 KB — and so on.

Now the blocks are scattered across machines. A node (one computer in the cluster, whether a physical machine, a virtual machine, or an AWS instance) holds some of the blocks. Block 2 of the file lives on node A, another copy on node B, another on node D; block 1 sits on nodes B, C, and E. The same block appears on multiple nodes.

Intuition — why cut at all? Picture one giant book that ten readers must each read a different chapter from. If the book must stay on one desk, only one reader works at a time and everyone else waits. Cut the book into chapters and put each chapter on a different desk: ten readers now work at once. Blocks are the chapters, and the desks are the nodes. The trade-off is the bookkeeping — somebody must track which chapter is on which desk — and that bookkeeping turns out to be the name node of section 12.5.4.

12.5.2 Replication and Fault Tolerance

Why copies? Because big data systems run on commodity hardware — cheap machines, not very expensive hardware. When you consolidate low-cost machines, they can go wrong: think of three laptops working as a cluster; any one can fail. The default Hadoop distributed file system uses three-fold replication at any given time: each block is stored three times.

The replication factor, formally. Let \(r\) be the replication factor — how many copies of each block the system keeps. The default is:

\[ r = 3 \quad (\text{default replication factor}), \qquad r \in \{1, 2, 3, 4, 5, \dots\} \text{ configurable} \]

The verbal description that goes with this formula: "the default Hadoop distributed file system has three-fold replication at a given time," and "it is an XML file; you can just go and change this — I want four, I want five." So the replication factor is a setting, not a law of nature. Changing it changes the storage bill too: a file of size \(S\) occupies \(r \times S\) bytes across the cluster, so \(r = 3\) triples the raw storage cost while buying you the ability to lose two copies of any block and still read the file.

This is what a distributed file system means — distributed storage. It is the fundamental principle of big data systems. HDFS (the Hadoop Distributed File System) is a big data file system, written in Java, based on Google's GFS (Google File System), and rooted in work at Yahoo and Google. It provides redundant storage for massive amounts of data. It is written once and optimized for large file reads. Files are split into blocks at load time, blocks are spread across many machines, and each block is replicated across multiple machines.

12.5.3 Worked Example: Splitting a File into Five Blocks

Worked example — one input file, five blocks, three copies each. The professor worked the example live on the diagram.

Take one input file — a customer log or a profile — and split it into five blocks, numbered 1 to 5. Choose a block size, say 2 MB per block, so a 10 MB file becomes five blocks. Distribute the blocks over a cluster of machines named node A, node B, node C, node D, and node E. Each block goes to three nodes.

  • Block 1 → nodes B, C, E
  • Block 2 → nodes A, B, D
  • Block 3 → nodes A, C, E
  • Block 4 → nodes B, D, E
  • Block 5 → nodes A, C, D

The picture is the same for every block: wherever one copy sits, two more copies sit on other machines. If any node fails — hardware failure, system failure — the block can be recovered from the other nodes and the file can be rebuilt and assembled. Nothing is lost, and no single machine is a point of failure.

Sense-check: block 2 alone is safe against losing any one of nodes A, B, or D, because two copies survive elsewhere. With \(r = 3\) on every block, the file survives any single-node failure, and the file is fully readable as long as at least one copy of each of blocks 1–5 exists somewhere in the cluster. The storage cost is \(5 \times 3 = 15\) block copies for a 10 MB file — 30 MB of raw storage for 10 MB of data, which is the price of survival.

12.5.4 The Name Node and the Data Nodes

Who keeps track of where everything is? The name node. The name node keeps the metadata: which block of which file is stored where — which node, which block, which location. It also knows the topology: whether the block sits in rack one of data center one or rack two of data center two. When a client reads a file, the client first asks the name node, and the name node points to the exact location; the client then pulls the block from the nearest place. The name node is the metadata brain of the file system.

Intuition — remember the metadata lecture? Section 12.1 said every artifact needs metadata, and here the file system agrees: the name node is a living metadata store for blocks. Notice the pattern — metadata is not an add-on; it is the single point that makes the whole distributed system navigable. Also notice what the topology knowledge buys: if block 2 has copies in rack 1 and rack 2, a client in rack 2 reads from its own rack, not from the far one. That is the locality principle of section 12.4.2, applied inside the file system.

12.5.5 Student Questions and Answers

Q: Why are we using the data replica? Is it for DR (disaster recovery) or what?

A: It is not for disaster recovery alone. It is used for disaster recovery, yes, but also for faster processing — a two-in-one purpose. Think of it with locations: one block sits in Pune, another copy in Mumbai, another in Delhi. Pune users can come to the Pune block and pull the data locally; Mumbai and Delhi users go to the racks near them. That is locality of reference — the data resides nearby, so you pull it quickly. Replication provides fault tolerance and distributed access at the same time; that is why it is called distributed storage. It helps both for disaster recovery and for performance. If replication existed only for disaster recovery, you would replicate to one far-away archive; the three-copy scheme is a performance feature as much as a survival feature.

Q: Where exactly is block one stored? I am looking at the diagram but I do not understand what you are asking.

A: Look again: block one is stored on nodes B, C, and E. Node B, yes — B, C, and E. Whatever you find in node B is also found in node C and also found in node E. It is replicated, so if any of those systems fails, we retrieve the copy from the other nodes and assemble the file. The client never needs to know this list by heart — it asks the name node, and the name node answers "B, C, E" from its metadata.

Recap + bridge: distributed storage turns one file into replicated blocks on many nodes: \(r = 3\) copies by default, the name node as the metadata brain, and the payoff is survival plus speed. Storage alone only holds the data — the second pillar, distributed processing, is what actually computes over it, and that is MapReduce in the next section.

12.6 Distributed Processing with MapReduce

12.6.1 From Distributed Storage to Distributed Processing

Hook: Storage keeps the data safe across machines — but who does the counting? The professor's motivating question: how many people with a common name live in India, and in the world? No single machine can count them all; the job itself must be cut into pieces, exactly like the file was.

Storage was the first half. The second half is distributed processing — parallel processing. Earlier we took a 1 MB, 2 MB, or 100 MB file, split it into blocks, and distributed the blocks across machines: that is distributed storage. Now we process the video, the customer records, the job. The job is split into multiple smaller pieces — one piece for sorting, one for finding, one for grouping, one for clustering.

Intuition — the common-name example: counting how many people share a common name across India and the world — there are so many across Tamil Nadu, the US, Europe, everywhere. You split that job into smaller and smaller pieces, send the pieces across the cluster, and gather the results back together. This is called distributed processing — MapReduce. One counting problem, thousands of small counting problems, one total. The name-counting story and the file-splitting story are the same story: cutting is the way to scale.

Whatever the big data ecosystem — Hadoop, AWS, Google, Azure — they all support these two things: distributed storage and distributed/parallel processing. If you remember only two sentences from this lecture, remember those two pillars.

12.6.2 The MapReduce Pipeline: Split, Map, Shuffle, Reduce

MapReduce is a programming model that uses parallel processing to process and analyze large amounts of data.

Purpose: MapReduce exists to answer one kind of question at any scale: counting and aggregating over huge data — how many of each word, how many of each car model, how many gold orders. Its design rule: never move the data to the computation; move the computation to the data.

Inputs and outputs: the input is one big file (or data set) split across the cluster; the output is a set of key-value pairs — for each key, the combined value.

The steps, in order:

  1. Split — the input is split into parts. Instead of processing on one single system, the input goes to multiple machines: one chunk to a node in Pune, one to Chennai, one to Mumbai — node one, node two, node three.
  2. Map — each machine maps its chunk. Mapping finds key-value pairs: for each word in its chunk, the mapper emits the word as the key and a count as the value. In the example the program counts words, but you can do a lot of examples.
  3. Shuffle — the key-value pairs are shuffled and sorted, grouped by key across all machines. Shuffling runs as its own process, not at the same moment as mapping.
  4. Reduce — reducers take the grouped pairs and combine them, merging counts from multiple nodes. The final output is given as key-value pairs.

So instead of processing the file on a single machine, the job is split into many small tasks, and the tasks execute on different nodes using different storage blocks. That is distributed processing: processing is distributed. The one-sentence definition used in class: split massive jobs into smaller pieces, send them across different clusters, and patiently gather the results back together — no drama, no data loss.

The payoff can be stated with numbers. A job that runs in 10 minutes on one machine can run in 1 minute when its work is spread across the cluster — a ten-fold speedup. Written as a ratio, with \(T_1\) the time on one machine and \(T_n\) the time on \(n\) machines:

\[ S = \frac{T_1}{T_n} = \frac{10 \text{ minutes}}{1 \text{ minute}} = 10 \]

where \(S\) is the speedup. This is the idealized number: it assumes the work divides perfectly and nothing extra is paid for coordination. In practice the shuffle step costs time and network bandwidth, so the real speedup is smaller than the ideal — but the principle stands: the same work, spread, finishes faster. Ten tasks on ten processors, those processors possibly in different places, is the lecture's standing picture of distributed processing.

12.6.3 Worked Example: Word Count

Worked example — word count on nine words. The worked example ran on a small input, small enough to follow by hand.

The input file has nine words in total — the words deer, bear, river, and car repeating. The exact input is: deer, bear, river, car, car, river, deer, bear, car. (The final counts pin the input down uniquely: the totals are deer 2, bear 2, car 3, river 2, which sum to the nine words.)

Step 1 — split. The nine words are split across three machines: deer, bear, river go to machine one; car, car, river go to machine two; the remaining words — deer, bear, car — go to machine three.

Step 2 — map. Each machine maps its words to key-value pairs, key = word, value = 1 per occurrence.

  • Machine one emits (deer, 1), (bear, 1), (river, 1)
  • Machine two emits (car, 1), (car, 1), (river, 1)
  • Machine three emits (deer, 1), (bear, 1), (car, 1)

Step 3 — shuffle. All pairs flow to a shuffle phase that groups by key: all (deer, 1) pairs together, all (bear, 1) pairs together, all (car, 1) pairs together, all (river, 1) pairs together.

Step 4 — reduce. Each reducer sums the values for its key. The math underneath the reduce step is a sum over the partial counts:

\[ \text{count}(w) = \sum_{\text{mappers } j} c_j(w) \]

where \(w\) is a word, \(c_j(w)\) is the number of times mapper \(j\) counted \(w\), and the summation runs over every mapper. For deer: mapper one contributed 1 and mapper three contributed 1, so \(\text{count}(\text{deer}) = 1 + 1 = 2\). The verbal description the professor gave for this formula: "we find that key-value pair... how many deer in this? Only one deer. So the key, the value pair... I am doing the shuffling, then I'm reducing it... Bear was two, car was three, deer was two, river was two. Finally, we get the result."

Step 5 — result. The final counts are: deer 2, bear 2, car 3, river 2.

Sense-check: the counts sum to \(2 + 2 + 3 + 2 = 9\), matching the nine-word input. Each machine did a small local job; the whole pipeline produced one global answer.

12.6.4 Worked Example: Counting Global Car Sales

Worked example — Toyota cars sold around the world. The use case that brought MapReduce to life: a company wants to invest more in car production and needs to know how many Toyota Corollas, Toyota Camrys, and electric cars were purchased throughout the world.

A car dealer will not hand you only those models — dealers will give everything: all cars, all models. So the input is one huge file of transaction records of Toyota cars sold, assembled from every region: India's big dealer collects data from all regions into one file, and Malaysia, Singapore, the Netherlands, and roughly 300 countries ship their car sales data to one system. That enormous file is the input.

From there you tune the program. You write conditions: count only Toyota, Camry, electric segment. The entire pipeline — importing, filtering, sorting, counting — is split into many small jobs; the jobs are scheduled across a big data cluster, and the results are combined in one place.

Trace on a 5-node cluster. Suppose the work runs from Chennai or London on a 5-node cluster: one node holds all India data, another holds all Europe data, another holds America data, and so on. Each node runs a filter (keep only the Toyota, Camry, and electric rows) and a map (emit (model, 1) per matching row), the shuffle groups by model across all five nodes, and the reduce merges the partial counts:

\[ \text{total(model)} = \sum_{\text{nodes } k} \text{partial}_k(\text{model}) \]

Node one contributes the India count of Corolla, node two the Europe count, node three the America count, and the final total for each model is the sum of the five partial counts. Each node processed its own partition and the pipeline merged the partial counts into the final total.

Sense-check: no node ever sees the whole world's data — each sees only its region's slice — yet the sum of the partials is exactly the number that answers the company's investment question. That is the purpose of distributed processing: a single input file, a cluster of nodes, one aggregated answer.

12.6.5 Standards, Compliance, and Metadata Control

What about the real-world complication: every country has its own compliance rules? The answer is standards. You decide which data must be given and in what format; the company follows the standard. Define the structure of the file and which inputs you want — no prices, no locations if a security guideline says so. That is where the pipeline comes in: you have to do the prep. In the import and export into the big data system, you control what is given and what is not.

The metadata lever: and you can control the same thing through metadata — when the input file arrives, you read the metadata to decide which parameters, which three fields or five fields, you want. Both the metadata and the standard plus the export-import process help you keep the pipeline clean. Notice the pattern: the distributed pipeline does not make compliance disappear; it makes compliance an explicit, checkable step — the file format is decided once, the import is filtered by the metadata, and everything that violates the standard stays out.

12.6.6 Student Questions and Answers

Q: Sorry, my network cut out — what is a real use case of MapReduce? I missed that part.

A: MapReduce is for finding counts and aggregations over huge data. For example: how many customers placed gold orders? Or the car example — how many Toyota Corolla, Toyota Camry, and electric cars have been purchased throughout the world? There are so many stores across so many countries, so we collect all the data, filter and sort it, split the whole pipeline into many small jobs, schedule the tasks on the cluster, and finally combine the results at one place.

Q: Follow-up: if we collect records across the world, every country has its own compliance. How do we manage that part?

A: That little complication is handled by the standard. You decide the data format: which fields must be given, which must not. Every company exports in that standard format — this is where the pipeline comes into the picture, you do the preparation. In the import and export into the big data system you control what enters and what stays out. And you can control it on the metadata as well: when the input file comes in, read the metadata, decide which parameters you want — three fields, five fields — and process accordingly. The export-import process and the metadata together enforce the standard.

Q: Suppose the same problem were posed to us, and we stored the data in a traditional monolithic RDBMS like Oracle, MySQL, or Postgres. Would we not just write a SQL aggregation query?

A: Yes, exactly. In the traditional world you would write a SQL query — an aggregation, count star for each type — and show the number. In the new world, with the data stored in distributed storage like HDFS, the data sits across different blocks on different machines, so we combine the partial results, aggregate, and shuffle to finally arrive at the same aggregation result. Same problem, same answer, different architecture: one is distributed storage plus distributed processing, the other is a single database.

Recap + bridge: MapReduce is a programming model — split, map, shuffle, reduce — that turns one huge counting job into many small ones, with the reduce step summing the mappers' partial counts. The word count and the car-sales trace show the pattern end to end, and the RDBMS comparison shows that the answer is the same — only the architecture differs. With storage and processing in hand, the lecture now asks: what kind of machines are we actually talking about — and answers with parallel versus distributed computing.

12.7 Parallel vs Distributed Computing

12.7.1 Two Ways to Use Many Computers

Hook: Ten machines can solve a problem ten times faster — but only if they agree on how to share the work. The oldest argument in computing is about that agreement: do the machines share one brain, or does each have its own? That is the difference between parallel and distributed computing.

Big data systems rely on two pillars — distributed storage and distributed processing — but the underlying computing models come in two flavors.

Parallel computing: multiple processors work at the same time, using the same memory. Each processor runs a symmetric multiprocessing arrangement; the processors share one memory and one system.

Distributed computing: multiple computing resources are connected in a network, and computing tasks are distributed across them. Not only the data is distributed — reading from 10 machines instead of one — the compute is too. Each node has its own processor and its own memory; nodes communicate by passing messages, and each machine keeps its own coupling to its memory. Parallel systems are tightly coupled computing; distributed systems are loosely coupled computers. A parallel system is one single machine, a tightly coupled cluster of multiple processors with a unified architecture — that is called a shared memory architecture. A distributed system spans multiple independent computers, each node with its own independent memory, where nodes pass messages to one another.

There is a control node — the master node — that coordinates. Multiple computing resources sit in the network, tasks are distributed across them: one machine processes something, another machine processes something else, and whichever node you need the data from — the nearby node, by locality of reference — performs the work. That is where load balancing comes into the picture: the master hands each task to the node that is ready and near the data, so no single machine drowns while others idle. When you need more computing resources to improve processing capability, you can go distributed; parallel systems grow inside one machine, distributed systems grow across machines.

12.7.2 Clusters: Old Wine in a New Bottle

The idea itself is not new. Before big data systems, Oracle already had a cluster — Oracle RAC, the Real Application Cluster. Microsoft has clusters; SQL Server clusters, DB2 clusters, Informix clusters — all the database systems, and not only database systems, can be clustered. Clustering means grouping things together; when you group, you need a common information bus that carries the data between members, and the messaging has to be clear — that is where fiber optic cable matters, because speed matters inside a cluster.

Intuition — the professor's analogy: cluster computing and distributed computing are old wine in a new bottle. The big data era did not invent clusters — the database world (Oracle RAC, SQL Server, DB2, Informix) ran them for years. What is new is the scale and the openness, not the fundamental idea. If you understand that a cluster is a group of machines working as one, you already understand most of Hadoop's history.

For distributed computing you do not worry about that: one system may be slow, another fast, no problem — but then you have latency issues. Distributed systems are not claimed to be efficient without effort: there is latency, but you can still use and manage it if you follow locality of reference properly. In short: cluster computing and distributed computing are old wine in a new bottle.

12.7.3 Student Questions and Answers

Q: Do both computing models — parallel and distributed — coexist in one big data system, or is it one versus the other?

A: Actually, both can exist — very good question. Take a master cluster: to run a big data system you need a master — a name node, a designated master node server. For the master node, where most of the metadata processing happens, you can have one machine with a shared memory and multiple processors — parallel. For all the other machines, the data nodes, you can have distributed computing — each data node with its own memory. There is no hard and fast rule; you can mix both. The name node can run on a parallel system with one common shared memory so the metadata is accessible to all processes; when it comes to the individual data nodes, use distributed. That makes sense: metadata is small and shared, data is big and partitioned.

Q: Correct me on the diagram: in the first case, parallel computing, is there a problem of scaling?

A: Very good. Yes — in the first case the scaling is limited. The second one, distributed, you can add a node at your will, you can add machines any time; here the scaling is limited. Exactly why we talk about scale-out and scale-up. Think of a bus: for some things you have a single bus, for others you have multiple buses. You cannot keep on building the data center vertically — you cannot keep on adding CPU, you cannot keep on adding memory to one machine; it is very difficult. Horizontal scaling — adding machines — is basically distributed computing. Vertical scaling — adding processors and memory to one machine — is the parallel model, and it hits a ceiling.

Dimension Parallel computing Distributed computing
Memory One shared memory Each node has its own memory
Coupling Tightly coupled, one machine Loosely coupled computers over a network
Communication Through shared memory By passing messages
Scaling Vertical (scale-up): add processors and memory to one machine — hits a ceiling Horizontal (scale-out): add machines any time
Latency Low; needs a fast common bus (fiber optic matters) Higher; managed with locality of reference
Role in big data Master/name node with shared memory for metadata Data nodes, each with its own memory

When to pick which: use parallel computing where everything must share one view fast (the metadata brain); use distributed computing where the data itself is big and partitioned — which, in a big data system, is most of the cluster.

Recap + bridge: parallel and distributed computing are two ways to use many computers — one shared memory versus many independent ones, scale-up versus scale-out — and real big data systems mix both: a parallel master node over distributed data nodes. Clusters are old wine in a new bottle. Next, the lecture asks why distributed processing can still feel slow and introduces the answer: in-memory computing with Apache Spark.

12.8 In-Memory Computing with Apache Spark

12.8.1 The Memory Hierarchy

Hook: Big data processing on commodity hardware can be slow — even with HDFS and distributed processing, the system may go slow. Why? Where you keep data decides how fast you can touch it. The distance between the data and the computation is the whole story of in-memory computing.

Memory registers are the fastest devices. Then comes cache — faster — then L2, then L3, then main memory, then local storage, then remote storage. Remote storage is what distributed storage looks like: cloud systems with data distributed in multiple places. It takes time to reach. But if you process on the system itself, it is faster.

The hierarchy reads like a distance ladder, each rung slower and larger than the one above:

Level What it is Speed character
Registers Inside the CPU itself Fastest
Cache (L1), then L2, then L3 On-chip memory close to the CPU Very fast, shrinking cost per level
Main memory (RAM) The machine's own working memory Fast; milliseconds to nanoseconds
Local storage The machine's disks Slower; mechanical or flash latency
Remote storage Other machines, cloud, distributed storage Slowest; network round trips

The world is moving toward quantum computing, GPU-accelerated systems, and high-intensity CPUs and memory, and in-memory computing is where that trend lands: the more work you can keep in the fast levels, the less time you pay on the slow ones.

12.8.2 Why In-Memory Computing

In-memory computing means computing on the system itself: you do not go to the network to fetch something; everything happens inside the machine. Data goes into the cache — control injection, automatic calculations — gets processed, and comes back.

Intuition — the professor's analogy: a chef with ingredients in a nearby pantry cooks faster than one who must walk to a distant placement location. You have a tomato immediately next to you instead of going to the refrigerator every time. The pantry is the memory, the distant storeroom is the disk or the network, and every round trip is time the meal does not wait for.

Every node has its own memory, so you process local data for reference — go there, process it in that CPU itself, keep the data in the memory instead of constantly reading from disk. That lets analysts and data scientists ask questions again and again without waiting, and never wait for data to stop flowing. Data streams in, sits in memory, gets processed — reacting in a millisecond. It is like the class itself: a question, an answer, done — it is in your memory, no waiting for a round trip to disk.

Scope — the price of speed: memory is not free. Reference material notes that dynamic RAM (DRAM) is extremely expensive compared with disks, which is why in-memory systems are typically paired with cheaper storage: keep the working data in memory while the job runs, and release it when the job completes. In the cloud, this becomes rent-what-you-need: spin up large memory when a job needs it, then release it. The trade-off is the core of every in-memory decision: speed when you need it, cost when you do not.

This is where Apache Spark enters: Spark is the in-memory engine for big data. Apache Spark is an open source big data processing engine designed for large-scale data processing. It is also the in-memory engine of the Hadoop system, and it runs on Linux, Windows, or Apple systems.

12.8.3 PySpark and How the Engine Works

PySpark is the Python API for Apache Spark. The engine's own language is Scala — a scripting language much like Python — and Spark itself is written in Scala. Traditional Python and traditional machine learning code are different from PySpark: PySpark takes the power of parallel processing.

The way to understand the engine: you all know the JVM, the Java Virtual Machine — the virtual machine that compiles and runs Java code. Similarly, the Spark in-memory engine takes your Python instruction, splits the Python code into small, small pieces, and if you have 4 CPUs, all four CPUs work in parallel, using the memory, computing faster and giving the results back. The Spark shell lets you run this on a local Windows machine — setup is easy — and your Python code runs faster.

Intuition — JVM for Python: the Java Virtual Machine is the layer that lets Java code run on any machine; the Spark engine is a similar layer for distributed Python. Your Python program is cut into pieces, the pieces are scheduled across the CPUs (locally or across the cluster), and the engine collects the results back. You write one program; the engine runs many copies of its pieces.

Real-world: the same parallelism powers industry systems: Amazon, Walmart, and Trivago all use PySpark with machine learning to process faster.

12.8.4 PySpark at a Glance

Comparing a regular Python machine learning program with PySpark:

Dimension Regular Python ML PySpark
Execution One process, one machine Parallel across CPUs and cluster nodes
Fault tolerance None built in Yes — the engine recovers lost partitions
Works with Your local libraries Spark and YARN
Latency Fine at small scale Low — data sits in memory
Scale Limited to one machine's resources Scale-out by adding workers

With PySpark and machine learning, you can do faster processing. For heavy workloads you can also run MLlib — Spark's machine learning library — with your regression code and neural network code. If time permits, running one MLlib code example live is the planned demo: download Apache Spark on Windows, follow the instructions, and run the code locally.

Recap + bridge: the memory hierarchy decides speed, so in-memory computing keeps data where the CPUs can reach it fast; Spark is the in-memory engine, PySpark is its Python API, and the JVM-style split of your Python code across CPUs is the whole trick. Next, the lecture zooms out to the system that ties all of this together — the Hadoop ecosystem and its layered stack.

12.9 The Hadoop Ecosystem

12.9.1 Hadoop: The First Big Data System

Hook: Every big data system you will ever meet — AWS, Google, Azure, Databricks — traces its family tree to one open source project. Understand Hadoop's ecosystem, and every vendor's stack becomes a translation exercise.

Hadoop is the first and most popular big data system — an open source framework that has been around for a long, long time. When data comes to HDFS, it is broken into blocks and distributed on different nodes; you can access HDFS quickly through APIs. Hadoop daemons — processes running in the background — run on commodity hardware, and Hadoop became powerful the same way Android and Linux became popular: free, open, and easy to get started with. Hadoop is the big data answer to that story.

Intuition — the professor's analogy: Hadoop became popular the way Android and Linux did — free and open. Nobody had to buy a license to try Hadoop, so a whole generation of engineers learned it, built on it, and pushed it everywhere. The openness is not a footnote; it is the reason the ecosystem grew at all.

12.9.2 The Layered Stack

The Hadoop ecosystem is a layered approach: once the core is up, everything else installs on top of it, layer by layer. The components, with the one-line definitions to carry away:

Component Layer / role One-line definition
HDFS Storage (bottom layer) The big elephant: stores a large amount of data across many machines in many blocks
YARN Resource management Yet Another Resource Negotiator: resource manager and scheduler that negotiates CPU and memory between jobs
ZooKeeper Coordination Coordinates between distributed components and makes sure everything works fine
Ambari Management Open source management platform for the cluster
MapReduce Processing (critical) Programming model that uses parallel processing to process and analyze large amounts of data
Hive Data warehouse Big data warehouse layer — a relational database in big data, where you can do drilling and data mining
Drill Query Big data tool for querying large data sets
HBase NoSQL database Distributed, scalable NoSQL database like MongoDB, built on top of HDFS
Pig Scripting Scripting language to run 20 or 25 jobs — pulling data, loading it, filtering it
Mahout Machine learning Machine learning library package that works for big data
Spark MLlib Machine learning The Spark machine learning library
Kafka Messaging Streaming: handles videos, audios, traffic data, continuous data — the velocity V again
Storm Streaming Real-time stream processing
Solr Search Searching and indexing — where data is and how to find it
Lucene Search library Java library for full-text search: give it one big book and it can search all of it
Oozie Scheduling The scheduling software
Flume Ingestion Moves unstructured streaming data such as videos from one source to another
Sqoop Ingestion Transfers data from relational databases — Oracle, MySQL, Postgres — and CSV files into Hadoop

The details that make the stack come alive:

  • The bottom layer is HDFS — the big elephant — which stores a large amount of data. It is the core: data is not in one machine, it is in many machines, in many blocks. (You can also create the same layout on one machine with four disks — that is called a pseudo cluster — but the purpose is to distribute.)
  • YARN — Yet Another Resource Negotiator — is a resource manager and scheduler. In my machine there is this memory and this CPU; you wanted to finish this job; YARN does the negotiation. It is also a resource management layer: you can edit its Java code if you need to.
  • ZooKeeper coordinates between distributed components and makes sure everything works fine — like a zookeeper checking that all the animals are safe, that water is available, no issues. It is a software agent running like a daemon, checking everything. Ambari is an open source management platform for the cluster.
  • The critical component is MapReduce — the yellow components were called critical; Google, AWS, and Microsoft all worked on these two, distributed storage and distributed processing. You can implement distributed processing with Python, Java, .NET, or C — no problem.
  • Hive and Drill are the data warehouse layer — a big data warehouse, relational database in big data. You can do the drilling and data mining on Hive.
  • HBase is a NoSQL database like MongoDB — distributed, scalable, built on top of HDFS. Hadoop provides HBase and it is very easy to set up once HDFS and YARN are running.
  • Pig is a scripting language: to run 20 jobs or 25 jobs, use Pig scripting for data processing and data pipelines — pulling data from a file, loading it, filtering it, all in Pig scripting.
  • Mahout and Spark MLlib are the machine learning libraries: complete machine learning library packages work using Mahout or Spark. You can set up Mahout and run a Python program that works beautifully for big data.
  • Kafka and Storm handle streaming: videos, audios, traffic data, continuous data — that is the velocity V again. Kafka is for messaging, Storm for real-time stream processing.
  • Solr and Lucene handle searching and indexing — where data is and how to find it. Lucene is a Java library for full-text search: give it one big book and it can search all of it.
  • Oozie is the scheduling software.
  • Flume and Sqoop move data in: Flume for unstructured streaming data such as videos (and Kafka can connect with Flume), Sqoop for databases — Oracle, MySQL, Postgres — and CSV files, where you define your control and push what you want as per the standard. That is where data validation standards come in.

12.9.3 HDFS Architecture: Master-Slave

HDFS uses a director-worker architecture — also called master-slave. The cluster includes one name node, which is the director server. The name node tracks where the file is, where the data is, where the permissions are, where everything is located; it manages the file system namespace. Data nodes are the worker nodes: each data node manages block creation, block deletion, block replication, and read and write requests. Each data node separately stores HDFS data in the local file system — this machine's disk, that machine's disk, a cluster of ordinary computers. The daemons run in the background on commodity hardware, and Hadoop is powerful because of that.

The client flow, step by step: when a client comes, the HDFS client first goes and checks the name node; the name node knows the metadata — where what is — and points to the data. The client then reads the blocks directly from the data nodes, without the name node standing in the data path. The name node answers questions; it does not carry files. That division — a small brain that answers, and many workers that carry — is the master-slave design in one sentence.

12.9.4 Worked Example: A Word Count Job on a Real Cluster

Worked example — a real MapReduce job on a real cluster. The professor showed a real MapReduce word count job on an actual Hadoop cluster. The job ran, processed the records, and gave results:

  • 223 words total
  • "big" appears 6 times
  • "data" appears 10 times
  • "distributed" appears 2 times

You can watch the job from the dashboard the way you would in a real-time environment — checking the data nodes and the name node on AWS. The setup took a three-node cluster; the replication value you saw in the XML configuration was the default three — change it to four or five if you want, and define your system as you like. The full setup takes about two classes to explain; the takeaway is that a job processing a transaction file this way is fast, and the system is user friendly and open source.

The MapReduce flow behind the demo: create the maps, run map separately, shuffle, sort, and finally merge and reduce; tasks run in parallel on different processors in different places; the output is given as key-value pairs. Sense-check: "big" 6, "data" 10, "distributed" 2 are partial counts; summed with the counts of every other word they produce the 223 total — the reduce step of section 12.6, running for real.

12.9.5 Setting Up Your Own Cluster: Ambari and the Cloud

Real-world: Apache Ambari is a cloud-based management system for building your own cluster. Like AWS, you can subscribe, create a virtual machine, work with your own VM instance — EC2 instances — and provision a cluster. Follow the installation guide, it gives you a URL, you go there and start working; on Windows you may need to stop the firewall. You can create users and do everything through Ambari.

The path is: provision machines (EC2 or your own), install the stack through Ambari's guided flow, and the cluster appears with HDFS and YARN running and the dashboard showing node health. What the lecture calls "about two classes to explain" is the configuration surface — the XML files, the firewall rules, the node setup — which Ambari turns into clicks.

12.9.6 Student Questions and Answers: Choosing a System

Q: Suppose I need to select Databricks or the Hadoop ecosystem — which one should I choose?

A: If you want to spend money, go with Databricks. If you want a low-cost system, go with Hadoop. It is a buy-versus-rent decision: if your organization has the luxury of spending money, it buys the managed experience; otherwise the open source cluster does the job. The same answer goes for Spark versus classical Hadoop: if your organization is ready to spend on in-memory computing, Spark is fast — but it comes with a cost. That is the choice the organization has to take.

12.9.7 Student Questions and Answers: When NOT to Use Open Source

Q: In what cases can you not consider the Hadoop ecosystem / open source systems?

A: When you have highly business-critical data and you do not want to rely on open source, you cannot consider it — maybe you build your own system, your own logic. If you simply want to store, process, and try things out, you can consider the Hadoop ecosystem — with caution. If you want control, you have to write a lot of code, primarily in Java: the open source code can be edited — they give you the control files and you can rewrite the code. A PhD scholar guided by the professor updated the YARN scheduler by editing Java code, recompiling it to fit his needs. But the caution is real: one small change in a configuration file can blow up the Hadoop ecosystem, and you may not get support — you have to do a lot of fixes manually. And it demands people: without a good Java programmer, a good shell scripting person, or a good Linux or Windows system person, troubleshooting is hard. So: if you have control over everything and the skills to maintain it, you can go with Hadoop; if you want someone else to handle it, you pay.

12.9.8 The HDFS + MapReduce Architecture

Putting it together: the data flow architecture of the ecosystem has an export-import process at the bottom; both the metadata and the standard plus the export-import process help you control the pipeline. The architecture is master-slave end to end: name node (director, metadata, namespace) over data nodes (workers, block management, local disks), with YARN negotiating resources, ZooKeeper watching health, and MapReduce jobs split into maps, shuffled, sorted, merged, and reduced across the cluster.

Recap + bridge: the Hadoop ecosystem is a layered stack — HDFS at the bottom, YARN and ZooKeeper coordinating the middle, and warehouse, database, scripting, machine learning, streaming, search, scheduling, and ingestion components on top — all master-slave in structure, all open source, and all yours to maintain if you have the skills. One strong summary used in class: "10 tasks run on ten processors; those processors may be in different places; a job that runs in 10 minutes on one machine runs in 1 minute." Next, the lecture looks inside the in-memory challenger — Apache Spark's own architecture.

12.10 Apache Spark Architecture

12.10.1 Spark Core: The In-Memory Engine

Hook: Hadoop's two pillars were storage and processing — but what if the processing engine kept its working data in memory instead of on disk at every step? That single choice is Apache Spark's identity.

Apache Spark's ecosystem is similar to the Hadoop system, but its core engine is different: Spark Core is the engine that does large-scale parallel distributed processing — in your memory. The professor's analogy: right now you are listening to a class, and other things are happening in your brain at the same time — humans are capable of parallel tasks, storing and processing multiple things at once. Spark distributes memory blocks and distributed processing jobs within the same machine the same way.

Intuition — the brain: the brain runs parallel tasks, and so does Spark across CPUs. You listen, you remember, you plan — several tracks at once. Spark treats a machine the same way: many processors, each handling part of the work, all sharing the machine's memory. The analogy also says where the power comes from — not a faster single unit, but many units in parallel.

Spark has a well-defined layered architecture: its components and layers are loosely coupled and further integrated — you can execute the Z-land distributed database, RDD, and the directed acyclic graph (DAG). Spark loads data directly into memory and speeds up algorithms; execution is distributed among processors — instead of one processor, many processors run in parallel.

12.10.2 Resilient Distributed Datasets (RDD)

The key concept is the Resilient Distributed Dataset (RDD). What does that mean? A data set — say a CSV file — is normally loaded into memory as one frame. Instead, the RDD splits that data set into pieces: 10,000 records are split and the pieces are given to different processors, one piece per process. The entire program is then distributed — being done parallelly. You control the operations through the driver, deciding which runs first and which next.

Resilient Distributed Dataset (RDD), written RDD: a resilient (recoverable if a piece is lost) distributed (split across processors) dataset (the data set in memory). The three words are the design: resilient because lost partitions can be recomputed from the lineage of operations, distributed because the pieces live on different processors, and a dataset because it is the data itself, held in memory. The driver — the program's control point — decides the order of operations on the RDDs.

12.10.3 Worked Example: Splitting 10,000 Records

Worked example — one file, two workers, 5,000 records each. Take a file with 10,000 records. Instead of one machine reading all 10,000 records as one frame, the file is split into partitions and given to worker nodes: with two workers, one node does 5,000 records and the other does 5,000 records. Instead of one machine handling 10,000, they share it.

Written as a formula, the partition size is about the total records divided by the number of workers:

\[ \text{partition size} \approx \frac{N}{\text{number of workers}}, \qquad N = 10{,}000 \text{ records} \]

With two workers: \(\frac{10{,}000}{2} = 5{,}000\) records per partition. With four workers, the same file gives four partitions of about 2,500 each. This is the partitioning that lets Spark process in parallel. It increases the workers' effective memory size, so you can cache the jobs and execute faster.

Trace of parallel execution inside the engine: addition is done by one process, subtraction by one process, multiplication by one, division by one — and finally all four results come back. One job, four processors, one combined answer — the same shape as the 10,000-record split: each processor gets its slice, and the driver collects the slices.

Sense-check: \(10{,}000 / 2 = 5{,}000\) and \(5{,}000 + 5{,}000 = 10{,}000\) — no record is counted twice and none is lost; the shared work adds back to the whole.

12.10.4 The Spark Libraries

On top of the core engine, more libraries handle each workload:

Library Workload
Spark Streaming Real-time streaming data
MLlib Machine learning: regression code, neural network code, all of it
Spark SQL SQL functionality: querying other data, giving SQL queries, connecting to Hive or any other database through an API — pull from Oracle, pull it back
GraphX Graph parallel computing, where NVIDIA supercomputers and big computer vision applications come into the picture

The libraries share the core engine, so a streaming job, an ML training job, and a SQL query all run on the same in-memory parallelism instead of each owning a separate system.

12.10.5 Driver, Cluster Manager, and Workers

The framework in one picture. Spark has a driver node, like the Hadoop ecosystem's director, and a cluster manager that manages a cluster of worker nodes. A job is split into multiple tasks distributed over the worker nodes — the slave nodes where jobs are executed.

The flow: the driver (control point) receives your program and builds the execution plan; the cluster manager (resource negotiator — YARN in the Hadoop world) assigns the tasks; the workers (slave nodes) run the tasks on their partitions; results flow back to the driver. It increases the workers' memory size, caches jobs, and executes faster.

That is the Apache Spark framework in one picture: driver, cluster manager, workers, RDD partitions, DAG scheduling, in-memory processing.

Recap + bridge: Spark Core is the in-memory parallel engine; RDDs split data sets into partitions handed to workers, with the formula partition size ≈ N / workers; Spark Streaming, MLlib, Spark SQL, and GraphX sit on top; and the driver-cluster manager-workers trio runs the whole show. The lecture now turns from processing stored data to data that never stops arriving — stream processing.

12.11 Stream Processing

12.11.1 What Streaming Means

Hook: Steam from a cooker keeps flowing — a little steam, then more steam, continuously. The professor's image is exact: some data never stops, and waiting for it to "finish" means waiting forever. Streaming is how you process data that has no end.

Streaming is data continuously flowing. Like steam coming from a cooker at home: a little steam, then more steam, continuously. Traffic data is stream data; YouTube streaming is stream data. When more data comes, processing runs continuously. Input arrives, and which level comes first is processed first — level one, level two — the pipeline adds it incrementally. It is not "collect all the streaming data and then process"; it is process as it comes. The techniques reduce latency and allow incremental processing.

The contrast to hold onto: batch processing waits for a full chunk (say a day's worth of data) and then runs; streaming processes each arrival as it lands. Reference material makes the same point: nearly all data is produced continually at its source, and batch is simply a convenient way of processing that stream in large chunks. Streaming trades away the wait and gets latency down to near real time — the data is available to a downstream system a short time after it is produced.

12.11.2 Worked Example: Processing a Three-Hour Movie

Worked example — one three-hour movie, ten engines, five-minute frames. Take a three-hour YouTube movie. It starts reading the first-level input table, incrementally: the first 5 minutes go into the input table, then the next 5 minutes go in, then the next — an incremental query adds the next chunk each time.

For the video-streaming example: the 3-hour movie is split into frames; the first 5 minutes is stream one. Stream one arrives and is processed — edited, subtitled — while another process handles the next 5 minutes. That way, one movie can be processed by 10 processing engines at once. For captioning, your machine learning code — your CNN code — runs on each frame and generates the caption. That is the logic you set: streaming pushes the data, splits it, and your processing code consumes it frame by frame.

Sense-check with numbers: a 3-hour movie is 180 minutes. In five-minute chunks that is \(180 / 5 = 36\) chunks. With 10 engines working at once, the whole movie's processing can overlap: engine one takes chunk 1 while engine two takes chunk 2 — the movie does not wait for chunk 36 to arrive before chunk 1 is captioned. Incremental execution on streaming data: the next 5 minutes are added to the input table, processed, added, processed — as it comes, not after everything arrives.

12.11.3 Streaming Frameworks

The frameworks for streaming — real-time and batch — include Apache Spark (via Spark Streaming), Apache Flink, Ray, and Dask. Flink is an open source distributed engine for stateful processing: you can save the state of what happened when the data came — the transaction log has come, take it into Flink, put it into the file system, and then do the processing. Ray is another architecture. On the ingestion side, every company has its own tools to push data: Kafka, Flume (seen earlier in the ecosystem), and Amazon Kinesis. With Spark you can also do structured streaming using a high-level API.

Framework Role
Spark Streaming Streaming module of the in-memory engine from section 12.10
Apache Flink Open source distributed engine for stateful processing — saves the state of what happened when the data came
Ray Another distributed streaming/processing architecture
Dask Python-native parallel and streaming processing
Kafka / Flume / Amazon Kinesis Ingestion: push the data into the stream

The key concepts across all of them: the resilient distributed data set, splitting the job, using Spark queries correctly, and Spark Streaming.

12.11.4 Student Questions and Answers

Q: Can you explain streaming one more time?

A: Sure. Streaming is data continuously flowing — like the steam from a cooker in your home: slowly, then more streams coming. Traffic data is stream data; YouTube streaming is stream data. When more data comes, processing runs continuously; whichever input comes first is processed first, and each new level gets added incrementally. Take a three-hour movie: it starts reading the first-level input table — the first 5 minutes go into this input table, then the next 5 minutes go in, then the next. It is incremental execution on streaming data, not "collect everything, then process." The first 5 minutes is stream one; we process it, edit it, do subtitling, while another process handles the next 5 minutes. One movie can be processed by 10 processing engines, each doing a chunk — your machine learning code, your CNN code, gives captions for the frames. That is streaming: data in, chunk by chunk, processed as it arrives.

When streaming is not the right tool: streaming adds machinery — engines, ingestion, state management — so the reference material's advice is to adopt true real-time streaming only after a business use case justifies the trade-offs. Model training and weekly reporting work fine as batch. The question to ask: do we need the answer within a second of the event, or would a micro-batch (say every minute) be good enough? The professor's framing stays true either way: streaming is processing as it comes, and the movie example shows exactly how.

Recap + bridge: streaming processes data as it arrives — incrementally, chunk by chunk, like steam from a cooker — and the three-hour movie cut into five-minute frames is the working picture: 36 chunks, 10 engines, captions as the frames land. Frameworks (Spark Streaming, Flink, Ray, Dask) plus ingestion tools (Kafka, Flume, Kinesis) put the pattern into practice. The final section of the lecture maps everything you have learned onto the cloud — where every Hadoop component has a vendor name.

12.12 Big Data in the Cloud

12.12.1 Amazon's Big Data Stack

Hook: Learn the concepts once — blocks, replication, name nodes, mappers, reducers — and every vendor's cloud is just a set of new names. Amazon proves it by naming every Hadoop component twice.

Real-world: Amazon gives every Hadoop component a cloud name. Instead of MapReduce, you use EMR — Elastic MapReduce; it is the same thing, just Amazon's name. EMRFS is Amazon's name for HDFS — the HDFS you studied is the same thing; you have the same blocks. The streaming component is Amazon Kinesis. Around it sit Redshift (the warehouse), Redshift Copy, Kafka, the DynamoDB Connector, Amazon DynamoDB itself, Amazon RDS, and Amazon Elasticsearch — the counterpart of the Solr/Lucene search layer. Whatever Hadoop component you know, AWS has a service with the same role.

The mapping is not cosmetic: an EMR job still splits the input, maps it, shuffles it, and reduces it — the four steps of section 12.6 run under the Amazon name. EMRFS still stores blocks with replication; the name node role is played by the EMR service layer. Your mental model from the Hadoop ecosystem transfers without retraining.

12.12.2 Google's Big Data Stack

Real-world: Google has the same story: Google Cloud Dataflow for the processing pipeline, BigQuery for querying big data (the Hive role), Bigtable as the wide-column NoSQL store (the HBase role), and Cloud Storage for the raw data (the HDFS role). Inherently it uses the same concepts as the Hadoop ecosystem — distributed storage and distributed processing, again.

12.12.3 The Same Two Concepts Everywhere

Concept from this lecture Amazon's name Google's name
Distributed storage (HDFS) EMRFS Cloud Storage (raw data), Bigtable (NoSQL, HBase role)
Distributed processing (MapReduce) EMR (Elastic MapReduce) Cloud Dataflow
Streaming Amazon Kinesis (Dataflow streaming pipelines)
Warehouse (Hive role) Redshift BigQuery
NoSQL (HBase role) DynamoDB Bigtable
Search (Solr/Lucene role) Amazon Elasticsearch
Relational serving (RDS role) Amazon RDS Cloud SQL

Whether it is Hadoop on your own hardware, AWS, or Google Cloud, every big data platform supports the same two things: distributed storage and distributed/parallel processing. Learn the concepts once — blocks, replication, name nodes, mappers, reducers, in-memory engines — and every vendor's stack is just a set of new names for the same architecture.

Recap + bridge — the whole lecture in two pillars: distributed storage (HDFS: blocks, replication, name node, data nodes) and distributed processing (MapReduce: split, map, shuffle, reduce; Spark: in-memory RDD partitions) — supported by parallel and distributed computing, powered by in-memory engines, extended by streaming, and renamed by every cloud vendor. This is the conceptual foundation; the big data systems course next semester will build the full depth of HDFS, MapReduce, YARN, and the ecosystem on top of it.

Exam Guidance Summary

Exam note: metadata is a high-value exam area for the comprehensive exam. Questions are still being drafted, but the expectation is clear:

  • Be able to classify metadata: given an artifact, say which type it is — administrative metadata vs structural metadata — and what that metadata does for your pipeline.
  • Know the artifact classes: dataset metadata (location, how collected, when created, restrictions, licenses), feature metadata, label metadata (why labeled that way, labeling version), model metadata (training parameters, evaluation parameters, data set version, weights), and pipeline metadata (DAGs, drift between development, training, staging, and production).
  • Know the experimentation best practices: capturing data version, configuration (YAML), environment, CPUs, memory, Dockerfile, Makefile, code version, hyperparameters, training and hardware metrics, evaluation, and performance.
  • Know the model package: model version, evaluation record, experiment versions, author, modifications, downstream data sets, pipeline artifacts.
  • Be able to compare metadata store vs repository vs registry, and explain pipeline-first vs model-first.

For big data, expect the seven Vs (volume, velocity, variety, veracity, value, variability, visualization) and the two pillars of every big data system: distributed storage (HDFS: blocks, replication, name node, data nodes) and distributed processing (MapReduce: split, map, shuffle, reduce). The distinction between veracity and variability was explicitly flagged as a confusion point — know it: veracity is about the record being true, variability is about keeping the context that makes it meaningful.

Also be ready for the supporting contrasts this session built: traditional analytics versus big data analytics (nature, structure, tools, industry), parallel versus distributed computing (shared memory versus own memory, scale-up versus scale-out), batch versus streaming (process after collection versus process as it comes), and the vendor mappings (EMR/EMRFS/Kinesis on AWS; Dataflow/BigQuery/Bigtable/Cloud Storage on Google).

Full depth on HDFS, MapReduce, YARN, and the ecosystem will be revisited in the big data systems course next semester, so this session is the conceptual foundation, not the final word — the exam tests the concepts, and the next course tests the machinery.

Key Industry Applications

  • Amazon — personalizes advertisements and shopping recommendations from purchase history; runs Alexa voice analysis, customer segmentation, and fraud detection on big data analytics.
  • Ginger — monitors mental health symptoms from user data.
  • Kia Motors — identifies patterns and anomalies, including water quality issues and car control data.
  • Walmart — generates roughly one million customer transactions every hour, which demands big data processing for analytics.
  • Facebook — historically ~40 billion photos, an example of volume that only distributed storage handles.
  • Human genome processing — took ~10 years in the old days and can be done in about a week by combining big data systems with AI.
  • Amazon, Walmart, Trivago — industry users of PySpark with machine learning for faster processing.
  • Toyota / global auto sales — the lecture's MapReduce case study: counting Corolla, Camry, and electric car sales across ~300 countries on a 5-node cluster.
  • AWS — EMR (MapReduce), EMRFS (HDFS), Kinesis (streaming), Redshift, DynamoDB, RDS, Elasticsearch; Google Cloud — Dataflow, BigQuery, Bigtable, Cloud Storage: vendor names for the same distributed storage and distributed processing concepts.
  • Databricks vs Hadoop — a real procurement decision: managed cost vs open source cost, buy vs rent.

DMML Lecture 12 notes · Big Data Systems: Distributed Storage and Distributed Processing

Data Management for Machine Learning· postgraduate· 2026-08-07

Sections Breakdown

112.1 Metadata: The Backbone of the Data Pipeline

Metadata as the label system for datasets, features, labels, models, and pipelines; experiment records; and metadata stores, repositories, and registries.

212.2 Traditional Data Analytics vs Big Data Analytics

Why traditional pipelines fail at scale and how big data analytics differs in the nature, structure, tools, and industries of the data.

312.3 The Seven Vs of Big Data

Volume, velocity, variety, veracity, value, variability, and visualization, with the veracity-versus-variability distinction.

412.4 Goals, Use Cases, and Challenges of Big Data Analytics

Faster real-time decisions, the principle of locality, real-world use cases, and the challenges every big data initiative must answer.

512.5 Distributed Storage with HDFS

Files split into replicated blocks, the replication factor, and the name node as the metadata brain of the file system.

612.6 Distributed Processing with MapReduce

The split-map-shuffle-reduce pipeline with worked word count and global car sales examples, plus compliance through standards and metadata.

712.7 Parallel vs Distributed Computing

Shared-memory parallel systems versus loosely coupled distributed systems, and how a big data cluster mixes both.

812.8 In-Memory Computing with Apache Spark

The memory hierarchy, why in-memory processing wins on latency, and how the Spark engine and PySpark split work across CPUs.

912.9 The Hadoop Ecosystem

The layered Hadoop stack - HDFS, YARN, ZooKeeper, Hive, HBase, Pig, Kafka, and more - in a master-slave architecture.

1012.10 Apache Spark Architecture

Spark Core, resilient distributed datasets, partition sizing, the Spark libraries, and the driver-cluster manager-workers framework.

1112.11 Stream Processing

Processing data as it arrives - the three-hour movie example, streaming frameworks, and when streaming is not the right tool.

1212.12 Big Data in the Cloud

Amazon's and Google's big data stacks as vendor names for the same distributed storage and distributed processing concepts.

13Exam Guidance Summary

The professor's exam guidance: metadata classification, the seven Vs, and the two pillars of every big data system.

14Key Industry Applications

Named real-world users of big data analytics and the AWS and Google Cloud vendor mappings covered in this lecture.

Postgraduate students in Machine Learning

Exam Revision Notes

Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.

12.1 Metadata: The Backbone of the Data Pipeline

Must-know: Every artifact needs metadata (what it is + its version): dataset (location, provenance, licenses), feature (per-column meaning, type, restrictions), label (labeling rule version, source, confidence), model (training/eval parameters, dataset version, weights), pipeline (DAGs, drift across stages). Classify each as administrative or structural metadata.

⚠️ Top pitfall: Treating metadata as an afterthought: an experiment without a complete run record (data version, config, environment, code version, hyperparameters, metrics) cannot be reproduced or trusted in production.

Self-check: Given a trained model with its weights, training hyperparameters, and the data set version that trained it — which metadata class does each piece belong to?

Connects to: 12.5 Distributed Storage with HDFS

12.2 Traditional Data Analytics vs Big Data Analytics

Must-know: Big data vs traditional analytics differs in four dimensions: nature of data (book vs library; 1 source vs 20 sources), structure (structured tables vs unstructured/raw needing conversion), tools (queries/reports vs automation, parallel and distributed processing), and industry (IT/travel/healthcare vs banking/retail).

⚠️ Top pitfall: Reaching for a dashboard tool (Power BI, Tableau) as the processing engine, or porting an old query unchanged onto distributed data.

Self-check: Why does the same customer data become a big data problem at 20 sources when it is trivial at 1 source?

Connects to: 12.3 The Seven Vs of Big Data; 12.6 Distributed Processing with MapReduce

12.3 The Seven Vs of Big Data

Must-know: Name all seven Vs: volume, velocity, variety, veracity, value, variability, visualization. The exam-relevant distinction: veracity = data as accurate as possible (noise and error), variability = preserving the context (blend, sugar level, time of day).

⚠️ Top pitfall: Confusing veracity with variability — both sound like data quality, but one is about a true record and the other about a meaningful record.

Self-check: A system logs the coffee order but drops the blend and sugar level; next day it recommends a different coffee. Which V failed?

Connects to: 12.4 Goals, Use Cases, and Challenges of Big Data Analytics; 12.11 Stream Processing

12.4 Goals, Use Cases, and Challenges of Big Data Analytics

Must-know: Big data analytics = faster, real-time decisions with latency as the main concern. Locality: process where the data is; move the code near the data and transfer only results. Big data is NOT a volume game, NOT an RDBMS replacement, NOT a warehouse replacement.

⚠️ Top pitfall: Treating big data as simply 'more data' and forgetting latency: every step (collect, store, pre-process, analyze) must scale, and a one-size-fits-all RDBMS breaks when data grows and budgets stay limited.

Self-check: Why does moving the code near the stock data beat fetching the raw data to a distant system?

Connects to: 12.5 Distributed Storage with HDFS; 12.6 Distributed Processing with MapReduce

12.5 Distributed Storage with HDFS

Must-know: HDFS splits files into blocks (2 KB–16 KB series, or 2/4/16 MB) spread across nodes; each block is replicated r = 3 times by default, configurable in an XML file. The name node keeps block locations and topology; data nodes store blocks. Replication = fault tolerance + faster local access.

\[r = 3 \quad (\text{default replication factor}), \qquad r \in \{1, 2, 3, 4, 5, \dots\} \text{ configurable}\]

⚠️ Top pitfall: Thinking replication exists only for disaster recovery — it also serves faster processing via locality of reference (Pune users read the Pune copy).

Self-check: A 10 MB file splits into five 2 MB blocks with r = 3. How much raw storage does it consume across the cluster, and why is that price paid?

Connects to: 12.4 Goals, Use Cases, and Challenges of Big Data Analytics; 12.6 Distributed Processing with MapReduce; 12.9 The Hadoop Ecosystem

12.6 Distributed Processing with MapReduce

Must-know: MapReduce pipeline order: split, map, shuffle, reduce. Count(word) = sum over mappers of c_j(w). Ideal speedup S = T_1 / T_n; a 10-minute job on one machine can run in 1 minute when spread (less in practice due to shuffle cost).

\[\text{count}(w) = \sum_{\text{mappers } j} c_j(w)\]

⚠️ Top pitfall: Expecting the full ideal speedup: shuffle and network costs mean real speedup is smaller than T_1 / T_n. Also assuming the input is clean — dealers hand over ALL car models, so filtering is part of the pipeline, and compliance needs a decided standard plus metadata control.

Self-check: Word count input: deer, bear, river, car, car, river, deer, bear, car on three machines. What does the reduce step output, and why does it sum to 9?

Connects to: 12.5 Distributed Storage with HDFS; 12.7 Parallel vs Distributed Computing

12.7 Parallel vs Distributed Computing

Must-know: Parallel = shared memory, tightly coupled, one machine, scale-up (limited). Distributed = own memory per node, message passing, loosely coupled, scale-out (add machines). Both coexist: name node on a shared-memory parallel machine, data nodes distributed.

⚠️ Top pitfall: Thinking the two models are mutually exclusive — a big data system routinely mixes them (parallel master for metadata, distributed data nodes). Also expecting distributed systems to be efficient without effort: latency exists and is managed via locality of reference.

Self-check: Why does the parallel model hit a ceiling while the distributed model can add nodes at will?

Connects to: 12.4 Goals, Use Cases, and Challenges of Big Data Analytics; 12.5 Distributed Storage with HDFS

12.8 In-Memory Computing with Apache Spark

Must-know: Memory hierarchy order: registers, cache (L1-L3), main memory, local storage, remote storage. In-memory computing = process in the machine's own memory for millisecond reactions. Spark = open source in-memory big data engine, written in Scala; PySpark = Python API; the engine splits Python code into small pieces run across CPUs.

⚠️ Top pitfall: Assuming in-memory speed is free: DRAM is expensive, so in-memory systems are paired with cheaper storage and cloud jobs rent memory only for the job's lifetime.

Self-check: Why does a data scientist asking questions repeatedly prefer data kept in memory over data on remote storage?

Connects to: 12.5 Distributed Storage with HDFS; 12.10 Apache Spark Architecture

12.9 The Hadoop Ecosystem

Must-know: Hadoop layered stack: HDFS (storage), YARN (resource negotiator), ZooKeeper (coordination), Ambari (management), MapReduce (processing), Hive/Drill (warehouse/query), HBase (NoSQL), Pig (scripting), Mahout/MLlib (ML), Kafka/Storm (streaming), Solr/Lucene (search), Oozie (scheduler), Flume/Sqoop (ingestion). Master-slave: name node directs, data nodes manage blocks on local disks.

⚠️ Top pitfall: Open source is not free of cost: one small change in a configuration file can blow up the ecosystem, support is not guaranteed, and maintenance demands a good Java programmer and system person. Buy (Databricks) vs rent decision.

Self-check: A real word count job on a 3-node cluster returned 223 total words with big 6, data 10, distributed 2. What part of the MapReduce pipeline produced those three partial counts?

Connects to: 12.5 Distributed Storage with HDFS; 12.6 Distributed Processing with MapReduce; 12.10 Apache Spark Architecture

12.10 Apache Spark Architecture

Must-know: RDD = Resilient Distributed Dataset: split into partitions, one piece per processor, recomputable if lost. Partition size ≈ N / number of workers (10,000 records / 2 workers = 5,000 each). Spark libraries: Spark Streaming, MLlib, Spark SQL, GraphX. Roles: driver (control), cluster manager (assigns tasks), workers (run tasks on partitions).

\[\text{partition size} \approx \frac{N}{\text{number of workers}}, \qquad N = 10{,}000 \text{ records}\]

⚠️ Top pitfall: Thinking partitions are fixed in size: the formula gives an approximate size — with more workers each partition shrinks (10,000 records / 4 workers ≈ 2,500 each), and the point is that workers share the load instead of one machine reading everything.

Self-check: A file has 10,000 records and Spark uses two workers. What is each partition's size, and why does the sum of the partitions equal 10,000?

Connects to: 12.8 In-Memory Computing with Apache Spark; 12.9 The Hadoop Ecosystem

12.11 Stream Processing

Must-know: Streaming = process as data comes, chunk by chunk (incremental execution), not collect-then-process. Three-hour movie = 180 minutes = 36 five-minute chunks; 10 engines process chunks in parallel; CNN code captions each frame. Frameworks: Spark Streaming, Flink (stateful), Ray, Dask; ingestion: Kafka, Flume, Kinesis.

⚠️ Top pitfall: Using streaming where batch would do: streaming adds machinery (engines, ingestion, state), so adopt true real-time only when the use case justifies it; micro-batch is often good enough.

Self-check: Why can one three-hour movie be processed by 10 engines instead of one, and what arrives first in the input table?

Connects to: 12.8 In-Memory Computing with Apache Spark; 12.10 Apache Spark Architecture

12.12 Big Data in the Cloud

Must-know: AWS: EMR = MapReduce, EMRFS = HDFS, Kinesis = streaming, Redshift = warehouse, DynamoDB = NoSQL, RDS = relational, Elasticsearch = search. Google: Dataflow = processing, BigQuery = Hive role, Bigtable = HBase role, Cloud Storage = HDFS role. Both rest on distributed storage + distributed/parallel processing.

⚠️ Top pitfall: Treating vendor names as new technologies — EMR still splits, maps, shuffles, and reduces; EMRFS still stores replicated blocks. The concepts transfer; only the names change.

Self-check: Your company's Hadoop cluster uses HDFS, MapReduce, and HBase. Which AWS and Google services play those roles?

Connects to: 12.5 Distributed Storage with HDFS; 12.6 Distributed Processing with MapReduce; 12.9 The Hadoop Ecosystem

Exam Guidance Summary

Must-know: Metadata classification skills and the two pillars of big data systems (distributed storage with HDFS, distributed processing with MapReduce) are the exam-critical material; the veracity-vs-variability distinction is an explicitly flagged confusion point.

⚠️ Top pitfall: Confusing veracity (accuracy) with variability (context preservation).

Self-check: Given an artifact, can you name its metadata type and what that metadata does for your pipeline?

Connects to: 12.1 Metadata: The Backbone of the Data Pipeline; 12.3 The Seven Vs of Big Data; 12.5 Distributed Storage with HDFS

Key Industry Applications

Must-know: The lecture's named applications: Amazon personalization and fraud detection, Ginger mental health monitoring, Kia anomaly detection, Walmart's hourly transaction volume, Facebook's photo volume, human genome processing speedup, Toyota global sales counting, and the vendor stacks (AWS and Google) as renames of the two pillars.

⚠️ Top pitfall: Treating big data as a tech-company-only game — the applications (car maker, mental health app, genome research) span every industry.

Self-check: Which companies named in this lecture use PySpark with machine learning for faster processing?

Connects to: 12.4 Goals, Use Cases, and Challenges of Big Data Analytics; 12.6 Distributed Processing with MapReduce; 12.12 Big Data in the Cloud

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Key

Select Provider & API Key
🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.