You now know what Big Data is, what it is for and what difficulties it poses. This lesson answers the remaining question: what does a system capable of handling it look like on the inside? We are going to draw the complete map of a data platform: the layers it is made of, the two main ways of processing (batch and stream), the basic ideas of distributed systems on which everything rests and the two best-known architecture patterns, Lambda and Kappa.

This is a mental map lesson. You are not going to learn how to use any particular tool here: names such as HDFS, Kafka or Spark will come up, but only to place them. The aim is that, when you study each part in detail in the following modules, you always know where it fits and why it exists. By the end of the lesson you will have NovaMarket's target architecture, which will serve as a guide for the rest of the course.

The layers of a data platform

However different the technologies may be, almost all data platforms are organised into the same layers. Data passes through them from left to right, from where it originates to where it is used.

flowchart LR
    A[Sources] --> B[Ingestion]
    B --> C[Storage]
    C --> D[Processing]
    D --> C
    D --> E[Serving and consumption]
    C --> E
    subgraph T[Cross-cutting layers]
        direction LR
        O[Orchestration]
        G[Governance]
        S[Security]
    end
    T -.- B
    T -.- C
    T -.- D
    T -.- E

Sources

These are the systems where the data originates. The platform does not control them: it simply collects what they produce.

  • Operational databases: the ones that keep the business running (the shop, the warehouse, invoicing).
  • Applications and websites: they generate behavioural events (clickstream).
  • Files and external systems: supplier exports, third-party data, APIs.
  • Devices and sensors: in sectors such as manufacturing or transport.

Ingestion

