Skip to main content
Stream Processing and Analytics

Events, Topics, Non-Functional Requirements, and the Big Data Data Model

Published: 2026-08-07
Level: postgraduate
Audience: Postgraduate students in stream processing and analytics

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

  • Batch processing vs stream processing — covered in Lecture 1 (Course Overview, Stream vs Batch Processing, Windows, and Real-World Streaming Applications)

2.1 Data Processing Systems and the Two Core Operations

Hook: Every stream-processing system you will meet in this course — from the simplest alerting dashboard to a full big data platform — performs exactly two kinds of computation on the stream. Not ten, not three. Two. If you can name them, you can already predict the shape of every architecture we will study.

2.1.1 What a Data Processing System Is

This session looks at system design for big data systems: what data processing applications are, and why they behave differently from traditional applications. Two areas get most of the attention: the requirements of data processing systems, and the data model — traditional versus data intensive applications.

When we say a data processing system, we mean orchestration: orchestration of various tools and integration towards the different practices the organization follows. It is not one single tool that caters to all needs — it is an integrated set of tools working together. Think of a kitchen brigade in a restaurant: the chef does not expect one appliance to wash, chop, cook, and plate. A prep station handles chopping, another station handles cooking, a third handles plating — and the chef coordinates them so that everything arrives at the table at the right time. A data processing system is the same idea: one tool ingests data, another stores it, another analyzes it, and integration code coordinates the flow.

Intuition: The word "system" is doing real work here. A single tool is not a system — a system is the integration of tools. When you design one, you are designing the hand-offs between tools as much as the tools themselves.

Every application starts from what we call programming systems, and there we talk about data types. The three data types to know are:

  • Structured data — data with a fixed, predefined shape: columns and types decided in advance, like a well-filled form. Rows in a relational table are the classic example.
  • Semi-structured data — data that has some organization but no rigid schema: a JSON message or an XML document. Every message can carry slightly different fields, and that flexibility is the point.
  • Unstructured data — free-form content with no predictable structure: a text document, an email body, an image, a video.

On top of that, any application's requirements fall into two categories:

  • Functional requirements — what the system must do. "When a customer swipes a card, send an alert" is a functional requirement.
  • Non-functional requirements — how well the system must do it. "The alert must arrive within 200 milliseconds, 99.9% of the time, even when the database is slow" is a non-functional requirement.

The non-functional side gets a deep look in section 2.5, where it splits into reliability, scalability, and maintainability.

2.1.2 The Only Two Stream Computations: Filtering and Aggregation

Here is the claim that shapes the whole course: in stream processing and analytics, every system we look at performs only two types of computation.

  1. Filtering — deciding which events to keep. Each event is examined on its own, and it either passes the test or does not. Nothing is combined; events are just selected or dropped.
  2. Aggregation — combining many events into summary numbers. Many events are collapsed into one number: a count, a total, a percentage, a rate.

Nothing else is computed at the stream layer.

A bank alerting you about a possibly fraudulent card transaction is filtering: the system watches each event and keeps only the ones that look suspicious. A monthly report that says "10,000 transactions, of which 35% converted into EMIs" is aggregation: many events collapsed into one number.

Worked example — the two operations in one bank report. Suppose a bank receives 10,000 credit card transaction events in a month.

  • Filtering step: keep only the events where the merchant is Amazon — say 2,000 events pass. The other 8,000 are dropped, unchanged.
  • Aggregation step: collapse those 2,000 events into summary numbers — total transaction volume (say ₹48 lakh) and the share converted into EMIs (35%, i.e., 700 events).

The final report "2,000 Amazon transactions worth ₹48 lakh, 35% converted into EMIs" is the output of exactly two operations: a filter, then an aggregate.

Sense-check: the percentage makes sense only after the filter ran — if we aggregated all 10,000 transactions first, EMI conversion for Amazon offers would be diluted and the report would be wrong.

Keep this pair in mind — it comes back at the end of the session as one of the two primary motivations for the entire big data architecture family.

2.1.3 Traditional Applications and CRUD Operations

Traditional applications — think of any website application, for example a Java application or a .NET application — work with a database through what we call CRUD operations: create, retrieve, update, delete. When you work with typical tables in SQL, you create the table, retrieve information from it, update a particular value in a cell, and delete a table or a row. That is the complete toolbox of traditional data work.

Intuition — sticky notes as CRUD. Picture a wall of sticky notes acting as your record system. You create a note when something new happens, you retrieve a note when you need information, you update a note by erasing and rewriting when a value changes, and you delete a note when it is no longer needed. A traditional application owns all four of those gestures. That is the complete toolbox of traditional data work.

Now translate that toolbox to data intensive applications. Of the four operations, only two survive:

Operation Traditional app Data intensive app
Create Insert rows, create tables Survives — create the data store, append events
Retrieve Query rows Survives — read events, read summaries
Update Modify a cell in place Dies — the original data is never modified
Delete Remove a row or table Dies — events are never removed from the store

No updates. No deletes. In streaming applications, the data work is event processing, and event processing implicitly involves exactly the two operations from 2.1.2 — filtering and aggregation. So the connection is direct: CRUD minus update and delete, reshaped as filtering and aggregation.

Exam note: A standard exam question asks which of the four CRUD operations survive in a data intensive application. The answer is create and retrieve only — and the reason is that events are immutable facts, so the machinery of in-place modification is gone (section 2.2), and the only computations left are filtering and aggregation.

2.1.4 What "Data Intensive" Means

When we say data intensive application, we are talking about performing computations on a regular basis while the data is continuously moving. We want to perform certain calculations on a potentially endless, evolving source of data. The key contrast: it is not that data is at rest — not data stored in a table that sits still. The data is continuously moving, and we capture some of that moving stream and do the analysis on it. Data at rest versus data in motion is the divide.

Assumption & scope: The definition of "data intensive" depends only on the behavior of the data (moving, endless, evolving) — it does not depend on the storage technology. A system can store its data in a relational database, a NoSQL store, or flat files and still be data intensive. Likewise, a system processing a huge table at rest is a big-data-scale system but not what this course means by a data intensive application — the motion is the defining feature.

That reading of the term raised questions in class, and the answers sharpened the definition:

Q: What is actually meant by a data intensive application? Can we get a definition?

A: We are talking about performing computations on a regular basis where data is continuously moving. We want to perform calculations on a potentially endless evolving source of data. It is not that the data is at rest, stored in a table. The data is continuously moving, we capture some of that moving stream, and we do the analysis on it there.

Q: Does that mean we are talking about NoSQL data only?

A: It can be anything — NoSQL, structured, anything. We don't know in advance. The definition does not depend on the storage technology.

Pitfalls to avoid:

  • "Data intensive = a lot of data." Size alone is not the test. A static terabyte table is not what the term means here; the term is about continuously moving data that you compute over, again and again.
  • "Data intensive = NoSQL." This is the misconception the second Q&A corrects. The definition is technology-agnostic; NoSQL is one possible storage answer, not part of the definition.
  • "A data processing system is one big tool." It is not — it is orchestration of an integrated set of tools. If you design around a single tool, you have missed the architect's job.

Recap + bridge: A data processing system is an orchestration of tools over continuously moving data, and the stream layer computes exactly two things — filtering and aggregation — which is why only two of the four CRUD operations survive. This pair of facts is the first of the two primary motivations for big data architectures (restated in section 2.7.5). Next, section 2.2 defines the unit that actually moves through these systems: the event.

Real-world & domain connection: Every alerting, monitoring, and analytics product you use is a data processing system on this definition. Payment gateways (Razorpay, Stripe) ingest card events and filter for risk; ride-hailing apps aggregate GPS pings into surge-pricing summaries; cloud monitoring platforms (Datadog, Prometheus) filter metrics by severity and aggregate them into dashboards. In each one, an architecture of integrated tools processes moving data with nothing but filtering and aggregation — which is exactly why this course can study the whole family of big data architectures with just those two operations in hand.

2.2 Events: The Fundamental Building Block

Hook: The bank knows the "who" of every transaction before you ever tell it. So why does it still send you a message for every swipe? Because the message is not about you — it is a snapshot of something that happened, at a moment in time, and that snapshot is the smallest unit every big data system runs on.

2.2.1 The Definition of an Event

In real-time data processing, event and message are used synonymously. The definition to fix in your mind: an event is an immutable fact related to a specific context, occurred in the system. Every later concept in this course builds on this sentence, so it is worth memorizing piece by piece. Unpack it:

  • Immutable — once it exists, it can never be changed (section 2.2.3 explains why).
  • Fact — it records something that actually happened; it is not an opinion or a future plan.
  • Related to a specific context — every event belongs to a situation: a card swipe, a page visit, a message sent.
  • Occurred in the system — the event is a record of a happening, captured where the system can see it.

Take a banking system. The specific context: a user swipes the card. The immutable fact related to that context: an alert arrives saying a transaction of this amount has been performed. The transaction data itself — that is the event. Something happened in the system, and the event is the record of that happening.

The context and the fact are two different things, and the distinction matters: the swipe (context) is the happening; the transaction record (event) is the permanent trace of it. The event is what flows, what gets stored, and what gets analyzed.

2.2.2 What an Event Contains: Who, Where, When

What is the structure of an event? It includes things like the timestamp, the amount of the transaction, and where the transaction was made. In short: who, where, and when. The bank already knows the who — it knows which card you used — so the event must carry the where and the when, and the who becomes a validation step.

Worked example — one event's fields. A card swipe produces an event roughly like this:

  • Who — card number / customer identifier. The bank already holds this; in the event it is used to validate that the right customer is being billed.
  • Where — the merchant and location: "Amazon, online" or "POS terminal 4, Big Bazaar, Bengaluru".
  • When — timestamp of the transaction.
  • What happened — the amount, say ₹2,400, and what kind of transaction it was.

There is nothing else hidden in it: no image, no long description.

Sense-check: every analytics question the bank will ask later — fraud check on this card, monthly volume from this merchant — is answerable from exactly these fields. Anything else would be dead weight.

Here is the design habit the instructor emphasizes: at requirement gathering, when you are building the system, you ask the bank "what should the structure of that message be? What should it contain?" That question is exactly what defines the event. The message content is a requirement you extract from the business, not something you invent.

Exam note: The examinable takeaway is the design discipline, not the example: the message structure is a business requirement. You ask the business what the message must contain; you do not invent the fields. This same discipline returns in section 2.9 for complex event processing messages.

2.2.3 Immutable Facts and Business Outcomes

Why do we call it an immutable fact? Once the transaction is done, there is no way to go back and change it. The message that arrives on your phone cannot be changed — not by you, not by the bank. The only thing the bank can do is analyze: how many transactions happened as part of this offer, and what impact they had.

Pitfall — confusing the event with its consequences. The event is a record of the world at one moment; it is not the offer, not the customer profile, not the balance. If the bank later revises an EMI plan, the old transaction events are not rewritten — they still describe what happened then. Updates belong to other data (derived summaries), never to the events themselves.

Real-world: a credit card offer of 10% off on Amazon, offered by a bank such as SBI. The events are all the transactions coming from Amazon. The bank looks at those events and checks the impact of the offer it launched — and note the detail that when the transaction information arrives, the 10% discount is already applied to it; the event captures the world as it was at that moment.

Worked example — the Amazon offer analysis (manifest example 2.2.example.1). A bank launches a "10% off on Amazon, EMI conversions eligible" offer for a festival season.

  1. Every card swipe at Amazon generates an event: amount, timestamp, merchant, card, and whether the customer converted the transaction into an EMI.
  2. Because the event is captured at the moment of the transaction, the amount already reflects the 10% discount — the bank analyzes the post-discount reality, not an idealized one.
  3. At the end of the period the bank aggregates: how many transactions arrived from Amazon (volume), what total volume they produced, and of those, how many converted into EMIs.

If the bank sees 40,000 Amazon events with ₹4.2 crore of volume and 35% EMI conversion, it can judge the offer's success and decide whether to repeat it next season.

Sense-check: the analysis works only because every event was recorded with its timestamp and the discount already applied — a mutable record could have been silently corrected later, and the analysis would no longer describe what actually happened.

The point of all of this is business outcome. Whatever application you build, the goal is to generate insight by analyzing these events. Real-world: after a festival season such as Dasara, the bank analyzes what offers it gave, how much transaction volume it saw, and how many of those transactions converted into EMIs (because these offers are given on EMIs), and then revisits its offers and plans for the next season based on what it has seen. That decision making is the expectation from these systems — there is a business goal attached. We are not doing stream processing as a fancy exercise; everything is connected to the business outcome.

2.2.4 Student Questions and Answers

Q: The 1 KB size is just for the sake of example, right? It's not big. But can an event be huge depending on the system architecture — are events only lightweight messages, or can they be heavy?

A: Events are always lightweight messages — by definition they are on the order of a few KB. If you are sending word documents as events, that is not an event. When somebody asks you about an event, first look at your use case: tell me the use case, then we will see what the event is, and what the storage requirements are. If the message to be transferred is huge, the data stream should not be used — if the events being transmitted are not lightweight, there is a problem with your architecture: you are probably putting in too much detail with too little importance from the analytics perspective.

Pitfalls to avoid:

  • "An event can be anything I want to send." No — a file download, a word document, or a photo is not an event. Events are lightweight by definition; if the payload is MB-sized, you are misusing the stream (the same correction returns in section 2.4.3).
  • "Immutability means the business never changes anything." Immutability is about the record, not the business. Offers get revised, discounts change — but the already-recorded events stay as they were; new events capture the new world.
  • "The event is the customer's story." The event is only the happening — who, where, when, amount. Business context such as credit score or past purchases is separate data, derived and stored elsewhere.

Recap + bridge: An event is an immutable fact, tied to a context, recording a happening in the system; it carries who/where/when, stays lightweight by definition, and exists to produce business insight. Section 2.3 takes the next step: where do these events physically live? — in an infinitely growing, append-only table.

Real-world & domain connection: The event is the atomic unit of every modern data platform. Payment rails, IoT sensors (each temperature reading is an event), clickstreams, ad impressions, and ride-hailing trip records are all streams of lightweight events carrying who/where/when. Kafka and other message brokers are built entirely around this definition: they store and move immutable event records while analytics systems (Spark, Flink) do the only two operations from 2.1.2 on them.

2.3 Infinite Tables, Batch vs Stream, and Message Formats

2.3.1 The Infinitely Growing Table

Hook: Imagine a cash register receipt roll that never stops feeding out paper — no one ever rewinds it, no one ever tears off the middle and replaces it. That roll is your database. Now ask: how do you get any useful number out of a roll like that? That question produces the entire shape of the first big data application.

When you store events, they become individual rows in a database table — but this table is special. It is an infinite table: an infinitely growing table. Event E1 sits in one row; when the second event comes, E2 sits in the next row; E3 after that. The table is infinitely long, and the only write operation is append — you only append the record. You never update a row and never delete a row.

Intuition — the receipt roll: A receipt roll has three properties that matter here. It only grows (append). It never rewrites earlier entries (immutable). And it never removes entries (no delete). The infinite table is exactly this: a database whose only write is append. The moment you add an update or a delete operation, it stops being an infinite table — the name describes the write discipline, not the size.

How do you get value out of an append-only table? After a number of records are added, you collect them as a single batch. Then you look at the whole batch and compute batch-level numbers. Real-world: you do not look at "amount" per transaction; you look at the volume of transactions in the batch, the percentage of transactions converted into EMI, and you segment by what type of product was purchased (electronic gadgets versus other purchases, say a gas stove), by vendor, and by whether EMI conversion happened. That segmentation feeds analytics and dashboards.

Worked example — reading value from the roll. Suppose 2,000 transaction events accumulated in the table overnight.

  • Collect them as one batch.
  • Filter to electronics purchases: 800 events.
  • Aggregate: volume ₹62 lakh; EMI conversion rate 30% (240 of the 800 events).
  • Segment the same batch by vendor (Amazon vs. local POS) and by whether EMI conversion happened, feeding each slice into a dashboard.

No single row answers the question "how did electronics do this month?" — the answer exists only at the batch level, computed by filtering and aggregating many rows together.

Sense-check: the dashboard numbers change only when a new batch is collected and recomputed — which is exactly why this application type is called batch processing.

So the picture of this first type of application: processing is filtering and aggregation to generate dashboards; data is stored in an infinitely long table where you continuously append at the end; and the other operation is selecting from the table as a micro-batch or mini-batch to generate insights.

2.3.2 Batch Processing vs Stream Processing

That first picture is one type of application: the messages land in the table, accumulate, and later the system analyzes them as one batch — this is batch processing. The second type: the messages are generated on the fly and you perform the analysis as they arrive — that is stream processing. Both are fundamental, and both get examined in detail in later sessions; what matters now is the two shapes: analyze what has accumulated, or analyze what is arriving.

When to pick which: Batch processing suits applications where a small delay is acceptable and the whole accumulated picture is wanted — monthly reports, overnight dashboards, offer impact analysis after a season. Stream processing suits applications where the answer must exist while the event is still fresh — fraud alerts, live dashboards, anomaly detection. The dividing question is not "big vs small" but "can the answer wait until the batch is collected?"

2.3.3 What a Data Stream Is

A data stream is essentially a stream of immutable data. Each event is on the order of 1 KB — these are very lightweight events. Streams also vary in rate: sometimes the stream carries 100 records in a particular interval, sometimes 50 records in a similar interval; there is no fixed cadence.