This is the layer that brings the data from the sources into the platform. It can work in two ways:

  • In batches: the data is copied at regular intervals (for example, the day's orders are extracted every night).
  • As a stream: each piece of data is sent as soon as it is produced, through a messaging system that acts as a "conveyor belt" between producers and consumers. Apache Kafka is the best-known example.

The golden rule of ingestion is do not lose data and do not alter it: it is collected as it arrives and transformations are left for later.

Storage

This is where the data lives durably. In Big Data, storage is distributed (spread across many machines) and is usually organised into several types of system depending on the use:

  • Distributed file systems and object storage: they store files of any type and size at low cost (HDFS, or the cloud providers' object services).
  • Data lake: a large repository that keeps the data raw, in its original format.
  • Data warehouse: a store of data that has already been cleaned and structured, optimised for analytical queries with SQL.
  • NoSQL databases: designed for very fast access to specific items of data with flexible schemas.

The whole of Module 2 is devoted to this layer.

Processing

This is the layer that transforms the data: it cleans, filters, joins, aggregates and computes. It takes data from storage (or directly from ingestion), processes it by spreading the work across many machines and puts the result back into storage, ready to be used. That is why the diagram has one arrow going out and another coming back. Apache Spark is today's most widely used processing engine. We will study it in Module 3.

Serving and consumption

This is the layer where data turns into value, because it reaches the people who use it:

  • Dashboards and reports for management and business teams.
  • Ad hoc queries by analysts, usually in SQL.
  • Machine learning models that are trained on the data.
  • Applications that consume results (for example, the website showing recommendations).

It corresponds to Module 4.

Cross-cutting layers

Three functions do not belong to any particular stage because they affect all of them:

Cross-cutting layer What it solves Key question
Orchestration Coordinates the execution of processes: in what order, at what time, what to do if one fails What runs, when and after what?
Data governance Catalogue, definitions, owners, quality and traceability of the data What data do we have, what does it mean and where does it come from?
Security Authentication, permissions, encryption and auditing Who can see and do what?

Summary of the layers

Layer Function Example technologies Course module
Sources Originate the data Databases, applications, sensors 1
Ingestion Brings the data into the platform Kafka, loading tools 3
Storage Keeps the data HDFS, object storage, NoSQL, data lake, data warehouse 2
Processing Transforms and computes Hadoop MapReduce, Spark 3
Serving and consumption Delivers the results SQL engines, dashboards, models 4
Orchestration Coordinates the processes Workflow orchestrators 3
Governance Organises and documents the data Catalogues, quality rules 5
Security Protects the data Access control, encryption 7

Batch processing and stream processing

There are two fundamental ways of processing data. The difference between them shapes the entire architecture.

Batch processing

Data is accumulated over a period and processed all together, in one go. The input data is a finite, known set: "yesterday's orders", "June's events".

  • It is like doing the laundry: you wait until you have a full load and wash it all at once.
  • The result arrives with a delay (minutes or hours), but the process is simple, efficient and easy to repeat if something goes wrong.

Stream processing (streaming)

Each piece of data is processed as soon as it arrives, continuously. The input data is a stream with no end: you can never say "now I have it all".

  • It is like a conveyor belt on which each item is inspected as it goes past.
  • The result is available within seconds or less, but the system is more complex: it has to run without interruption and deal with problems such as data that arrives late or out of order.
Aspect Batch Stream (streaming)
Input data Finite set Continuous stream, with no end
When it is processed Periodically (every hour, every night) Continuously, as each piece of data arrives
Latency (delay in the result) Minutes to hours Milliseconds to seconds
Complexity Lower Higher
Reprocessing after an error Simple: the batch is rerun Trickier
Example at NovaMarket Daily sales report; conversion funnel Fraud detection; live sales dashboard

Two ideas to help you choose well:

  • Latency has a price. Going from "every night" to "every second" multiplies the complexity and the cost. The right question is not "can it be real-time?" but "which decision improves if the data arrives sooner?".
  • They are not mutually exclusive. Most platforms combine the two: batch for historical analysis and stream for whatever demands an immediate reaction.

You will see batch processing in lessons 03-01 to 03-04 and stream processing in 03-05.

Fundamentals of distributed systems

In lesson 01-01 we saw that Big Data is based on horizontal scaling: many machines cooperating. A set of machines that work together and behave, as far as the user is concerned, like a single system is a distributed system. These are the essential concepts.

Cluster and node

  • A node is each of the machines (physical or virtual) in the system.
  • A cluster is the set of nodes connected by a network that work in a coordinated way.

The nodes are usually divided between two roles: a few coordinate (they know where each piece of data is and hand out the tasks) and most do the work (they store data and run computations). They go by different names depending on the technology (master and workers, driver and executors...), but the idea is the same.

Partitioning

A large dataset does not fit on one node, so it is split into chunks, called partitions, which are spread across the nodes. Partitioning achieves two things:

  • Capacity: between them, the nodes store what none of them could on its own.
  • Parallelism: each node processes its partitions at the same time as the others. With ten nodes, a job can finish in a fraction of the time.

The way of deciding which partition each piece of data goes to is called the partition key. For example, distributing events by date or orders by customer. Choosing it well is an important design decision, because it determines which queries will be fast.

Replication

In a cluster of hundreds of machines, failures are the norm, not the exception: every week a disk breaks or a node goes down. So as not to lose data, each partition is stored copied on several nodes. The number of copies is called the replication factor (a common value is 3).

Fault tolerance

This is the system's ability to keep working correctly even if some of its components fail. It relies on replication (if a node goes down, the data is still available on another) and on automatic retries (if a node fails halfway through a computation, its share of the work is assigned to another). For the user, ideally, the failure goes unnoticed.

flowchart TB
    subgraph Cluster["3-node cluster, replication factor 2"]
        direction LR
        subgraph N1[Node 1]
            P1a[Partition A]
            P3b[Partition C - copy]
        end
        subgraph N2[Node 2]
            P2a[Partition B]
            P1b[Partition A - copy]
        end
        subgraph N3[Node 3]
            P3a[Partition C]
            P2b[Partition B - copy]
        end
    end

In the diagram, the data is split into three partitions (A, B and C) and each one is on two nodes. If any one of the nodes stops working, all three partitions are still available on the other two.

An illustration in Python

The following script does not use any Big Data technology: it simulates with lists what a distributed system really does, so that you can see that the ideas are simple. It distributes eight orders across three "nodes" using customer_id as the partition key, stores two copies of each one and checks what happens if a node fails.

NUM_NODES = 3

# Sample orders: (order_id, customer_id, total_amount)
orders = [
    (1001, 15, 149.90), (1002, 27, 39.95), (1003, 15, 89.00),
    (1004, 42, 420.00), (1005, 8, 59.99), (1006, 31, 1299.00),
    (1007, 27, 15.50), (1008, 4, 230.00),
]

# 1. Partitioning + replication: each order is stored on 2 nodes
nodes = {n: [] for n in range(NUM_NODES)}
for order in orders:
    customer_id = order[1]
    primary = customer_id % NUM_NODES           # the node it belongs to
    replica = (primary + 1) % NUM_NODES         # the next one keeps the copy
    nodes[primary].append(order)
    nodes[replica].append(order)

for n, contents in nodes.items():
    print(f"Node {n}: orders {sorted(o[0] for o in contents)}")

# 2. Fault tolerance: node 1 breaks down
del nodes[1]
survivors = {o for contents in nodes.values() for o in contents}
print(f"After losing node 1, {len(survivors)} of {len(orders)} orders are preserved")

Explanation:

  • customer_id % NUM_NODES computes the remainder of dividing the customer identifier by 3, which is always 0, 1 or 2. It is a simple way of assigning each customer to a node. It has a useful property: all the orders from the same customer go to the same node (orders 1001 and 1003, both from customer 15, end up together), which will make queries by customer very fast.
  • The replica is stored on the next node; the % NUM_NODES means that after the last node we wrap round to the first.
  • del nodes[1] simulates the breakdown. Afterwards, all the orders left on the surviving nodes are gathered into a set (which removes repeats).

Output:

Node 0: orders [1001, 1002, 1003, 1004, 1005, 1007]
Node 1: orders [1001, 1002, 1003, 1004, 1006, 1007, 1008]
Node 2: orders [1005, 1006, 1008]
After losing node 1, 8 of 8 orders are preserved

Not a single order has been lost. Notice a realistic detail too: the distribution has turned out unbalanced (node 2 has fewer than half as many orders as node 1). With an unlucky partition key, some nodes work much harder than others; it is a classic problem, called skew, which will reappear when we optimise Spark in Module 3. Real systems use more elaborate distribution strategies, but the principle is the one you have just seen.

The CAP theorem, intuitively

Spreading data across several nodes has an unavoidable cost, which the CAP theorem describes. Consider three desirable properties of a distributed system:

  • Consistency (C): all the nodes offer the same data at the same moment. If you have just written a value, any subsequent read returns it, whichever node is asked.
  • Availability (A): every request receives a response, even if some nodes have failed.
  • Partition tolerance (P): the system keeps working even if communication between groups of nodes is cut.

Mind the vocabulary: here "partition" means a network split that leaves some nodes cut off from others. It has nothing to do with the data partitions of the previous section.

The theorem states that, when a network split occurs, a distributed system cannot guarantee both consistency and availability at the same time: it has to sacrifice one of the two.

An example to make it clear

The stock of a NovaMarket television is replicated on two nodes, one in Valencia and one in Madrid. There is one unit left. The network between the two data centres is cut and, at that moment, two purchases arrive: one at the Valencia node and one at the Madrid node. Each node has two options:

Option What the node does Consequence What is prioritised
Reject the operation "I cannot confirm the stock with the other node; try again later" Nothing is oversold, but the customer sees an error Consistency (a CP system)
Accept the operation It sells with the data it has, to be reconciled when the network comes back The customer buys, but two units have been sold when there was only one Availability (an AP system)

There is no magic third option. Since in a real distributed system network splits do happen sooner or later, partition tolerance is not optional; what you actually choose is what to sacrifice when the split comes: consistency or availability.

What it means in practice

  • Neither choice is "the right one". It depends on the data. For a bank account balance, consistency is preferred. For a product's view counter or the contents of a cart, availability: better a slightly out-of-date figure than an error page.
  • Many systems that prioritise availability offer eventual consistency: after the split, the replicas reach agreement and end up converging on the same value, even though they differed for a while.
  • It is a useful simplification, not a rigid classification: many systems let you adjust this balance operation by operation.

The CAP theorem explains why so many different databases exist: each one makes different trade-offs. We will come back to it when we study NoSQL databases in lesson 02-03.

Lambda and Kappa architectures

If a platform needs both complete historical analysis (batch) and immediate results (stream), how are they combined? There are two reference patterns.

Lambda architecture

It proposes two parallel paths for the same data:

  • The batch layer stores all the historical data and periodically recomputes complete, exact results. It is slow, but reliable.
  • The speed layer stream-processes only the most recent data, to cover the gap between the last batch computation and the present moment. It is fast, but may be approximate.
  • The serving layer combines the two results to answer queries.
flowchart LR
    F[Sources] --> I[Ingestion]
    I --> B[Batch layer<br/>full history]
    I --> V[Speed layer<br/>recent data]
    B --> S[Serving layer]
    V --> S
    S --> C[Queries and<br/>dashboards]
  • Advantage: it combines accuracy (batch) and speed (stream), and it is robust: if the speed layer gets something wrong, the next batch computation corrects it.
  • Drawback: you have to write and maintain the same logic twice, in two different systems, and guarantee that both give consistent results. This is its great weakness.

Kappa architecture

It simplifies the approach: everything is a stream. There is only one path, the stream processing one, and a durable event log that keeps the history. If something has to be recomputed (because the logic has changed or a bug has been fixed), you read the log again from the beginning with the same code.

flowchart LR
    F[Sources] --> L[Event log<br/>durable and replayable]
    L --> P[Stream<br/>processing]
    P --> S[Serving layer]
    S --> C[Queries and<br/>dashboards]
    L -. reprocess from the start .-> P
  • Advantage: a single codebase and a single system to maintain.
  • Drawbacks: it requires keeping the event log for a long time and a streaming engine capable of reprocessing large volumes; in addition, certain complex historical analyses are more natural in batch.

Comparison

Aspect Lambda Kappa
Processing paths Two: batch and stream One: stream
Business logic Duplicated Single
Reprocessing the history With the batch layer By rereading the event log
Operational complexity High (two systems) Lower (one), but demanding on the streaming engine
Fits best when... Heavy historical analysis predominates and the immediate part is a complement Almost the whole business revolves around real-time events

In practice, today's platforms rarely follow either pattern to the letter. Modern engines let you use almost the same code for batch and for stream, which reduces Lambda's main drawback, and many organisations adopt intermediate solutions. What matters is that you know both models, because they are the vocabulary in which these decisions are discussed.

NovaMarket's target architecture: the map of the course

With all of the above, Laura draws the architecture NovaMarket wants to reach. It is deliberately simple and takes a pragmatic approach: batch for almost everything and stream only where immediacy adds value (fraud detection and the live sales dashboard).

flowchart LR
    subgraph Sources
        BD[(Shop<br/>database:<br/>orders, order_lines,<br/>products, customers)]
        WEB[Website and app:<br/>web_events]
    end
    subgraph Ingestion
        LOTE[Daily<br/>batch load]
        MSG[Stream<br/>messaging]
    end
    subgraph Storage
        LAKE[(Data lake:<br/>raw and<br/>refined data)]
        DWH[(Data warehouse /<br/>lakehouse)]
        NOSQL[(NoSQL<br/>database)]
    end
    subgraph Processing
        BATCH[Batch<br/>processing]
        STREAM[Stream<br/>processing]
    end
    subgraph Consumption
        BI[Dashboards<br/>and SQL]
        ML[Machine learning<br/>models]
        APP[Website: recommendations<br/>and fraud alerts]
    end
    BD --> LOTE --> LAKE
    WEB --> MSG --> LAKE
    MSG --> STREAM
    LAKE --> BATCH --> DWH
    BATCH --> LAKE
    STREAM --> NOSQL
    DWH --> BI
    LAKE --> ML
    ML --> NOSQL
    NOSQL --> APP

How to read the diagram, following the path the data takes:

  1. The shop's data (orders, order_lines, products, customers) is copied to the data lake every night by a batch load.
  2. The web events are sent to the messaging system as soon as they are produced. From there they follow two paths: they are stored in the data lake for historical analysis and, at the same time, they feed the stream processing.
  3. Batch processing cleans and joins the data in the data lake and leaves analysis-ready tables in the data warehouse.
  4. Stream processing computes immediate results (for example, a fraud risk score) and stores them in a NoSQL database, which offers very fast access.
  5. Consumption has three routes: analysts like Marc query the data warehouse; the machine learning models are trained on the data in the data lake; and the website reads recommendations and alerts from the NoSQL database.

Although they are left out of the drawing so as not to clutter it, orchestration, governance and security surround every part.

Where each part is studied

This table is your orientation guide. Come back to it every time you start a module.

Part of the architecture What you will learn Where
Distributed file system underpinning the data lake How enormous files are stored spread across nodes 02-01
File formats Why it is not a good idea to store everything as CSV or JSON, and what the alternatives are 02-02
NoSQL database Types, uses and the relationship with the CAP theorem 02-03
Data lake Organisation into zones and best practices 02-04
Data warehouse and lakehouse Analysis-oriented storage 02-05
Batch processing MapReduce and, above all, Apache Spark 03-01 to 03-04
Messaging and stream processing Handling events in real time 03-05
Data loading and orchestration Ingestion pipelines, ETL/ELT and their coordination 03-06
Dashboards, SQL and models Analysis, machine learning and visualisation Module 4
Quality, governance and costs How to keep the platform reliable and cost-effective Module 5
Choosing tools and the cloud Ecosystems, providers and selection criteria Module 6
Security, privacy and ethics Protecting data and using it responsibly Module 7
Evolution of the platform Trends and generative artificial intelligence Module 8

The use cases on the map

To check that the map makes sense, let us place on it the four use cases from lesson 01-02:

Use case Path through the architecture Type of processing
Conversion funnel Events → messaging → data lake → batch → data warehouse → dashboard Batch
Demand forecasting Shop → daily load → data lake → batch → model → dashboard Batch
Recommendations Events and orders → data lake → model → NoSQL → website Batch (the computation), with fast serving
Fraud detection Events and orders → messaging → stream → NoSQL → alert Stream

Three of the four cases are solved in batch. That is the usual pattern, and it confirms Laura's decision to reserve stream processing for what is strictly necessary.

Common Mistakes and Tips

  • Confusing architecture with a list of tools. The architecture is the layers, their responsibilities and how the data flows. Tools are interchangeable; responsibilities are not. Think first "I need a stream ingestion layer" and only then about which product covers it.
  • Wanting real time for everything. It is the fastest way to multiply cost and complexity. Justify every stream with a decision that improves thanks to immediacy.
  • Transforming the data during ingestion. If it is modified on the way in and a bug is later discovered in the transformation, the original data has been lost. Always keep the raw data.
  • Forgetting the cross-cutting layers. Orchestration, governance and security do not show up in the eye-catching diagrams, but without them a platform becomes unmanageable within a few months.
  • Misreading the CAP theorem. It does not say that you always have to give something up: in normal operation a system can be both consistent and available. The choice is only forced on you during a network split. Do not confuse the CAP "partition" with data partitioning either.
  • Believing that replication replaces backups. Replication protects against a machine breaking down, not against accidental deletion: if someone drops a table, the command is obediently replicated to every copy.
  • Tip: whenever you come across a new technology, ask yourself two questions: which layer does it belong to? And does it work in batch, in stream or both ways? With that you will have it placed on the map.

Exercises

Exercise 1: placing parts in the layers

Say which layer of the platform (sources, ingestion, storage, processing, serving/consumption, orchestration, governance or security) each NovaMarket element belongs to:

  1. The mobile app customers buy from.
  2. The process that copies the day's orders to the data lake every night.
  3. The rule that prevents analysts from seeing customers' names.
  4. The computation that joins web_events with products to obtain views by category.
  5. The dashboard where Irene checks the day's sales.
  6. The mechanism that launches the above computation only when the nightly copy has finished successfully.
  7. The document that defines exactly what "valid order" means.

Exercise 2: batch or stream?

For each need, decide whether batch or stream processing is appropriate, and justify it:

  1. Sending category managers a report every Monday with the previous week's best-selling products.
  2. Alerting the systems team if the error rate on the payment page exceeds 5% for more than one minute.
  3. Recomputing the customer segmentation once a month based on purchase history.
  4. Showing the notice "15 people are viewing this right now" on a product page.

Exercise 3: reasoning with CAP

During a network split between two data centres, say for each item of NovaMarket data whether you would prioritise consistency or availability, and why:

  1. The contents of a customer's shopping cart.
  2. Charging for an order at the payment gateway.
  3. The "number of times this product has been viewed" counter.

Solutions

Exercise 1

  1. Sources.
  2. Ingestion (batch).
  3. Security.
  4. Processing.
  5. Serving and consumption.
  6. Orchestration.
  7. Data governance.

Common mistake: confusing items 2 and 6. The process that copies is ingestion; the mechanism that decides when and in what order the processes run is orchestration.

Exercise 2

  1. Batch. The report is weekly; nothing is gained by computing it continuously.
  2. Stream. The value lies in reacting on the spot; finding out the next day is no use.
  3. Batch. It is a periodic computation over the whole history.
  4. Stream. The figure only makes sense if it reflects what is happening right now.

General hint: ask yourself how much value the result loses if it arrives an hour late. If the answer is "none", it is a batch case.

Exercise 3

  1. Availability. It is preferable for the customer to be able to keep adding products even if, once the network is restored, two versions of the cart have to be reconciled. A cart that does not work is a lost sale.
  2. Consistency. Charging twice, or charging without recording the order, is unacceptable. It is preferable to show an error and ask the customer to try again.
  3. Availability. A slightly stale figure harms nobody; it is the typical case of eventual consistency.

The underlying idea: the choice depends on the cost of getting it wrong for each item of data, not on the technology.

Conclusion

This lesson has given you the map you need to find your way around the rest of the course:

  • A data platform is organised into layers: sources, ingestion, storage, processing and serving/consumption, wrapped by three cross-cutting layers: orchestration, governance and security.
  • There are two ways of processing: batch (finite sets, deferred result, simpler) and stream (continuous data, immediate result, more complex). The usual approach is to combine them.
  • Distributed systems are based on clusters of nodes, which partition the data to gain capacity and parallelism, and replicate it to be fault-tolerant.
  • The CAP theorem is a reminder that, when the network splits, you have to choose between consistency and availability.
  • Lambda (two paths: batch and speed) and Kappa (everything is a stream) are the two reference patterns for combining history and immediacy.
  • NovaMarket's target architecture puts each technology in the course in its place.

That brings the conceptual part of the module to an end. Before going into the technologies we need to prepare the workbench: in the next lesson, Setting Up the Practice Environment, you will install the necessary tools on your computer and generate the fictional NovaMarket data you will practise with throughout the course.

© Copyright 2026. All rights reserved