Assumption & scope: The "1 KB order" claim assumes text-style transaction data — JSON or XML messages with a handful of fields. It breaks if the business genuinely needs to move media or documents; in that case the stream is the wrong transport, and the fix is to keep the heavy payload out of the stream (extract the text fields analytics needs, as section 2.4.3 says).

The "order of a few KB" is the important point, and it is not arbitrary. When you look at the messages you get on your mobile phone during transactions, the size is on the order of KB — it cannot be huge. The size matters for processing: on fast-moving data, when you want a small window — say a window of five events, or a window of ten events — those messages have to fit in memory so they can be processed quickly. If the messages are voluminous, neither small windows nor quick processing is possible.

Intuition — why size gates the window: A window is just the last events held in memory, ready for aggregation. Ten events at 1 KB each means 10 KB of memory — trivial. Ten events at 2 MB each means 20 MB per window, and on a high-rate stream the system spends all its time moving bytes instead of computing. The lightweight-event rule is not politeness; it is what makes small windows and fast processing physically possible.

2.3.4 Message Formats

What does a typical message look like? Usually something like a JSON file: transaction number, amount, and so on. Whenever something happens as an event, these messages are sent to the application, and you take the sequence of events and process them to get more meaningful data. JSON is the common picture, but it is not the only format — there are multiple formats: AVRO, plain TXT file format, XML, and others. You will see this concretely when the course goes deep into PySpark.

A sample event in JSON looks roughly like:

{
  "transaction_id": "TX-77821",
  "card_id": "1234-XXXX-5678",
  "amount": 2400,
  "merchant": "Amazon",
  "timestamp": "2026-08-06T14:32:11Z"
}

JSON is the most common because it is human-readable and self-describing, but it is not the only player: AVRO is a compact binary format that wins where size and schema evolution matter; XML is older and heavier; a plain TXT file is the simplest possible container (one record per line). The takeaway for now: the format is a design choice, and the course makes it concrete when PySpark arrives.

2.3.5 Student Questions and Answers

Q: These infinitely long tables — are they temporary? Are they stored in a permanent table? Can they be retired later? When the system is off, do they still persist, or are they persisting only in RAM?

A: The answer is twofold: sometimes you want to store them for the long term, sometimes you don't, depending on the use case. For example, bank transactions may be stored for six months, with a refresh after every six months. The reason to store them: if any customer raises a concern about a transaction, the bank should have the information on it. So mainly, they are stored for logging purposes and monitoring purposes later on.

Q: How are the insights managed? Are they also stored somewhere, or how is that done?

A: The insights are stored in a repository — and yes, by repository we can mean a database, or files; a database is one perfectly good option.

Q: Can messages also be in XML format? Generally we use XML to give meaning to data — is it always JSON?

A: No, no — there are multiple formats: AVRO format, simple TXT file format, and others. When we actually have a deep dive on PySpark, you will see this.

Pitfalls to avoid:

  • "The infinite table must live forever." Persistence is a policy decision per use case — banks keep transactions for six months, then refresh. Storage duration is driven by logging, monitoring, and dispute-resolution needs, not by the table's name.
  • "Insights are just left floating in memory." Insights are artifacts too — they are persisted to a repository (a database is one perfectly good option).
  • "JSON is the only message format." JSON is the common picture, not the rule; AVRO, XML, and plain TXT are all legitimate, and format matters concretely in the PySpark deep dive.

Recap + bridge: Events accumulate in an infinitely growing append-only table; you get value by batch analysis (analyze what has accumulated) or stream analysis (analyze what is arriving); lightweight events keep windows fast; messages travel in JSON, AVRO, XML, or TXT. Next, section 2.4 answers the practical question: with a huge firehose of events, how does each consuming application know which events to read? — topics.

Real-world & domain connection: This section is the blueprint of real streaming platforms. Kafka stores exactly this way — an append-only, immutable log that every consumer reads sequentially; Spark's streaming mode reads micro-batches off it. The six-month retention policy is how real banks operate (dispute resolution, regulatory audit), and message formats map directly to real choices: AVRO is Kafka's default serialization in most production pipelines, JSON for quick integrations, and plain text for lightweight log ingestion.

2.4 Topics: The Logical Grouping of Events

2.4.1 The Email Subject Line Analogy

Hook: No one reads every email. You triage hundreds of messages by two cheap signals — the subject line, and whether you are on the To or the CC list. That everyday behavior is not a metaphor for topic design in stream processing; it is the mechanism, applied to events.

Here is a question worth asking yourself: in an office, do you read all the emails you receive? In good practice you should, but practically — no, you don't, and it is not necessary. On what basis do you decide? You look at the subject line — that is the first thing. The second thing is whether you are in the To list or the CC list.

Exactly the same mechanism applies to events. When the events become complex, these subject lines become the logical grouping of events. When events are generated, they get segregated into different groups — and those groups are called topics. The subject line filters what you read; topics filter what each consuming application processes.

Mapping the analogy explicitly:

Email mechanism Stream mechanism
Subject line Topic name
Sorting email into inbox folders Segregating generated events into topics
You decide what to read by subject Each consuming application subscribes to the topics it cares about
You skip the rest The rest of the stream never reaches that application

Where the analogy breaks: email folders are personal organization — your folders don't change anyone else's mail. Topics are written into the events at generation time and are shared: every producer and consumer of the platform agrees on them. The grouping is a system-wide contract, not a personal preference.

2.4.2 Topics Around Business Goals

Under the topic "analyzing fraudulent transactions," you have the messages that concern fraud. Under another topic named "customer segmentation," the corresponding messages land. Depending on the logical grouping context you attach to the events when they are generated — that many topics you create. The grouping is driven by the business question you need to answer.

Intuition — the grouping is driven by the question, not by the data. You do not inspect the events and "discover" a natural topic; you start from the business question ("do we need to analyze fraud? do we need customer segmentation?") and create one topic per question. If the business later needs a new analysis, a new topic is born — the topic list is the business question list, in data form.

2.4.3 Why Events Stay Lightweight

Within topics, messages stay very lightweight because you ensure they contain only the information that is supposed to be there at the moment the transaction happened. Real-world: the bank does not send you a photo of you making the transaction along with the alert. Why? Because it would needlessly increase the size of the message and it does not add any business value.

Pitfall — the 1 MB message. If you find your message is 1 MB or 2 MB, you cannot call it an event. What you do instead: extract more textual information from that event to refine its size down to what analytics actually needs. A photo of you at the POS terminal adds megabytes and zero analytic value; the merchant, the timestamp, and the amount add kilobytes and carry the whole analysis. The rule is one sentence: keep in the message only what the business question requires at the moment of the transaction.

2.4.4 Student Questions and Answers

Q: Suppose I have a certain huge file and some people are actually downloading it — is the download an event? My understanding is that an event is a few metadata of the data: maybe the movie name, who downloaded it — that way it is only a few KB.

A: First of all, a file download is not an event. To see why, think about emails: you do not read every email — you read by subject line, and second, by whether you are in the To list or CC list. Exactly here also: these subject lines are the logical grouping of events; the events get segregated into different topics. Under the topic of analyzing fraudulent transactions you have those messages; under another topic, customer segmentation, the other messages land. Within those topics the messages are very lightweight because they contain just the information belonging to that point in time when the transaction was made. And the answer to your question: events by default are lightweight — if your message is 1 MB or 2 MB it is not an event; you extract the textual information that matters for analytics to refine the event size. The reason is that on fast-moving data with a small window — say five events or ten events — if the event size is very large you cannot fit those ten messages in memory and process them quickly; both of those fail if the messages are voluminous.

Pitfalls to avoid:

  • "A download is an event." The download is an action on a file; the event would be the lightweight metadata of that action (who downloaded what, when) — and even that only earns the name if some consuming application needs it for analytics.
  • "Topics are decided by engineers." Topics follow business questions; when the grouping context is attached at generation time, it is because the business question was known first.
  • "Heavy payloads are fine as long as storage is cheap." Storage is not the problem — processing windows are. Voluminous messages cannot fit in small in-memory windows (section 2.3.3), so the stream slows down regardless of disk cost.

Recap + bridge: Topics are the logical groupings attached to events at generation time, modeled on email subject lines; they filter which consuming applications receive which events, and they are created from business questions. Topics also answer the design question raised in 2.3.5 about format choices — and in later sessions you will see topics as the actual storage unit of message brokers. Next, section 2.5 moves from the data plane to the requirements plane: reliability, scalability, and maintainability.

Real-world & domain connection: Topics are the core abstraction of Kafka — a named, partitioned stream of events that producers write to and consumers subscribe to; Kafka topics such as "transactions", "fraud-alerts", and "customer-activity" are exactly the business-goal groupings described here. The same idea appears in Apache Pulsar, AWS Kinesis (shards as logical groupings), and messaging platforms like RabbitMQ exchanges, which is why this conceptual section is the foundation for the tool-heavy sessions that follow.

2.5 Non-Functional Requirements: Reliability, Scalability, Maintainability

Hook: A system can do exactly the right thing today and still fail your business tomorrow — if it breaks under a hardware fault, or slows to a crawl when the user count doubles, or cannot absorb the next requirement change. The three non-functional requirements in this section are the answer to "how well must the system do its job?", the question set aside in section 2.1.1.

Associated with these applications are three non-functional requirements: reliability, scalability, and maintainability.

2.5.1 Reliability: Coming Out of Failure

Reliability is the ability of the system to come out of failure. Failure can happen because of a fault. When it does, you have options. If a link between components breaks — say a network failure — you may eventually lose messages. Then you decide: either it is okay to lose some messages, or you cannot afford to lose them, and you use a backup plan called replication — you create a copy of the messages on some other machine. That backup plan is how reliability is taken care of.

Intuition — the spare copy: Think of keeping a photocopy of your exam notes with a friend. If your notebook burns, the system (your ability to study) still functions — you recover from the copy. Replication in a data system is the same: messages exist on machine A, and a copy exists on machine B; if A fails, B still has the data, and the system comes out of the failure. The judgment call in the lecture is the first decision a reliability engineer makes: is losing some messages acceptable, or must none be lost? If none may be lost, you pay for replication.

2.5.2 Fault versus Failure

There is an important vocabulary distinction. Failure refers to the system. Fault is with respect to a component — a column, a database table, or any single component. When you build an architecture to process events, that architecture has many touch points: you need a data ingestion mechanism to bring data in; once data is ingested you need a mechanism to send the messages to the processing unit; and in the processing unit you must keep in mind the rate at which messages arrive versus the rate at which the processor processes them. It is those touch points that we refer to when we talk about faults and failures.

The vocabulary rule, stated once and used forever:

  • Fault — a single component deviating from its job: a broken network link, a corrupt column, a failed table, a crashed ingestion process.
  • Failure — the system no longer providing its service: alerts stop arriving, dashboards stop updating.

A fault is a part; a failure is the whole. The architectural picture is a chain of touch points — ingestion brings data in, a transport mechanism moves messages to the processing unit, and the processing unit must handle the rate of arrival. Each touch point can fault; when faults stack up or cascade, the system fails.

2.5.3 Scalability: Horizontal and Vertical

Scalability is the ability of the system to cope with upcoming load. There are two ways to achieve it. Vertical scalability: you have a single machine and you keep increasing its RAM and processing power. Horizontal scalability: you take replicas of the machine and create a cluster — you add more and more similar machines and set up a mechanism for communication among them, so the machines work together in a synchronized manner.

Intuition — the restaurant and the highway: Vertical scaling is a restaurant squeezing in more tables and chairs for the evening rush — you get more capacity out of the same building, up to its physical limit. Horizontal scaling is adding lanes to a highway — you add more machines, and the machines coordinate to share the traffic. The lecture's cluster is exactly the multi-lane highway: many similar machines, communicating in a synchronized way.

Dimension Vertical scalability Horizontal scalability
What changes RAM, CPU, power of one machine Number of machines in a cluster
Ceiling Hard physical ceiling of one machine No ceiling in principle — keep adding machines
Failure profile One machine = one point of failure Machines can be lost while the cluster continues
Cost pattern Big expensive machines, fixed cost steps Many commodity machines, incremental cost
Coordination None — one machine Communication/synchronization machinery required

When to pick which: vertical is the simplest start for predictable load; horizontal is the direction for event-driven systems, because message rates grow without warning and adding machines is how the system absorbs that growth.

2.5.4 Maintainability: Operability, Simplicity, Extensibility

Maintainability is adaptability to change: when change requests come, how well the system adapts; how easy it is to extend the existing system to something else. Maintainability is looked at through three aspects:

  • Operational aspects: automation and integration with other tools — how smoothly the system operates in operations.
  • Simplicity: balancing the features and functionalities you want against the components and interfaces you need. You may want a lot of features, but are you increasing the number of components? If the system becomes complex, it is not maintainable.
  • Extensibility: the ease of accommodating new requirements — and requirements keep changing from time to time, so this matters constantly.

Exam note: The three requirements are a favorite exam target in exactly this package — reliability is coming out of failure, scalability is coping with upcoming load, maintainability is adaptability to change; and maintainability decomposes into three aspects: operational (automation and integration), simplicity (fewer components = more maintainable), and extensibility (ease of accommodating new requirements).

2.5.5 Student Questions and Answers

Q: You said fault is with respect to a column or a database table — is it only table failure?

A: Fault is for any component — a table, a column, any component at all. Failure refers to the system. You develop an architecture to process these events, and the architecture has many touch points: the data ingestion mechanism, the mechanism that sends messages to the processing unit, and the rates at which messages arrive versus the rate at which the processor processes them. We refer to those touch points when we talk about failures and faults.

Q: Suppose 100 messages are generated every minute, but we take two minutes to process a single message — is that a fault?

A: No, that is not a fault — that is by design; it is a rate mismatch you have to manage and take a call on. Something like a network failure is a different matter: the link between components breaks and you eventually lose the message. Then the options are: it is okay to lose some messages, or I cannot afford to lose them, so I use a backup plan — replication — and create a copy of the messages on some other machine. That backup plan is how reliability is taken care of.

Pitfalls to avoid:

  • "Rate mismatch is a fault." It is not — a slow processor is a design condition to manage (buffering, scaling out), not a broken component. Mixing up the two leads to misdiagnosing capacity problems as failures.
  • "Fault is just a table problem." The Q&A corrects this directly: fault covers any component — a column, a table, a network link, an ingestion process.
  • "Replication solves everything." Replication is the backup plan when messages cannot be lost; when some loss is acceptable, the cheaper option (no replication) is legitimate — reliability is a decision, not a gadget.
  • "More features = better system." Simplicity argues the opposite: every added feature tends to add components and interfaces, and complexity is the enemy of maintainability.

Recap + bridge: Reliability = coming out of failure (fault = component, failure = system; replication is the backup plan). Scalability = coping with load (vertical vs horizontal). Maintainability = adaptability to change (operability, simplicity, extensibility). Next, section 2.6 puts these requirements to work: the page-hits use case shows the failure-by-failure journey from a simple web server to queues, shards, and the fault-tolerance wall.

Real-world & domain connection: These three words are the vocabulary of every production data platform. Netflix's Chaos Monkey deliberately kills machines to prove the system comes out of failure — the operational embodiment of reliability testing. Cloud providers sell horizontal scaling directly (auto-scaling groups add machines as load rises). And Kafka's design — an append-only log, replicated across brokers — is a textbook realization of all three requirements at once: replicas give reliability, partitioned clusters give horizontal scalability, and the simple append model keeps the system maintainable.

2.6 The Page-Hits Use Case: From Updates to Shards

Hook: A page counter is the smallest possible analytics job — one number going up. And yet this single counter, as a website grows, drags the architect through a queue, then through shards, and finally into a wall that no amount of patching can get past. Watch the failure pattern: every fix works, then stops working, because the fixes fight the speed, while the real problem is the data model.

2.6.1 The Traditional Design: Server-Side Updates

Here is a worked design scenario that shows why big data systems exist. We are designing an application to monitor page hits — the number of visitors to a portal — and to generate analytics on those counts. Every time a particular user visits the page, we need to increment the count.

How does the count get updated in the traditional design? The server performs server-side updates, and the database gets updated in periodic intervals. On the left you have many clients interacting with your server. The message in this use case is a simple count: every time a visitor comes in, you increment the count. That works fine — until the website becomes popular.

The design: many clients (browsers) → one web server → one database. Each visit is an update: the row for the visited page has its count incremented. For a small audience — say 100 visits a minute — the single server and single database handle it without drama. The message is a count; the operation is an in-place update; the system is a textbook CRUD application.

2.6.2 The Queue: Absorbing Rate Mismatch

When the site becomes popular, many users visit concurrently, and every visit increments the count. The number of page hits grows, and the database writes cannot keep up with the rate at which the messages arrive. The first fix: maintain an intermediate queue between the web server and the database, so the rate mismatch — between the database's writing ability and the rate at which messages are coming in — is absorbed. Messages wait in the queue instead of being dumped straight into the database.

Worked example — the queue absorbs the burst. Suppose visits spike to 5,000 per minute during a launch, while the database can only write 2,000 updates per minute.

  • Without a queue: every excess visit times out or is lost — the site's counter silently undercounts.
  • With a queue: all 5,000 visit-messages land in the queue instantly; a worker drains them at the database's pace (2,000/min) and the queue grows; when the burst ends, the queue drains back down.

The web server never waits for the database — it only waits for the queue, which is always fast. The mismatch between arrival rate and write rate is absorbed, not eliminated.

Sense-check: the queue solves timeouts, but it has not made the writes faster — it has only bought time. The day the queue never drains is the day the next fix is due.

2.6.3 Database Shards for Parallel Writes

At some point even the queue is not enough — you are still not able to meet the speed. The design moves from updates to data partitions, which in database terms are called database shards. A shard is a partition of the data, distributed across a database cluster. You create multiple tables to store this information because the site now has millions and millions of visitors, meaning millions and millions of transactions.

The point of sharding: each time a visitor comes in, a message describing that visit is written to the table. With more people, you need more update operations. If you can write to several shards in parallel, you spread those write operations across machines and improve the latency mismatch. It is not that each shard holds a copy — each shard holds different data; the writes go in parallel.

Worked example — sharding spreads the writes. Say the database must absorb 8,000 write-updates per minute and a single machine tops out at 2,000 per minute.

  • Split the page-hit table into 4 shards; each shard (on its own machine) holds a different slice of the data — visits hashed by URL, for example.
  • The write load is divided: 8,000 writes/min ÷ 4 shards = 2,000 writes/min per shard — each machine now runs at its comfortable capacity.
  • A query for a page's total count must now ask each shard for its partial count and sum the answers.

Sharding works by parallelism: writes that used to queue up at one database now happen simultaneously on four.

Sense-check: every shard holds different data, so 4× the write capacity came with 1/4 of the data safe per machine — which sets up the next stage of the story.

2.6.4 The Fault Tolerance Wall

But even this becomes a bottleneck at some point, because of issues about fault tolerance. Every shard holds different data — if something goes wrong, you lose that data. Why not simply keep multiple copies of each shard? Because you are already struggling to manage the pace at which messages and events are coming in — that is your utmost priority. If you add copying, you need backup mechanisms for everything, and managing all those shards and copies makes life more complex. It is not a straightforward thing to manage, and repartitioning the shards brings a whole bunch of complications.

The fault tolerance wall: sharding traded safety for speed. With one database, a failure was local; with shards, any machine dying loses its slice of the data permanently — there is no copy. The obvious fix (replicate every shard) collides with the primary goal (absorbing message speed): replication means backup machinery for every shard, more coordination, more complexity — and when load grows again, repartitioning across copies is a nightmare of coordination. The architect is now trapped: every move that restores safety slows the writes, and every move that restores speed erases safety.

2.6.5 The Motivation for a New Ecosystem

The question that drives everything: "When I am doing these kinds of frequent updates to the tables, is there any better mechanism than what I am doing here?" That is the main motivation of data processing in big data systems. The evolution of big data systems helps in multiple ways: the data model itself is different, and the setup with respect to fault tolerance is different.

At the end of the session, the instructor distills this into the two primary motivations:

  1. The nature of the data and the operations you do on it — the operations are only filtering and aggregation. There is no update, no delete, so the design does not have to carry the machinery of in-place modification.
  2. The speed of events — events arrive much, much faster than the time it takes to write a single transaction onto a table, so the design must absorb that speed.

Because we know we never perform update and delete on the table, and because we must mitigate the speed at which messages arrive, we can minimize and simplify the overall system design. These two aspects are the primary motivation behind the architectures of data intensive applications — and why they are different from traditional architectures. Different architectures are examined in detail in the sessions that follow.

Recap + bridge: The page-hits journey — server-side updates → queue → shards → the fault tolerance wall — is a single escalating lesson: patching a design built on in-place updates never ends, because the operations (update/delete) and the speed of arrival are at war with the architecture. The escape is a different data model: append-only events, filtering and aggregation, no in-place modification (section 2.7) — the two primary motivations that the whole remainder of the course builds on.

2.6.6 Student Questions and Answers

Q: With multiple shards, will every shard have different data in it?

A: Yes — that is the reason every shard has different data. If something goes wrong, you will lose that data. That is exactly the fault tolerance problem.

Q: Why are you not maintaining multiple copies over there?

A: Because we are already struggling to manage the pace at which the messages and events are coming in — that is the utmost priority. If a failure happens, you need a whole bunch of copying and backup mechanisms, which again makes life more complex. So then you ask: is there any better way altogether rather than using the existing systems? That is where the big data architectures and streaming data architectures we see today come from.

Pitfalls to avoid:

  • "A shard is a copy." No — a shard holds different data. Copies are replication; shards are partitions. Mixing the two up hides the actual fault-tolerance problem.
  • "The queue makes writes faster." It only absorbs the rate mismatch; throughput is still bounded by the database. The queue buys time, not capacity.
  • "We can keep sharding forever." Sharding multiplies the fault-tolerance exposure and the coordination burden (repartitioning, backup machinery); it is the wall, not the way out.
  • "The two motivations are about tools." They are about the nature of the data (append-only, filter/aggregate) and the speed of events — the tool landscape in later sessions exists to serve these two.

Exam note: If one scenario is asked in an exam, it is this one: trace the page-hits design from server-side updates → queue → shards → fault tolerance wall, and state the two primary motivations of big data architectures. The first motivation is the nature of data and operations (only filtering and aggregation; no update/delete). The second is the speed of events (arrival is much faster than a single table write). Repartitioning complexity and the backup burden are the reasons the traditional path dead-ends.

Real-world & domain connection: This exact journey is documented in real systems — Marz's SuperWebAnalytics case shows the same arc (incremental counters → queue → sharding → corruption and fault-tolerance pain) as the motivation for the Lambda Architecture. Modern web analytics products (Google Analytics, Mixpanel) and CDNs' hit counters face the same write storm; their solution is the big data shape — append event logs, aggregate in batch and streaming layers — precisely the architecture family this session motivates. Netflix, LinkedIn, and Uber run variations of these systems on Kafka + Spark/Flink.

2.7 The Data Model: Atomicity, Immutability, Eternity

Hook: You cannot rewrite yesterday's transaction — and that limitation, once accepted as a design principle, is what makes the entire big data architecture simpler, not harder. This section names the three properties that turn that acceptance into a data model.

2.7.1 The Three Properties

The data model for these systems has three considerations: atomicity, immutability, and eternity. Eternity here means purity. Each property constrains how events are written, kept, and read:

Property What it constrains One-line meaning
Atomicity How events are written A transaction is all-or-nothing
Immutability How events are kept The original data is never changed
Eternity (purity) How events are read The stored data always reflects what actually happened

2.7.2 Atomicity and Fine-Grained Data

Atomicity: when you perform a transaction, either the transaction is complete or it is not done — there is nothing like an intermediate state. Because each transaction is a complete, indivisible unit, the data is fine-grained. And the payoff is easy to see: we want data to be fine-grained because querying will be efficient.

Intuition — the vending machine: A vending machine never leaves you half-served. Either it takes the money and delivers the item (transaction complete), or it does nothing (transaction not done) — there is no state where you paid but got nothing, or got an item for free. An atomic transaction is the same: complete or not done, nothing in between.

Why atomicity yields fine-grained data: because each transaction is a complete, indivisible unit, the smallest stored unit of truth is that transaction — a single fact. Aggregating facts at a coarse grain (weekly summaries, merged totals) destroys the ability to slice them differently later; keeping them at the grain of the transaction keeps every question answerable. Fine-grained data is what makes querying efficient: the query engine composes exactly the slices it needs instead of being stuck with pre-cut summaries.

2.7.3 Immutability

Immutability: you don't want to change the data. The original data is immutable. The only transactions that are possible are the two from section 2.1 — filtering and aggregation — and because those never modify the source, the data stays immutable. No update, no delete, ever.

The logic chain is tight:

  1. Stream systems perform only filtering and aggregation (section 2.1.2).
  2. Filtering selects events; aggregation combines events — neither modifies the source events.
  3. Therefore the source data is never modified: no update, no delete, ever.

A useful consequence: there is no concurrency machinery for modifying shared rows, no rollback machinery, no in-place index maintenance — the entire "update" half of traditional databases is simply absent. That absence is a simplification, not a loss.

2.7.4 Eternity and Purity

Eternity: the data is always pure. How is this achieved on message data? Two mechanisms. First, each message is associated with a timestamp — every event is anchored in time. Second, purity also comes from immutability: because the data is immutable and never modified, the data is always pure. There is no way for the stored events to drift from what actually happened.

Intuition — the dated photograph: A photo taken at 2:31 PM on 6 August is a pure record of that moment — nothing in it can silently change tomorrow, and because it carries its date, its truth is anchored to a point in time. An event is the same: the timestamp anchors it, immutability preserves it, and together they guarantee that what the system stores is exactly what happened — never a later revision wearing the original's face.

Eternity means purity: a record that can be rewritten is a record whose truth is at the mercy of every later edit. A timestamped, immutable event has no such vulnerability — it cannot drift from what actually happened. Purity is not a mood; it is the joint guarantee of "anchored in time" + "never modified."

2.7.5 The Two Primary Motivations, Restated

Put together: the nature of the data and the kind of operations we do on it (only filtering and aggregation), and the management of speed at which events arrive (much faster than writing a single transaction to a table), are the two aspects that drive everything. We know we don't perform update and delete operations on this table, so the overall system design can be simplified — while still mitigating the speed at which messages come in. That simplification is the primary motivation behind the architectures of data intensive applications.

Exam note: This section is the answer to "why are big data architectures different from traditional ones?" — in one paragraph:

  1. Nature of data and operations: only filtering and aggregation; no update/delete, so the design carries no machinery of in-place modification.
  2. Speed of events: events arrive much faster than a single transaction can be written to a table, so the design must absorb that speed.

Because we know the first and must handle the second, the system design can be minimized and simplified — and the three data-model properties (atomicity, immutability, eternity) are the model that makes that minimization possible. The architectures in the coming sessions are different from traditional ones precisely because they are built on these two motivations.

Pitfalls to avoid:

  • "Eternity means the data is stored forever." No — eternity here means purity (the data is always true to what happened), not permanent storage. Retention is a separate policy decision (section 2.3.5).
  • "Atomicity means tiny messages." Atomicity is about all-or-nothing transactions, not byte size. Lightweight size (sections 2.2, 2.3) and atomicity are different properties.
  • "Immutable means nothing can ever be deleted." Immutability governs normal operation — no update, no delete as part of the workflow. Policy-based retention and regulation-driven purges are special cases, handled deliberately.
  • "These properties are optional nice-to-haves." They are the load-bearing walls: remove immutability and the fault-tolerance wall of section 2.6 comes back; remove atomicity and queries lose their fine-grained foundation.

Recap + bridge: The data model rests on three properties — atomicity (all-or-nothing writes, fine-grained data for efficient querying), immutability (no update, no delete, ever), and eternity (timestamps + immutability = pure data) — and restates the two primary motivations that drive the architecture family. Next, section 2.8 compares this model with the traditional one directly: ER modeling versus the node graph model.

Real-world & domain connection: These three properties are exactly what modern event-sourcing systems implement. Kafka's log is immutable and append-only; each record carries a timestamp, and consumers replay the log — purity by construction. Event-sourced banking systems rebuild balances from immutable transaction events instead of storing a mutable balance (the friend-count vs. friend-list distinction in the reference literature is the same idea). Stream analytics on AWS Kinesis and Google Pub/Sub store events the same way, and the "eternally true, timestamped fact" model is the foundation of the Lambda Architecture's master dataset.

2.8 Traditional ER Modeling vs the Big Data Data Model

2.8.1 The Traditional Entity–Relationship Model

In the traditional data model we use entity–relationship (ER) modeling. You declare an entity employee, a relation called works for, and you say: employee works for department. Then you attach attributes: the employee has an employee ID (the primary key), a name, a salary, and so on; the department has a department ID, a department name, and the number of people in it.

How ER modeling is declared, once, up front:

  • Entities — the things we track: employee, department.
  • Relations — how entity types connect: employee works for department.
  • Attributes — the fields each entity type carries: employee has employee ID (primary key), name, salary; department has department ID, department name, headcount.

The traditional model is static: every record in the employee table and every record in the department table must abide by this fixed schema. The relationships between entities are declared once, in the model, not between individual records. Whatever shape was drawn on the whiteboard is the shape every row obeys — forever, until a migration changes it.

2.8.2 The Node Graph Model

The big data data model differs in one simple thing: here, the notion of a fixed schema is replaced — each instance is an entity, and you capture these entities in what is called a node graph. Take person as an entity: a person has a name, a date of birth, relationships with other persons, an age, a location. Now take an individual instance, person P1: P1 is related to person P2, and that relationship carries its own attributes — age, name, gender. Another relationship: P1 and P2 work at the same location — the relation is "same location." Another: a male with a particular name and a female with a particular name are proposing to each other for marriage — the relation itself is the content.

Intuition — the family tree: In a family tree, every person is a node with their own details, and every relationship is a labeled line — "married to", "parent of", "neighbor of". Some lines connect young people, some old; the tree has no blank rows waiting to be filled. The node graph is a family tree at data scale: each instance is a node, each connection is a relation, and both carry whatever attributes are true for that pair — not attributes dictated by a global schema.

In the traditional system all of this was individual rows: these are all individual rows. In the big data model, each row becomes an entity, and every node in the graph can carry different attributes — the relations are defined record to record, not once at the schema level.

The one-sentence difference: ER declares relationships once, at the schema level, and every row must fit the mold; the node graph defines relationships record to record — P1's edge to P2 can carry "proposing", while P3's edge carries "same location", with no global schema deciding what an edge may be.

2.8.3 Instances as Messages, Not Fixed-Schema Rows

When we say each instance is an entity, we do not store the instances as a single table with a fixed schema — because these are messages now. Say a person named Ram and a person named Sita are sending text messages to each other; you want to process and analyze these events. Each single instance is a message. If you start loading those messages using the traditional model, the messages become rows and you end up with an entire table — and that is a bottleneck, because the write operations may not be faster.

Worked example — Ram and Sita as events, not rows. Ram sends Sita a message at 8:02 PM; Sita replies at 8:05 PM. Each single instance is a message — a lightweight event carrying sender, receiver, text, and timestamp.

  • Stored the traditional way: both messages become rows in one fixed-schema table, and the table grows at message speed — every reply is a write to the same table, and the write operations may not be faster than the message arrival rate. That is the bottleneck.
  • Stored the big data way: the messages are processed as they arrive — filtering and aggregation only — and the meaningful artifact is the inference drawn from them.

Sense-check: the bottleneck is not storage space but write speed into a single schema; the traditional model's strength (fixed rows, rich queries) becomes its weakness when the write rate is the load.

2.8.4 Persist the Inference, Discard the Events

So how do big data systems process them? You don't store them at the fundamental place. You process the events, analyze them, and then discard the events — but you persist the analyzed artifact: the inference. As a single statement, "P1 and P2 are proposing each other" — that inference is persisted. Persisting that kind of inference is not the objective of the traditional data model.

The same shape appears in banking: when somebody makes a credit card transaction, you analyze it with respect to whether it is fraudulent or not; once you analyze, you take appropriate action and discard the messages. It is not that you want to store these messages — there is another system that stores all the records of transactions for statements and customer queries. The purpose of the streaming system is to enrich the events and generate insights for some other purpose, not just to store the messages.

This is the streaming system's job description in one line: enrich events → generate insights → persist the insight → discard the events. The statement-and-query store is a separate system; the stream is not its warehouse.

Pitfall — assuming the stream must be the store of record. It is not. The streaming system persists inferences (fraud or not, "proposing", season volume) for its own purposes; raw event storage for statements and customer queries lives in a different system. Designing the stream as a full document archive duplicates data, bloats events, and misses the point of the layer.

2.8.5 Student Questions and Answers

Q: In the ER model, an entity usually translates into a table. When you say that in big data systems each instance is an entity — are those still rows, the instances of some table? P1, P2 — don't you store them as a single table?

A: You don't store them as a single table with that kind of fixed schema — because these are messages now. For example, you have a name like Ram and another message equals Sita; they are sending text messages to each other, and you want to process and analyze these events. The single instance is a message. But if you start loading them using the traditional model, essentially these messages become rows and you end up with the entire table — and that is a bottleneck, because write operations may not be faster. So you need a different mechanism: you don't store them at the fundamental place — you process, analyze the events, and then discard the events, but you persist the analyzed artifact. That inferencing is not the objective of the traditional data model.

Q: Extending that example: do we try to answer whether P1 proposed to some other person previously — that kind of analysis on a time scale, in history?

A: Yes, yes — that is called complex event processing. We will see that later. That is a good question anyway.

Pitfalls to avoid:

  • "Each instance in the big data model is still a row of a table." The Q&A corrects this head-on: instances are messages, not fixed-schema rows. Loading messages into a single table recreates the write bottleneck the model exists to escape.
  • "The node graph has no schema at all." It has no fixed global schema; relations and attributes exist record to record. Structure is per-instance, not absent.
  • "The big data system stores everything." The streaming system persists the inference, not the event stream; raw record-keeping belongs to a separate system.

Recap + bridge: ER modeling declares entities, relations, and attributes once, statically; the node graph model makes each instance an entity with record-to-record relations; instances are messages, not rows, so the system processes, analyzes, discards — and persists only the inference. The second Q&A plants the flag for section 2.9: analyzing events across time, as a whole, is complex event processing.

Real-world & domain connection: This is the exact divide between relational modeling and graph databases (Neo4j, Amazon Neptune) and between schema-on-write and schema-on-read analytics. Real fraud engines do what the banking example describes: they analyze transaction events as they stream in, emit a fraud score, and act — while a data warehouse (the "other system") keeps the full transaction record for statements. LinkedIn's real-time feeds and social graph, which are node graphs over event streams, run the same way.

2.9 Complex Event Processing

Hook: One transaction can be clean. Five transactions in a row, each clean alone, can be fraud — or a proposal. The leap from judging single events to judging the pattern across events is complex event processing, the special case this section defines.

2.9.1 What Complex Event Processing Is

There is a special case of event processing called complex event processing — CEP. In CEP, you look at all the snapshots of the streaming data and try to come up with some kind of inference on what these messages, what these snapshots, are talking about. The message stream is examined as a whole rather than event by event.

The shift in viewpoint:

  • Ordinary event processing (sections 2.1–2.4): each event is judged on its own — filter it, aggregate it, move on.
  • Complex event processing: the stream is examined as a whole — a sequence of snapshots whose pattern carries meaning. The inference ("these messages are about a proposal", "this card shows a fraud pattern") exists only across events, never in any single one.

CEP is a special case of event processing, not a separate discipline: it still consumes lightweight events and still ends in an inference — but the unit of analysis is the sequence, not the event.

Even in CEP the messages are not voluminous: maybe it is not just KB — it may be at most around 1 MB — but the objective of creating the messages should be very clear to you as a data engineer. The design discipline from section 2.2 applies: you know you need to develop a message processing system; the first point is to define your message — what the message is in this use case, what content it should have, and how you extract that content and the numeric information from the ongoing context.

Pitfall — building CEP before defining the message. The discipline does not relax for CEP. First define the message: what it is in this use case, what content it carries, and how you extract the numeric information from the ongoing context. A CEP engine fed ill-defined messages produces confident-sounding wrong inferences. The objective of creating the messages must be clear to you, the data engineer — before any pattern logic is written.

2.9.2 CEP in Practice

The historical question from the data model discussion is CEP territory: did person P1 propose to somebody else before, across the timeline? That kind of pattern analysis over the history of events is exactly what complex event processing does. Real-world: fraud analysis that examines not one transaction but a customer's sequence of transactions, and offer planning that looks across an entire season of events, are CEP-style applications.

Worked example — the sequence is the evidence. A card user makes five transactions: a ₹2,000 coffee purchase, then ₹45,000 at an electronics store, then ₹38,000 at a travel portal, then two rapid ₹50,000 jewelry-store purchases within minutes.

  • Single-event view: each transaction is individually legitimate — the amounts are plausible, the merchants exist, the card wasn't reported lost.
  • CEP view: the sequence — rapid escalation, high-value retail, then two near-simultaneous jewelry spends — matches a known fraud pattern. The inference "likely fraud" exists only across the events.

The same pattern logic answers P1's historical question: scan the timeline of proposal-related events and infer that P1 proposed to someone previously. Either way, the analysis is over the stream as a whole, not event by event.

Sense-check: CEP adds value exactly where single events carry no signal; where a single event is already decisive, plain filtering (section 2.1.2) suffices.

Recap + bridge: Complex event processing examines the stream as a whole — pattern analysis across snapshots produces inferences that no single event carries; the messages stay lightweight (at most about 1 MB) and the message-definition discipline from section 2.2 still governs the design. With this, the conceptual foundation of the course is complete: sections 2.1–2.9 have supplied the operations, the event, the store, the grouping, the requirements, the motivation, the data model, and the special case — and section 2.10 closes with the mindset to carry into the architecture sessions that follow.

Real-world & domain connection: CEP is a production discipline, not a theory curiosity. Fraud engines (Visa, Mastercard, bank risk platforms such as FICO Falcon) run sequence-pattern detection over transaction streams; market surveillance systems detect insider-trading patterns across order events; logistics systems infer shipment anomalies from tracking-event sequences. Dedicated CEP engines (Apache Flink CEP, Esper, Drools) implement exactly this whole-stream pattern analysis, and the "did P1 propose before?" question maps to the temporal-pattern queries these engines run.

2.10 The Architect Mindset and What Comes Next

2.10.1 Roles and Mindset

Hook: Everything in this session can be summarized in one sentence — but the session was not given so you can summarize it. It was given so you start thinking like the person who designs these systems.

A closing note on how to approach this course: it is not very theory-based — it is a little more involved than that, because the focus is to develop an architect mindset. The kind of roles these concepts point to are data engineer and data architect, and this course is a transition toward those roles. The session closed with the reminder that the notes for a session may look rough, but the understanding of the subject is what matters.

What the architect mindset means, concretely, using this session's vocabulary:

  • You decide the message (section 2.2) — the event structure is a requirement you extract from the business, not a detail handed to you.
  • You judge the requirements (section 2.5) — reliability, scalability, maintainability are your decisions, not the platform's.
  • You recognize the wall (section 2.6) — when queues and shards stop working, you ask the architect's question: is there a better mechanism?
  • You design the model (sections 2.7–2.8) — atomicity, immutability, eternity; instances as messages; persist the inference.

That last question — "is there any better mechanism than what I am doing here?" — is the architect mindset in its purest form.

2.10.2 What Comes Next: Architectures

The instructor announced that the architectural models begin from here — this session's motivation is the foundation — and the course moves to architectures in the coming sessions, with an assignment following in later sessions once enough topics are covered. After a few more sessions, once enough topics are covered, an assignment will follow in which you study some architectures based on the lines discussed in class.

Recap + bridge: This session built the motivation and the model: two operations (filtering and aggregation), events as immutable facts, topics, three non-functional requirements, the page-hits motivation, and the three-property data model. From here the course turns to the architectures that operationalize these ideas — the coming sessions will build on this session's motivation, and a later assignment will ask you to study architectures on the lines discussed here. Keep the session's through-line: everything connects to a business outcome.

Real-world & domain connection: The architect mindset is the day-to-day job of data engineers and data architects: defining message contracts with business teams, choosing retention and replication policies, judging when a system stops scaling, and designing event-driven architectures. This session is the first step of that transition — the assignments and architecture studies in the sessions ahead are the field exercises.

Key Industry Applications

  • Banking fraud alerts — real-time credit card transaction monitoring: each transaction is an event; the system filters for events that look fraudulent and alerts the customer. This is filtering in action (section 2.1.2), and when the fraud decision needs the customer's whole transaction sequence rather than one event, the same pipeline becomes complex event processing (section 2.9).
  • Bank offer analytics (credit card offers on Amazon) — the bank tracks all transactions from a particular merchant, measures transaction volume, and computes the share of transactions converted into EMIs, then redesigns offers for the next season (for example around Dasara). This is aggregation in action — many events collapsed into the few numbers the next season's budget decisions run on.
  • E-commerce segmentation — purchases segmented by product type (electronics versus everyday purchases, say a gas stove), by vendor, and by whether EMI conversion happened, from the same event stream. The same immutable events feed every slice; segmentation is just different filtering and aggregation shapes over one store.
  • Mobile transaction alerts — the real-world picture of a lightweight event: KB-sized JSON messages carrying timestamp, amount, and location (who, where, when from section 2.2.2) — small enough to fit the in-memory windows that keep alerting fast.
  • Website page-hit counters — the worked design journey from direct server-side updates, to a queue absorbing rate mismatch, to database shards for parallel writes, to the fault tolerance wall — the motivation for streaming architectures (section 2.6), and the exact arc documented in the reference literature on big data's origins.
  • Complex event processing — inferences drawn across a whole stream of snapshots: historical analysis of a person's relationship events, or a customer's transaction history, for fraud and planning decisions. The stream is examined as a whole, never event by event.
  • Message formats — events arrive as JSON, XML, AVRO, or plain TXT; format handling becomes concrete with PySpark later in the course, where schema and serialization choices actually matter.
  • Roles — the concepts in this session build the mindset of a data engineer or data architect: defining the message, judging the requirements, recognizing the scaling wall, and designing the model.

SPA Lecture 02 notes · Events, Topics, Non-Functional Requirements, and the Big Data Data Model

Stream Processing and Analytics· postgraduate· 2026-08-07

Sections Breakdown

1Data Processing Systems and the Two Core Operations

A data processing system is an orchestration of integrated tools over continuously moving data; the stream layer computes exactly two operations — filtering and aggregation — which is why only create and retrieve survive from the traditional CRUD toolbox, and why "data intensive" means data in motion, independent of storage technology.

2Events: The Fundamental Building Block

An event is an immutable fact related to a specific context, occurred in the system; it carries who, where, and when, stays lightweight (KB-sized) by definition, and exists to produce business insight such as offer impact analysis.

3Infinite Tables, Batch vs Stream, and Message Formats

Stored events form an infinitely growing append-only table; value is extracted either by batch analysis of accumulated records or by stream analysis of arriving records, and lightweight (KB-scale) events are what make small in-memory windows and fast processing possible; messages travel in JSON, AVRO, XML, or plain TXT.

4Topics: The Logical Grouping of Events

Topics are logical groupings attached to events at generation time, modeled on the email subject line: they filter which events each consuming application processes, are created from the business questions the system must answer, and keep messages lightweight by definition.

5Non-Functional Requirements: Reliability, Scalability, Maintainability

Three non-functional requirements govern data intensive systems: reliability (coming out of failure; fault = component, failure = system; replication as backup), scalability (coping with load, vertical vs horizontal), and maintainability (operability, simplicity, extensibility).

6The Page-Hits Use Case: From Updates to Shards

The page-hits design journey — server-side updates, queue, database shards, and the fault tolerance wall — motivates the big data ecosystem via the two primary motivations: the nature of data and operations (only filtering and aggregation) and the speed of events (arrival far faster than single table writes).

7The Data Model: Atomicity, Immutability, Eternity

The big data data model rests on three properties — atomicity (all-or-nothing writes, fine-grained data for efficient queries), immutability (no update/delete, only filtering and aggregation), and eternity (timestamps plus immutability keep data pure and true to what happened) — restating the two primary motivations.

8Traditional ER Modeling vs the Big Data Data Model

ER modeling declares entities, relations, and attributes once in a fixed schema; the big data node graph model makes each instance an entity with record-to-record relations, instances are messages rather than rows, and the system persists the inference while discarding the events.

9Complex Event Processing

Complex event processing (CEP) is a special case of event processing where the stream is examined as a whole — pattern analysis across snapshots yields inferences no single event carries — while messages stay lightweight and the message-definition discipline still applies.

10The Architect Mindset and What Comes Next

The course targets an architect mindset for data engineer and data architect roles: deciding the message, judging requirements, recognizing the scaling wall, and designing the model; the session's motivation is the foundation for the architecture sessions that follow.

11Key Industry Applications

Appendix mapping the session's concepts to real-world applications: banking fraud alerts (filtering), offer analytics (aggregation), e-commerce segmentation, mobile transaction alerts, page-hit counters (queue/shard motivation), complex event processing, message formats, and the data engineer/architect roles.

Postgraduate students in stream processing and analytics

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.

Data Processing Systems and the Two Core Operations

Must-know: Stream-layer computation is exactly two operations: filtering (which events to keep) and aggregation (combining events into summary numbers); CRUD reduces to create + retrieve because events are immutable.

⚠️ Top pitfall: Treating 'data intensive' as a synonym for NoSQL or for 'a lot of data' — the definition is about continuously moving, potentially endless data, not the storage technology.

Self-check: Which two of the four CRUD operations survive in a data intensive application, and why?

Connects to: 2.2.2 What an Event Contains: Who, Where, When (2.2); 2.5 (2.5); 2.7 (2.7)

Events: The Fundamental Building Block

Must-know: Event = immutable fact + specific context + occurred in the system. It contains who/where/when, no more. Events are lightweight (few KB) by definition; heavy payloads are not events.

⚠️ Top pitfall: Sending word documents, photos, or file downloads as events — the message must be lightweight; the message structure is a business requirement, not something the engineer invents.

Self-check: Why does an event carry the where and the when, while the 'who' becomes only a validation step?

Connects to: 2.2.3 Immutable Facts and Business Outcomes (2.3); 2.2.4 Student Questions and Answers (2.4); 2.9 (2.9)

Infinite Tables, Batch vs Stream, and Message Formats

Must-know: The infinite table has one write operation only: append. Batch processing analyzes what has accumulated; stream processing analyzes what is arriving. Event size of a few KB is a definitional constraint that makes small windows processable.

⚠️ Top pitfall: Assuming infinite tables persist forever — storage duration is a use-case decision (e.g., bank transactions kept six months for logging and dispute resolution).

Self-check: Why do events need to be lightweight for stream processing with small windows?

Connects to: 2.2.2 What an Event Contains: Who, Where, When (2.2); 2.2.4 Student Questions and Answers (2.4); 2.6 (2.6)

Topics: The Logical Grouping of Events

Must-know: Topics are logical groupings assigned when events are generated; grouping is driven by the business question to answer; messages inside topics stay lightweight (few KB) by definition.

⚠️ Top pitfall: Calling a 1-2 MB message or a file download an event — heavy payloads break small in-memory windows and carry no analytic value; extract only what analytics needs.

Self-check: On what basis does a consuming application decide which events to process, according to the email analogy?

Connects to: 2.2.2 What an Event Contains: Who, Where, When (2.2); 2.2.3 Immutable Facts and Business Outcomes (2.3); 2.2.1 The Definition of an Event (2.1)

Non-Functional Requirements: Reliability, Scalability, Maintainability

Must-know: Reliability = coming out of failure; fault = a component, failure = the system. Scalability = coping with load (vertical = bigger single machine, horizontal = cluster of similar machines). Maintainability = adaptability to change, seen through operability, simplicity, extensibility.

⚠️ Top pitfall: Calling a rate mismatch (100 msg/min in, 2 min per message processed) a fault — it is by design and must be managed; only broken components (e.g., network link) are faults.

Self-check: A network link between two components breaks and messages are lost — is that a fault or a failure, and what is the backup plan?

Connects to: 2.6 (2.6); 2.2.1 The Definition of an Event (2.1); 2.7 (2.7)

The Page-Hits Use Case: From Updates to Shards

Must-know: Design arc: server-side updates work until popularity → queue absorbs the rate mismatch → shards spread writes in parallel (each shard holds different data) → fault tolerance wall (no copies; replication adds complexity and repartitioning pain). Motivations: (1) nature of data and operations — only filtering and aggregation; (2) speed of events — faster than a table write.

⚠️ Top pitfall: Believing a shard is a copy — each shard holds different data, so a machine failure loses that data permanently; that is exactly the fault tolerance problem.

Self-check: Why did the design stop at sharding instead of replicating each shard, and what two motivations come out of that dead end?

Connects to: 2.7 (2.7); 2.5 (2.5); 2.2.3 Immutable Facts and Business Outcomes (2.3)

The Data Model: Atomicity, Immutability, Eternity

Must-know: Atomicity: transaction is complete or not done, no intermediate state; fine-grained data makes querying efficient. Immutability: no update/delete ever, because filtering and aggregation never modify the source. Eternity = purity, achieved by timestamp + immutability.

⚠️ Top pitfall: Confusing eternity with permanent storage — eternity means purity (data always true to what happened), while retention is a separate policy.

Self-check: Which two mechanisms make message data eternally pure, and why do they jointly guarantee it?

Connects to: 2.2.1 The Definition of an Event (2.1); 2.6 (2.6); 2.8 (2.8)

Traditional ER Modeling vs the Big Data Data Model

Must-know: Traditional ER: entities, relations, attributes declared once at the schema level; every row abides. Big data model: each instance is an entity in a node graph; relations are defined record to record; instances are messages (not rows) — process, analyze, discard events, persist the inference.

⚠️ Top pitfall: Storing message instances in a single fixed-schema table — that recreates the write bottleneck; instances are messages, and loading them as rows defeats the model.

Self-check: Why is persisting the inference (e.g., 'P1 and P2 are proposing') not an objective of the traditional data model?

Connects to: 2.7 (2.7); 2.9 (2.9); 2.2.2 What an Event Contains: Who, Where, When (2.2)

Complex Event Processing

Must-know: CEP: look at all snapshots of the streaming data and infer what the messages are talking about; the stream is examined as a whole, not event by event. Messages may reach about 1 MB at most but the message definition must still be clear first.

⚠️ Top pitfall: Writing CEP logic before defining the message — the section 2.2 discipline (define the message and how numeric info is extracted) applies even in CEP.

Self-check: Why can fraud be visible across a sequence of transactions even when every single transaction looks legitimate?

Connects to: 2.8 (2.8); 2.2.2 What an Event Contains: Who, Where, When (2.2); 2.2.4 Student Questions and Answers (2.4)

The Architect Mindset and What Comes Next

Must-know: The session develops the architect mindset (data engineer / data architect roles); the two motivations of 2.6/2.7 are the foundation the architecture sessions build on.

⚠️ Top pitfall: Treating the course as pure theory — it is oriented to design decisions (message definition, requirements judgment, recognizing scaling walls) rather than memorization.

Self-check: What is the architect's question that the page-hits story leaves us with?

Connects to: 2.2.1 The Definition of an Event (2.1); 2.6 (2.6); 2.7 (2.7)

Key Industry Applications

Must-know: The two operations (filtering, aggregation) appear directly in banking fraud alerts and offer analytics; the page-hit journey motivates streaming architectures.

Connects to: 2.2.1 The Definition of an Event (2.1); 2.6 (2.6); 2.9 (2.9)

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 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.