
Welcome to Streamhouse Architecture: Build Real-Time Data Systems. This opening lecture introduces the course, explains what you will build, and shows how each section moves you toward one practical goal: designing and running data systems that stay continuously up to date.
We begin with the problem. Traditional warehouses, data lakes, and lakehouses are excellent at storing and analyzing data, but many modern applications, AI agents, and operational dashboards need information that is seconds old rather than hours old. Streamhouse Architecture closes that gap by treating data as a continuous flow that is captured, processed, stored, governed, and served in real time.
You will see the learning path. We start with architecture fundamentals and a Docker-based lab environment. Then we work through the core technologies: Apache Kafka for event streaming, Debezium for change data capture, Apache Flink for stream processing, Apache Iceberg for open tables, and catalogs and governance for control. After that you will learn to query and serve data with Trino and FastAPI, connect AI agents through MCP, monitor pipelines, and harden them for production.
The course ends with an enterprise capstone, a Real-Time Retail Intelligence Streamhouse. Each section pairs short concept lectures with a hands-on lab, so you learn by building. By the end of this lecture you will know what the course covers, what background helps, and how to get the most from every lesson and exercise.
How did we get from spreadsheets to real-time data platforms? This lecture traces the evolution of enterprise data platforms so that Streamhouse Architecture feels like a logical next step instead of a buzzword.
We start with the early days of operational databases and nightly batch reports, where analysts waited until the next morning for yesterday's numbers. Then we look at the rise of the enterprise data warehouse, which brought structure, SQL analytics, and trusted reporting, but at the cost of rigid schemas and expensive scaling. Next comes the data lake, which offered cheap storage for raw files of any type but often turned into a disorganized swamp without governance or transactions.
We then discuss the lakehouse, which added table formats, ACID transactions, and warehouse-style performance on top of lake storage. Throughout this journey, one limitation remained: most platforms were designed around periodic batch loads. As businesses adopted mobile apps, sensors, online payments, and AI-driven automation, the demand for fresh data grew sharply.
By the end of this lecture you will be able to describe each generation of platform, explain the problems it solved and the ones it left behind, and recognize why continuous, event-driven data became the next architectural step. This context will help you judge design tradeoffs throughout the rest of the course.
Data warehouse, data lake, lakehouse, Streamhouse: the names sound similar, but the designs and goals differ. This lecture compares the four side by side so you can choose the right architecture with confidence.
We begin with the data warehouse, strong at curated, structured analytics with predictable performance. We then look at the data lake, strong at flexible, low-cost storage of raw and semi-structured data. Next is the lakehouse, which combines open table formats, transactions, and SQL access over lake storage so that one copy of data can serve both analytics and machine learning.
Then we introduce the Streamhouse. It keeps the open storage and governance of the lakehouse but puts continuous streams at the center. Events flow through a streaming backbone, are processed incrementally, land in open tables, and are served to applications and AI agents with low latency, all from the same governed foundation.
We compare the four across several dimensions: data freshness, storage format, processing model, consistency, cost, governance, and typical use cases. You will also see that these architectures are not enemies. A Streamhouse often extends an existing lakehouse rather than replacing it. By the end, you will be able to explain the differences clearly and decide when real-time capability justifies the additional complexity.
Why does real-time data matter so much for AI and modern applications? This lecture explores the business and technical reasons freshness has become a competitive requirement rather than a luxury.
We start with everyday examples: fraud detection that must block a payment before it completes, inventory systems that prevent overselling, delivery apps that update arrival times continuously, and personalization engines that react to what a customer does right now. In each case, stale data leads to wrong decisions, lost revenue, or poor customer experience.
Next, we connect real-time data to AI. Large language models and AI agents reason well, but they only know what they are given. An agent answering questions about stock levels, order status, or system health needs live, trustworthy context, not a snapshot from last night. We discuss the difference between historical knowledge used for analysis and live operational data used for action.
We also examine the costs and tradeoffs of real-time systems, including added complexity, operational overhead, and the need for monitoring and governance. Not every workload needs second-level latency, and good architects know when batch is still enough.
By the end of this lecture you will be able to identify use cases where freshness creates value, explain how streaming supports AI applications, and justify the investment in a Streamhouse approach.
Before diving into the technology, this lecture gives you a clear map of the course, the tools you will use, and the final project you will complete.
We walk through the learning path section by section. You will begin with architecture fundamentals, then set up a local environment with Docker. From there you will build event pipelines with Apache Kafka, capture database changes with Debezium, process streams with Apache Flink, and store results in Apache Iceberg tables. Later sections cover data catalogs and governance, querying with Trino, serving data through FastAPI, integrating AI agents with MCP, monitoring, reliability, and enterprise deployment.
We also review the toolset: Docker and Docker Compose, Python, SQL, PostgreSQL, Kafka, Debezium, Flink, Iceberg, Apache Polaris, Trino, and Grafana-style dashboards. All of these are open source and run locally, so you do not need a paid cloud account.
Finally, we preview the capstone, a Real-Time Retail Intelligence Streamhouse that combines everything into one portfolio-ready system. You will learn how labs are structured, what resources are provided, and how to troubleshoot common problems. By the end of this lecture you will understand how the pieces fit together and be ready to start building with a clear sense of direction, knowing what each section contributes to the final result and where to find help when a lab does not behave as expected.
This practical activity asks you to apply what you have learned so far by identifying a real-world business problem where a Streamhouse architecture would deliver clear value.
Start by choosing a domain you know or find interesting, such as retail, banking, logistics, healthcare operations, telecommunications, or online gaming. Think about decisions or processes that currently depend on delayed data: nightly reports, manual reconciliations, slow alerts, or dashboards that are always a few hours behind.
Next, describe the problem in a short statement. Who is affected, what decision needs fresh data, and what is the cost of waiting? Then list the data sources involved, such as transactional databases, application events, sensors, or third-party feeds, and note how quickly each one changes.
Now map your idea onto the Streamhouse layers introduced in this section. Where would events be ingested, how would they be processed, where would they be stored, how would they be governed, and who or what would consume the results, whether a person, an application, or an AI agent?
Finally, write down success measures such as latency targets, accuracy, and business impact, and note any risks or constraints. Keep your notes, because you can refine this idea into your final architecture proposal later in the course.
This lecture is your guide to the Streamhouse Architecture Hands-On Lab Package, the collection of resources that supports every practical exercise in the course.
We explain what is included and how to use it. The package contains Docker Compose files for the multi-container environment, sample datasets and event generators, SQL scripts, Python starter code, configuration files for Kafka, Debezium, Flink, and Iceberg, and solution references for each lab. You will learn how the folders are organized and how they map to course sections, so you can quickly find the files you need.
We also cover how to download and extract the package, where to place it on your computer, and how to keep a clean working directory. We recommend copying starter files before editing them so you can always return to the original version if something breaks.
You will also learn best practices for working with the labs: read the objective first, run the starter code, make small changes, and verify results after each step. We highlight how to check logs, restart containers, and reset the environment when needed.
By the end of this lecture you will know exactly where every resource lives and feel prepared to follow along with the hands-on labs throughout the rest of the course.
Streamhouse Architecture is organized into five layers, and understanding them gives you a mental model for every technology in this course. This lecture introduces each layer and explains how they work together.
The first layer is ingestion and event streaming. It captures events from applications, devices, and database changes and transports them reliably, typically with Apache Kafka and CDC tools. The second is stream processing, where engines like Apache Flink filter, join, enrich, and aggregate data continuously as it arrives.
The third layer is open storage. Processed data lands in open table formats such as Apache Iceberg on object or file storage, keeping history queryable and avoiding vendor lock-in. The fourth layer is metadata and governance, covering catalogs, schemas, lineage, quality rules, and access control, so that data remains discoverable, trustworthy, and secure.
The fifth layer is serving and consumption. Here, analytical engines like Trino, low-latency stores, APIs, dashboards, and AI agents use the data to deliver value to people and applications.
We discuss the responsibilities of each layer, the contracts between them, and common mistakes such as mixing concerns or skipping governance. By the end of this lecture you will be able to name the five layers, describe what belongs in each, and place any tool or design decision in the correct part of the architecture.
Event-driven architecture is the foundation of every Streamhouse. In this lecture you will learn what events are, why they matter, and how systems built around them differ from traditional request-and-response designs.
An event is an immutable record that something happened, such as an order being placed, a payment being approved, or a sensor reading arriving. Instead of services calling each other directly and waiting for answers, producers publish events and any number of consumers react to them independently. This loose coupling makes systems easier to scale, extend, and evolve.
We discuss the main concepts: producers, consumers, brokers, topics, and event logs. We distinguish between events, commands, and messages, and explain why events are usually modeled as facts in the past tense. You will also see common patterns such as publish-subscribe, event notification, event-carried state transfer, and event sourcing.
We also cover important design questions: how to name and structure events, how to keep them small but meaningful, how to handle ordering, and how to deal with failures and retries. We discuss the tradeoffs too, including eventual consistency and the extra effort needed to debug distributed flows.
By the end of this lecture you will be able to explain event-driven design clearly and recognize where it fits in a Streamhouse.
Stream-table duality is one of the most powerful ideas in modern data engineering, and this lecture explains it in plain language with practical examples.
A stream is an ordered, unbounded sequence of events, such as every change to an account balance. A table is a snapshot of the current state, such as the balance right now. The key insight is that these are two views of the same information. If you replay a stream of changes, you can rebuild the table. If you record every change made to a table, you produce a stream.
We explore this with a retail example. A stream of inventory events, such as received, sold, and returned, can be folded into a table showing current stock per product. Conversely, every update to that table can be emitted as a changelog stream for downstream systems.
You will learn how this idea underpins Kafka compacted topics, change data capture, Flink dynamic tables, and Iceberg snapshots. We also discuss why it matters: it lets you combine real-time processing with historical analytics using the same logic and data.
We cover common pitfalls such as handling deletes, ordering, and late data. By the end of this lecture you will be able to move confidently between stream and table thinking and apply the idea when designing pipelines.
Continuous incremental view maintenance sounds complex, but the idea is simple and extremely valuable: keep query results up to date by processing only what changed, instead of recomputing everything from scratch.
Imagine a dashboard showing total sales per region. In a batch approach, you would rerun a large query across all sales every hour. With incremental view maintenance, each new sale simply adjusts the affected total. The result is always current, and the work done is proportional to the amount of new data, not the size of the whole dataset.
In this lecture we explain how the technique works with aggregations, joins, and filters. You will learn about changelog streams that carry inserts, updates, and retractions, and how engines like Apache Flink maintain intermediate state to compute correct results as data changes.
We also discuss the practical considerations: how much state must be stored, how to handle updates and deletes, how late events affect results, and how to trade accuracy against latency and cost. You will see how materialized views and continuously updated tables connect to the Streamhouse serving layer.
By the end of this lecture you will understand why incremental computation is central to real-time systems and be able to recognize workloads that benefit from it.
Architects have long debated how to combine batch and streaming processing. In this lecture we compare Lambda, Kappa, and Streamhouse patterns so you can understand their strengths, weaknesses, and when to use each.
The Lambda architecture runs two parallel paths: a batch layer for accurate historical results and a speed layer for low-latency approximations, merged at query time. It is powerful but forces teams to write and maintain the same logic twice, which often leads to inconsistencies and operational burden.
The Kappa architecture simplifies this by using a single streaming path. All data is treated as a stream, and reprocessing is done by replaying the log. It reduces duplication but can be demanding on the streaming platform and on storage of long histories.
The Streamhouse pattern builds on Kappa ideas and adds open table formats and governance. Streams provide freshness, while Iceberg tables provide durable, queryable history, so one pipeline can serve both real-time and analytical needs without maintaining two codebases.
We compare the patterns across complexity, correctness, cost, latency, and maintainability, with practical examples of each. You will also learn common migration paths from Lambda to a Streamhouse. By the end of this lecture you will be able to select and justify an architecture pattern for a given workload.
Two ideas shape how modern data platforms are organized: production-native data and decentralized data design. This lecture explains both and shows how they influence Streamhouse decisions.
Production-native data means designing pipelines so that data is captured at its source, as events or changes in operational systems, rather than being copied later through slow extracts. Because the data is created as part of normal business activity, it can be shared quickly with analytics, applications, and AI with minimal delay and fewer transformations that might introduce errors.
Decentralized data design recognizes that large organizations cannot rely on one central team to own every pipeline. Instead, domain teams take responsibility for the data they produce, publishing well-defined, documented, and reliable data products. Concepts such as data contracts, schema management, ownership, and discoverability become essential.
We discuss how these ideas fit with Kafka topics, Iceberg tables, and catalogs, and how a shared platform can provide standard tooling while domains retain autonomy. You will also learn about the challenges, including consistency, duplicated effort, and governance across teams.
We finish with practical guidelines for naming, versioning, and documenting data products. By the end of this lecture you will understand how to design Streamhouse platforms that scale across teams without sacrificing quality or trust.
In this hands-on lab you will design an end-to-end Streamhouse reference architecture for an enterprise use case of your choice, bringing together every concept from the first two sections.
Begin by selecting a scenario, such as real-time retail inventory, payment monitoring, or logistics tracking. Describe the business goals, the main users, and the freshness and reliability requirements. Then identify the data sources, including operational databases and application event streams, and estimate their volume and rate of change.
Next, draw your architecture across the five Streamhouse layers. Show how events are ingested, where stream processing happens, how data is stored in open tables, how metadata and governance are applied, and how results are served to dashboards, APIs, and AI agents. Label the data flows and indicate where streams and tables appear.
Add the supporting details: topic and table naming, schema ownership, security boundaries, failure handling, and monitoring points. Document at least three design decisions and the tradeoffs you considered, such as batch versus streaming for a particular step.
Finally, review your design with a checklist covering scalability, correctness, cost, and governance. Save your diagram and notes, because you will refine this reference architecture throughout the course and use it as the starting point for your final project. A clear, well-documented design makes every later lab easier to follow.
Every hands-on lab in this course runs inside Docker, so this lecture walks you through installing Docker and Docker Compose and confirming that they work correctly on your computer.
We begin with why containers matter for data engineering. Kafka, Flink, PostgreSQL, Iceberg, and Trino each have their own dependencies and configuration. Containers package each service with everything it needs, so the same environment runs identically on Windows, macOS, and Linux without manual setup or version conflicts.
You will learn the core ideas: images, containers, volumes, networks, and the difference between Docker Engine and Docker Desktop. We then go through installation steps for each major operating system, including enabling virtualization, adjusting memory and CPU limits for Docker, and granting the necessary permissions.
Next, we introduce Docker Compose, which lets you define a multi-service environment in one YAML file and start everything with a single command. You will run a simple test container, list running services, read container logs, stop and remove containers, and clean up unused resources.
We also cover common problems, such as insufficient memory, port conflicts, and permission errors, along with how to fix them. By the end of this lecture you will have a working Docker setup that is ready for the streaming services in the following lessons.
This lecture prepares the Python and SQL tools you will use to write producers, consumers, API code, and queries throughout the course.
We start with Python. You will confirm that a recent Python 3 version is installed, create an isolated virtual environment for the course, and learn why isolation prevents dependency conflicts. We then install the key libraries used in later labs, including Kafka client libraries, a PostgreSQL driver, FastAPI, and utilities for working with JSON and data.
Next, we set up a code editor. We recommend Visual Studio Code with the Python extension, a SQL extension, and Docker integration, and explain useful settings such as formatting, linting, and selecting the correct interpreter. You will also learn how to run scripts from the terminal and from the editor.
For SQL, we introduce a database client that connects to PostgreSQL and later to Trino, so you can run queries, inspect schemas, and view results visually. You will see how to store connection settings safely using environment variables instead of hard-coding them in your source files.
We finish with a short checklist that verifies every tool is installed and working. By the end of this lecture your development workstation will be ready for the streaming labs ahead, with a clean and repeatable setup.
Apache Kafka is the backbone of your Streamhouse, and in this lecture you will run it locally and see it working for the first time.
We begin with a quick overview of what a Kafka cluster looks like and how it will run inside Docker for the course. You will review the Docker Compose service definition for Kafka, understand the most important settings such as listeners, advertised addresses, and storage, and learn why these settings matter when applications connect from your computer or from other containers.
Next, you will start Kafka, check that the container is healthy, and read the startup logs to confirm that the broker is ready. We then use command-line tools to create a topic, list topics, describe partitions, produce a few test messages, and read them back with a console consumer.
We also introduce helpful management tools such as a web user interface for browsing topics and messages, which makes it easier to see what is happening inside the cluster.
Finally, we cover how to stop, restart, and reset Kafka safely, and how to solve common problems like connection refused errors and port conflicts. By the end of this lecture you will have a working local Kafka broker and the confidence to use it in the labs that follow.
Apache Flink performs the stream processing in your Streamhouse, and this lecture shows you how to set it up and confirm that it works in your local environment.
We start with a brief look at the Flink cluster structure: a JobManager that coordinates work and TaskManagers that execute it. You will see how these components are defined in Docker Compose, how memory and task slots are configured, and why the numbers should match your computer's resources.
Next, you will start the Flink containers, open the Flink web dashboard, and explore its main pages: overview, running jobs, task managers, and configuration. We explain how to read the dashboard so you can later monitor jobs and checkpoints.
You will also learn how Flink connects to other systems. We add the connector libraries needed for Kafka and Iceberg and explain how they are made available to the cluster. Then we open the Flink SQL client and run a simple statement to prove that the setup is working end to end.
We end with troubleshooting tips for common issues such as missing connector files, memory errors, and jobs that remain in a pending state. By the end of this lecture, you will have a working Flink cluster ready to process live events.
Now that individual tools are installed, this lecture explains how all the services fit together in the multi-container lab environment used throughout the course.
We begin with an overview diagram showing every container: PostgreSQL as the operational database, Kafka for event streaming, Kafka Connect with Debezium for change data capture, Flink for processing, an Iceberg catalog and storage, Trino for querying, and supporting tools for monitoring. You will learn what each service does and how data moves between them.
Next, we examine the Docker Compose file in detail. You will see how services are named, how networks let containers find each other by name, how volumes keep data between restarts, and how environment variables and port mappings are defined. We explain startup order, health checks, and dependencies so that the stack starts reliably.
We also discuss resource management. Running many services on one machine requires care, so you will learn how to start only the containers needed for a specific lab, check resource usage, and free memory when finished.
Finally, we cover useful commands for logs, restarting a single service, and resetting the environment. By the end of this lecture you will understand the architecture of the lab, know where to look when something goes wrong, and feel comfortable managing it.
In this hands-on lab you will deploy and validate a working local streaming environment using Docker Compose, proving that every core service is ready before you start building pipelines.
Begin by opening the lab package and reviewing the Compose file and environment settings. Start the stack, then check that each container is running and healthy. Review the logs for Kafka, PostgreSQL, Kafka Connect, and Flink to confirm that there are no startup errors.
Next, validate each component with a small test. In PostgreSQL, connect with your SQL client and run a simple query on the sample database. In Kafka, create a test topic, publish several messages from a console producer, and read them from a consumer. In Flink, open the dashboard and submit a trivial SQL statement. Confirm that the web interfaces are reachable at their expected addresses.
Then perform a restart test. Stop and start a single service, verify that data survives where it should, and observe how long recovery takes. Finally, document the versions, ports, and commands you used.
If something fails, work through the troubleshooting checklist: check available memory, look for port conflicts, inspect logs, and confirm network settings. Keep the validated environment running or ready to restart, because every following lab depends on it.
This lecture introduces Apache Kafka, the distributed event streaming platform that sits at the center of most Streamhouse architectures.
We begin with the problem Kafka was created to solve: moving large volumes of events reliably between many systems without building a tangle of point-to-point connections. Kafka acts as a durable, distributed commit log. Producers append events, the platform stores them for a configurable period, and consumers read them at their own pace.
You will learn the core vocabulary: events, topics, partitions, brokers, producers, consumers, and clusters. We explain why Kafka is fast and scalable, including sequential disk writes, partitioning, and replication, and why this makes it suitable for everything from website clickstreams to financial transactions.
We also discuss common use cases such as event-driven microservices, log aggregation, change data capture, streaming analytics, and feeding data to AI systems. You will see how Kafka differs from a traditional message queue, particularly in retention, replay, and multiple independent consumers.
Finally, we place Kafka within the Streamhouse layers and preview the tools you will use in the section: command-line utilities, Python clients, and schema management. By the end of this lecture you will be able to explain what Kafka does and why it is a strong foundation for real-time data platforms.
To use Kafka well, you need to understand its building blocks. This lecture explains brokers, topics, and partitions, and how they combine to deliver scalability and reliability.
A broker is a Kafka server that stores data and serves clients. A cluster is a group of brokers working together. A topic is a named category of events, such as retail-transactions or inventory-updates. Each topic is divided into partitions, which are ordered, append-only logs that can be spread across brokers.
We discuss why partitions matter. They allow a topic to scale horizontally, since different partitions can be written and read in parallel, and they define the unit of ordering: events within a partition are ordered, but there is no global order across partitions. You will learn how message keys determine which partition receives an event, and why choosing a good key, such as a customer or product identifier, is a key design decision.
We also cover replication. Each partition has a leader and follower replicas, which provide fault tolerance if a broker fails. We explain replication factor, in-sync replicas, and retention settings that control how long data is kept.
By the end of this lecture you will be able to design topics, choose partition counts and keys sensibly, and explain how Kafka stays available when failures occur.
Producers and consumers are the applications that put events into Kafka and take them out. In this lecture you will learn how both sides work and the settings that affect reliability and performance.
We start with producers. You will see how a producer serializes a message, chooses a partition, batches records, and sends them to the broker. We explain important settings such as acknowledgments, retries, batching, and compression, and how they trade latency against durability and throughput. We also introduce idempotent producers, which help avoid duplicate writes when retries happen.
Next, we look at consumers. A consumer subscribes to topics, polls for records, processes them, and commits its position so it knows where to resume. We discuss deserialization, polling loops, commit strategies, and what happens if a consumer crashes before committing.
You will also learn how to handle errors, such as malformed messages or temporary failures, using retries and dead-letter topics, so one bad event does not block an entire pipeline.
The lecture includes short Python examples showing how to publish and read events with a Kafka client library. By the end you will understand the lifecycle of a message and be ready to build your own producers and consumers, choosing settings that match the reliability your business actually needs.
Kafka stores events in an ordered log, which gives you powerful guarantees about ordering, position tracking, and the ability to replay history. This lecture explains how each of these works.
We begin with ordering. Within a single partition, Kafka preserves the exact order in which records were written. We discuss how keys keep related events together, such as all updates for one order, and what can go wrong when retries or multiple producers interfere. You will also learn why global ordering across partitions is not guaranteed and how to design around that.
Next, we cover offsets. Every record in a partition has a sequential offset, and consumers track the offset they have processed. We explain committed offsets, automatic versus manual commits, and how the choice affects delivery semantics: at most once, at least once, and exactly once.
Then we explore replay. Because Kafka retains data for a configured period, a consumer can rewind to an earlier offset or timestamp and reprocess events, which is useful for recovering from bugs, rebuilding tables, or testing new logic. We discuss retention settings and the limits of replay.
By the end of this lecture you will be able to reason about ordering, manage offsets deliberately, and use replay safely in real pipelines.
How do you process a high volume of events without overwhelming a single application? Kafka consumer groups provide the answer, and this lecture explains how they work.
A consumer group is a set of consumers that share a group identifier and cooperate to read a topic. Kafka assigns each partition to exactly one consumer within the group, so the work is divided automatically. If you add more consumers, partitions are redistributed to share the load. If one fails, its partitions are reassigned to the others.
We discuss the rules and limits. The number of active consumers in a group cannot usefully exceed the number of partitions, so partition count is an important scaling decision. You will learn about rebalancing, why it can briefly pause processing, and settings such as session timeouts and heartbeat intervals that influence it.
We also explain how different groups read the same topic independently. For example, one group might update a dashboard, another might write to storage, and another might feed an AI service, each tracking its own offsets.
Finally, we introduce consumer lag, the gap between the latest event and the consumer's position, which is a key health metric. By the end of this lecture you will be able to scale consumers safely and monitor group behavior.
As systems evolve, event structures change, and this lecture shows how to manage those changes without breaking producers or consumers.
We begin with why schemas matter. A schema defines the fields, types, and meaning of an event. Without agreement on structure, consumers may fail or silently misinterpret data when a producer changes something. Treating the schema as a contract makes pipelines safer and easier to understand.
You will learn about common serialization formats such as JSON, Avro, and Protobuf, and the tradeoffs among readability, size, and enforcement. We introduce a schema registry, a central service that stores versions of each schema and validates that new versions are compatible with earlier ones.
Next, we examine compatibility modes. Backward compatibility allows new consumers to read old data, forward compatibility lets old consumers read new data, and full compatibility supports both. We show which changes are safe, such as adding an optional field with a default, and which are risky, such as renaming or removing a field or changing a type.
We also discuss versioning strategy, documentation, and ownership. By the end of this lecture you will be able to design events that can evolve gracefully and prevent common breaking changes in production streams, keeping every team that depends on your events safe from surprises.
In this hands-on lab you will build a Python application that generates real-time retail transaction events and publishes them to Kafka, then read them back with a consumer.
Start by defining the event. A retail transaction might include an event identifier, timestamp, store, product, quantity, price, customer, and payment method. Write the schema and choose a key, such as store or product, that will keep related events in the same partition.
Next, create a topic with several partitions. Write a producer that generates realistic random transactions at a configurable rate, serializes them, and sends them with sensible delivery settings. Add logging so you can see each acknowledgment and handle any errors.
Then write a consumer that subscribes to the topic as part of a consumer group, prints the events, and commits offsets. Run two consumers in the same group and observe how partitions are divided between them. Stop one and watch the rebalance. Finally, reset the offsets and replay the earlier events.
Use the command-line tools or the web interface to confirm message counts, partition distribution, and consumer lag. Keep your generator, because later labs use it as the data source for change capture, Flink processing, and your Iceberg tables, so keep the code organized and well commented for reuse.
Change Data Capture, or CDC, lets you turn changes in a database into a stream of events, and this lecture explains why it is one of the most important techniques in a Streamhouse.
We begin with a common problem: operational data lives in transactional databases, but analytics, applications, and AI need to see changes quickly. Traditional approaches include nightly exports and polling queries. They are slow, put load on the database, and can miss deletes or intermediate updates.
CDC solves this by capturing every insert, update, and delete as it happens and publishing each one as an event. Downstream systems can then maintain copies, update search indexes, refresh caches, and trigger actions without touching the source tables repeatedly.
You will learn the main CDC approaches: timestamp or query-based, trigger-based, and log-based. We explain why log-based CDC is usually preferred, since it reads the database's own transaction log with minimal overhead and preserves ordering and every change.
We also discuss the structure of a change event, including the before and after state and the operation type, and common use cases such as replication, auditing, and event-driven microservices. By the end of this lecture you will understand how CDC bridges operational databases and streaming platforms, and why so many modern data architectures depend on it every day.
Log-based change data capture relies on a database's internal transaction log. In this lecture you will learn how PostgreSQL's write-ahead log works and how it exposes changes safely.
PostgreSQL records every change to its data in the write-ahead log, or WAL, before applying it to the tables. This design protects against crashes, because the database can replay the log to recover. It also provides an ordered, complete history of changes that tools can read.
We explain the key concepts: log sequence numbers, checkpoints, and how WAL segments are recycled. Then we introduce logical decoding, which converts low-level log records into a readable stream of row changes. You will learn about replication slots, which remember how far a consumer has read and prevent the database from deleting WAL data that is still needed.
We also cover the configuration required for CDC, including setting the WAL level to logical, adjusting the number of replication slots and senders, and granting the right permissions. A key operational warning is that an unused or stalled replication slot can cause WAL files to accumulate and fill the disk, so monitoring is essential.
By the end of this lecture you will understand how PostgreSQL records changes and how to prepare a database for reliable CDC.
Debezium is an open-source platform that turns database changes into Kafka events, and this lecture introduces its architecture and how you will use it in the course.
We begin with where Debezium fits. It runs on Kafka Connect, a framework for moving data between Kafka and other systems. A Debezium source connector connects to a database, reads its transaction log, and publishes each change to a Kafka topic, usually one topic per table.
You will learn the main components: the Kafka Connect worker, the connector configuration, converters that serialize data, and the topics that Debezium creates. We review a PostgreSQL connector configuration, including connection details, the list of tables to capture, the replication slot, and naming conventions for topics.
Next, we explore the structure of a Debezium event. It contains the key identifying the row, and a value with the operation type, the state before and after the change, source metadata such as the log position and timestamp, and the transaction details.
We also introduce useful options like single message transformations for reshaping events. By the end of this lecture you will understand how Debezium works and be ready to deploy a connector and read change events from Kafka, including the key fields you will rely on in later labs and in production.
In this lecture you will see how Debezium represents the three kinds of database changes, inserts, updates, and deletes, and how downstream systems can interpret them correctly.
We use a retail example with customers and orders tables in PostgreSQL. First, we insert a new row and examine the resulting event. The operation code shows a create, the before field is empty, and the after field contains the full new row. Next, we update a row and see both the previous and new values, which makes it easy to detect exactly what changed. Finally, we delete a row and observe the event that records the removal, followed by a special tombstone record that allows Kafka log compaction to clean up the key.
We discuss why before and after values depend on database settings such as replica identity, and how to configure them when you need full previous values.
You will also learn how to consume these events. A simple consumer can apply changes to a target table, maintain a current-state view, or feed an audit trail. We highlight patterns for handling deletes safely and keeping the target consistent.
By the end of this lecture you will be able to read Debezium events confidently and apply them correctly in downstream processing.
Production CDC pipelines must handle starting up, restarting, and evolving databases without losing or duplicating data. This lecture covers the reliability concerns that matter most.
We begin with snapshots. When a connector first starts, it needs the existing contents of the tables, so Debezium takes an initial snapshot, emits those rows as events, and then switches to streaming from the log. We explain snapshot modes, how to capture only schema or only new changes, and how to trigger an incremental snapshot later without stopping the connector.
Next, we discuss offsets and recovery. Kafka Connect stores the connector's position so that after a crash or restart it resumes where it left off. We look at delivery guarantees, why duplicates are possible after failures, and why consumers should be idempotent.
Then we cover schema changes. When columns are added, renamed, or dropped, Debezium must adapt, and consumers must cope. We discuss schema history, compatibility, and safe migration practices.
We finish with operational concerns including replication slot monitoring, handling long transactions, connector failures, and alerting on lag. By the end of this lecture you will know how to run CDC pipelines that remain correct and healthy as systems change, even when databases grow, restart, or evolve unexpectedly over many months.
In this hands-on lab you will capture changes from PostgreSQL and publish them to Kafka with Debezium, then verify that every insert, update, and delete appears correctly.
Start by confirming that PostgreSQL is configured for logical decoding and that the sample retail database is loaded. Create a user with the required replication permissions and review the tables you will capture, such as customers, products, and orders.
Next, register a Debezium PostgreSQL connector with Kafka Connect using its REST interface. Check the connector status, confirm that the replication slot exists, and list the new Kafka topics. Read the initial snapshot events from a topic and examine their structure.
Now generate changes. Insert new rows, update existing ones, and delete a few records using SQL. For each action, consume the matching event and identify the operation type, the before and after values, and the source metadata. Write a small Python consumer that prints a readable summary of each change.
Then test resilience. Stop the connector, make more changes in PostgreSQL, restart the connector, and confirm that no changes were lost. Try adding a new column and observe how events change.
Finally, check the replication slot status and document your configuration. This pipeline becomes a source for the Flink and Iceberg labs that follow.
Apache Flink is the engine that turns raw event streams into useful, continuously updated results. This lecture explains how Flink is built and how a job runs from submission to completion.
We begin with the big picture. Flink is a distributed framework for stateful computation over unbounded and bounded data. It treats batch as a special case of streaming, so one engine and one programming model can serve both. You will learn why this matters for Streamhouse designs that need real-time freshness and historical reprocessing.
Next, we examine the runtime. A JobManager accepts jobs, schedules work, and coordinates checkpoints. TaskManagers provide task slots where operators actually run. A submitted program becomes a logical dataflow graph, which Flink optimizes and turns into parallel tasks distributed across the cluster. We explain parallelism, operator chaining, and how data is exchanged between tasks.
We also introduce Flink's APIs: the DataStream API for fine-grained control and the Table and SQL APIs for declarative processing. You will see where each is appropriate and how the web dashboard displays running jobs, task slots, and metrics.
By the end of this lecture you will understand how Flink executes work, what its main components do, and how to reason about scaling a streaming job.
Every Flink program is a pipeline of sources, operators, and sinks that move and transform data. This lecture explains these building blocks and how data flows through them.
A data stream is an unbounded sequence of records. A source reads records from a system such as Kafka, an operator transforms them, and a sink writes results elsewhere. Between them, Flink connects operators into a dataflow graph and runs many parallel copies of each so that large streams can be processed quickly.
We cover the most common operators. Map and flatMap transform individual records, filter removes unwanted ones, keyBy partitions a stream by a key so related events are processed together, and reduce and aggregate combine records over time. You will learn why keyed streams are essential for stateful processing, since each key has its own state, and how Flink routes records so the same key always reaches the same task.
We also discuss serialization, data types, and the importance of choosing good keys to avoid skew, where one key receives most of the traffic.
The lecture includes simple examples that show a stream moving through several operators. By the end you will be able to read a dataflow diagram, describe what each operator does, and plan a basic streaming job.
Flink SQL lets you process streams using the same SQL skills you already know, and this lecture introduces the language features and concepts you need.
We begin with the central idea: dynamic tables. A stream is treated as a table that changes over time, and a SQL query over it produces another dynamic table that updates continuously. This is the practical expression of stream-table duality, and it explains why a simple aggregation in Flink SQL keeps producing updated results as new events arrive.
You will learn how to define tables with CREATE TABLE statements, including connector settings for Kafka, the format of messages, and the schema. We cover data types, computed columns, and metadata columns such as the Kafka timestamp. Then we write queries using SELECT, WHERE, GROUP BY, and built-in functions, and discuss how the SQL client displays results.
We also explain the difference between append-only results and updating results, and how a changelog carries inserts, updates, and deletes to the next stage. You will see how INSERT INTO statements start long-running jobs that write to sinks.
By the end of this lecture you will be able to define streaming tables, write basic continuous queries, and understand how Flink SQL runs them, which prepares you for the windowing and state topics that follow.
Most real pipelines begin by cleaning and reshaping data, and this lecture shows how to filter and transform streams with Flink SQL.
We start with filtering. Using WHERE conditions you can drop invalid records, keep only certain stores or product categories, and isolate high-value transactions. We discuss handling nulls, malformed values, and out-of-range numbers, and why filtering early reduces cost and downstream complexity.
Next, we explore transformations. You will use built-in functions to cast types, parse and format timestamps, manipulate strings, perform arithmetic, and extract fields from JSON. We use CASE expressions to categorize records, for example labeling a transaction as small, medium, or large, and computed columns to derive new values such as line totals and tax.
We also look at working with nested data and arrays, and at creating views that make complex queries easier to read and reuse. You will learn how to route different kinds of events to different outputs by writing several INSERT statements from a shared source.
Throughout the lecture we use a retail transaction stream so you can see realistic examples. By the end of this lecture you will be able to build reliable cleaning and shaping steps that prepare raw events for aggregation, joins, and storage, while keeping your SQL readable and easy to maintain.
Stateful processing is what makes stream processing powerful, and checkpointing is what makes it reliable. This lecture explains both ideas and how Flink combines them.
Many computations need memory of the past. Counting orders per store, tracking the latest status of a device, or detecting duplicates all require state. Flink keeps this state locally with each task, partitioned by key, so access is fast and scales with the cluster. We discuss the types of state, such as value, list, and map state, and how SQL operators create state automatically.
State must survive failures, and that is the role of checkpoints. Flink periodically takes consistent snapshots of all state and the input positions, then stores them in durable storage. If a task or machine fails, Flink restores the latest checkpoint and resumes, producing correct results without losing or double counting data.
You will learn how to configure checkpoint intervals, timeouts, and storage, and the difference between checkpoints and savepoints, which are manually triggered snapshots used for upgrades. We also discuss state size, state backends, and time-to-live settings that stop state from growing forever.
By the end of this lecture you will understand how Flink protects your results and how to configure state responsibly, so jobs can run for months without growing out of control.
Time is one of the hardest parts of stream processing, and this lecture explains event time, watermarks, and windows so that your results are both correct and timely.
We begin with the difference between event time, the moment something actually happened, and processing time, when Flink sees it. Because networks delay and reorder events, processing time can give misleading answers. Event time produces results that match reality, even when data arrives late or out of order.
To use event time, Flink needs to know how far time has progressed. Watermarks provide this signal, stating that no events older than a certain timestamp are expected. You will learn how to define a watermark strategy with an allowed delay, the tradeoff between waiting longer for late data and producing results sooner, and what happens to events that arrive after the watermark.
Next, we cover windows, which group events into finite sets for aggregation. We explain tumbling windows of fixed size, hopping windows that overlap, session windows based on inactivity, and cumulating windows. You will see Flink SQL examples such as sales per store per minute.
By the end of this lecture you will be able to choose the right window and watermark settings for common real-time use cases.
In this hands-on lab you will process Kafka transaction events with Flink SQL and calculate continuous retail metrics such as sales totals and order counts.
Start by confirming that your transaction generator is publishing events to Kafka and that the Flink cluster is running. Open the Flink SQL client and define a source table over the Kafka topic, specifying the JSON format, the schema, and an event-time column with a watermark that tolerates a few seconds of delay.
Next, write queries that explore the stream. Filter out invalid records, cast fields to the right types, and compute line totals. Then create aggregations: total revenue per store per one-minute tumbling window, number of transactions per payment method, and a sliding view of the top-selling products.
Create a Kafka sink table and use an INSERT statement to publish the results to a new topic. Open the Flink dashboard to inspect the running job, its parallelism, and its checkpoints. Consume the output topic to confirm that results update as new events arrive.
Finally, experiment. Change the watermark delay, send a few late events, and observe the effect. Stop and restart the job from a checkpoint or savepoint. Record the queries you wrote, because later labs extend this pipeline with joins and storage.
Joining streams is how you combine information from different sources in real time, and this lecture explains the join types Flink offers and when to use each.
We begin with the challenge. Unlike a database table, a stream never ends, so a join must decide how long to remember records while waiting for matches. Without limits, state would grow without bound.
You will learn about regular joins, which keep state for both sides indefinitely unless you configure a time-to-live, and are suitable for slowly growing data. Next, we cover interval joins, which match events only if their timestamps fall within a defined range, such as an order and its payment within ten minutes. This bounds state and fits many business scenarios.
We then explain temporal joins, which look up the version of a reference table that was valid at the event's time, and lookup joins, which query an external system for each record. Each has different consistency, performance, and cost characteristics.
We discuss inner and outer joins, how updates and retractions flow through join results, and common problems like missing matches caused by late events or wrong keys. By the end of this lecture you will be able to choose and write the right type of streaming join for your use case.
Raw events rarely contain everything a business user needs. This lecture shows how to enrich events with reference data such as product, store, and customer details.
Consider a sale event that includes only a product identifier and a store identifier. To produce useful reports you need the product name, category, and price band, and the store's region. This information lives in reference tables, which change slowly compared with the event stream.
We explore several enrichment approaches. First, a lookup join queries a database or cache for each event, which is simple but can add latency and load on the source. Second, a streaming join combines the event stream with a changelog stream of the reference table, often captured through CDC, so the enrichment data is always current and local to Flink. Third, a temporal join ensures that each event is matched with the reference values that were valid when it occurred, which matters for price changes and historical accuracy.
We also discuss handling missing reference records, caching, state size, and keeping dimension data consistent. You will see how to design enriched output topics that downstream consumers can rely on.
By the end of this lecture you will be able to choose an enrichment strategy that balances freshness, accuracy, and performance.
Aggregations power dashboards, alerts, and operational metrics, and this lecture explains how to compute them incrementally so results stay current without rescanning data.
We start with common real-time aggregations: counts, sums, averages, minimums, and maximums grouped by key or window. In a streaming system, each new event updates the previous result rather than creating a full recomputation. Flink maintains the necessary state and emits changes as a changelog containing updates and retractions.
You will learn the difference between windowed aggregations, which produce one final result per window, and unbounded group aggregations, which keep emitting updated values as data arrives. We discuss when each is appropriate and how to control output frequency using options such as mini-batching and early or late firing, which reduce the volume of intermediate updates.
We also look at more advanced patterns, including top-N queries, running totals, approximate distinct counts, and rolling comparisons over time.
Practical concerns are covered too: state growth for high-cardinality keys, state time-to-live, and how to deliver updating results into sinks such as Kafka, databases, and Iceberg. By the end of this lecture you will be able to design incrementally updated results that are accurate, efficient, and easy for consumers to use, whether those consumers are dashboards, applications, or other streaming jobs.
Real data is messy, and streaming systems must handle duplicates and late events without corrupting results. This lecture covers practical techniques for both.
We begin with duplicates. They can occur when producers retry, when sources replay data after recovery, or when upstream systems send the same record twice. You will learn how to design events with unique identifiers and how to remove duplicates in Flink SQL by keeping the first or latest record per key, using row-number-based deduplication. We discuss the state cost of remembering identifiers and how to limit it with time-based retention.
Next, we address late-arriving events, which reach the system after the watermark has passed their timestamp. We explain allowed lateness, which keeps window state for a while so late records can still update results, and side outputs or separate topics for records that are too late to include. We also discuss business decisions: how late is acceptable, and should corrections be published?
We finish with strategies for reconciling late corrections in downstream tables and communicating revised results to consumers clearly, so nobody is surprised when a number changes. By the end of this lecture you will be able to build pipelines that stay accurate despite retries, replays, and unpredictable delays, which are normal conditions in any production environment.
What happens when a streaming job fails halfway through processing? This lecture explains how recovery, replay, and exactly-once semantics work together to keep results correct.
We start with delivery guarantees. At-most-once may lose data, at-least-once may duplicate it, and exactly-once means each event affects the result exactly one time. We clarify that exactly-once refers to the effect on state and outputs, not to a record never being read twice internally.
You will learn how Flink achieves this inside a job through checkpoints that capture state and source positions together, and barriers that flow with the data so snapshots are consistent. When a failure occurs, Flink rolls back to the last checkpoint and replays the input from the saved offsets.
Extending the guarantee end to end requires cooperation from sinks. We cover transactional sinks and two-phase commit, Kafka transactions, idempotent writes, and upserts to tables, and why a sink that cannot participate may still produce duplicates.
We also discuss restart strategies, savepoints for planned upgrades, and replaying history to repair results after fixing a bug. By the end of this lecture you will understand how to design recoverable pipelines and explain the guarantees they provide to colleagues, auditors, and the business teams who depend on correct numbers.
In this hands-on lab you will build a real-time inventory pipeline that combines sales events, stock updates, and product reference data to produce an always-current view of inventory.
Begin by defining three inputs. Sales events arrive from your Kafka transaction generator, stock receipts and adjustments arrive as a second topic, and product details come from the CDC stream you created earlier. Create Flink SQL tables for each, with event-time columns and watermarks.
Next, enrich the sales with product names and categories using a temporal or lookup join. Remove duplicate events using a deduplication query based on the event identifier. Then combine sales and receipts to compute current stock per product and store, and calculate a running total of units sold in the last hour.
Add a rule that flags products whose stock falls below a reorder threshold and publish these alerts to a Kafka topic. Write the updating inventory table to an upsert Kafka topic so downstream applications can read the latest state.
Finally, test robustness. Send duplicate and late events, stop the job, restart it from a checkpoint, and confirm that the numbers stay correct. Inspect the job graph in the Flink dashboard and note how state and parallelism affect performance. Save your SQL for use in the next section.
Why do open table formats matter so much for modern data platforms? This lecture explains the problems they solve and why they are central to the Streamhouse design.
We begin with the limitations of storing plain files in a data lake. A directory of Parquet files has no transactions, so a reader can see half-written data. Schema changes are painful, listing millions of files is slow, and updating or deleting individual rows is difficult. Different engines may interpret the files differently, which leads to inconsistent results and lock-in to a single vendor.
Open table formats add a metadata layer that tracks which files belong to a table, its schema, partitions, and history. This brings database-like features to inexpensive storage: ACID transactions, consistent snapshots, schema evolution, time travel, and efficient updates and deletes.
We compare the major formats, including Apache Iceberg, Delta Lake, and Apache Hudi, and discuss why openness and engine neutrality are valuable. Because multiple engines such as Flink, Trino, and Spark can read and write the same table, organizations avoid duplicating data and can choose the best tool for each job.
By the end of this lecture you will be able to explain what open table formats provide and why they form the storage foundation of a Streamhouse.
Apache Iceberg is a high-performance open table format, and this lecture introduces its goals, features, and how it fits into your Streamhouse.
We start with the origin and purpose. Iceberg was designed to handle very large analytic tables reliably, fixing problems that appeared with older approaches based on directory listings. A table is defined by metadata that points to data files, so engines no longer need to scan folders to find what belongs to the table.
You will learn the headline features. Iceberg provides ACID transactions with snapshot isolation, so readers always see a consistent version. It supports full schema evolution, including adding, renaming, and reordering columns without rewriting data. Hidden partitioning lets users query naturally while Iceberg prunes files behind the scenes. Time travel allows queries against earlier snapshots, and row-level updates and deletes are supported.
We discuss the engine ecosystem, including Flink, Spark, Trino, and others, and the file formats it stores, mainly Parquet. We also explain where Iceberg sits in the Streamhouse: streaming results land in Iceberg tables, creating durable, queryable history for analytics and AI.
By the end of this lecture you will understand what Iceberg offers and why it is a strong choice for open, governed data that many engines and teams can share without copying it.
To operate Iceberg tables confidently, you need to understand how they are organized. This lecture explains the architecture, its metadata files, and how snapshots work.
An Iceberg table has three layers. At the top is the catalog, which stores a pointer to the table's current metadata file. The metadata file records the schema, partition specification, properties, and a list of snapshots. Each snapshot refers to a manifest list, which points to manifest files. Manifests list the individual data files, along with statistics such as row counts and column minimum and maximum values.
You will see how this structure enables efficient queries. An engine reads metadata, uses statistics to skip files that cannot match a filter, and scans only the necessary data. Because files are never modified in place, a commit simply creates a new metadata file and atomically swaps the pointer, which gives readers consistent views and allows concurrent writers to use optimistic concurrency.
We explain snapshots as the foundation of time travel, rollback, and incremental reads, and how data files, delete files, and manifests change with each operation.
By the end of this lecture you will be able to describe what happens during a write or query and reason about performance and reliability when something behaves unexpectedly, such as a slow query or a failed commit.
Writing streaming data into Iceberg connects the real-time and historical parts of your Streamhouse. This lecture shows how Flink writes continuously to Iceberg tables and what to watch for.
We begin with the write path. A Flink job reads from Kafka, processes events, and sends them to an Iceberg sink. Data is written as Parquet files, and a commit happens at each Flink checkpoint, which creates a new snapshot. This means the checkpoint interval controls both data freshness and file size, and is an important tuning decision.
You will learn how to define an Iceberg catalog and table in Flink SQL, choose between append-only writes and upsert mode with primary keys, and handle changelog data from CDC sources. We explain how upserts use equality delete files and why they require careful maintenance.
We also discuss partitioning choices, such as by date, and the small-files problem caused by frequent commits. You will see how to monitor commits, confirm that new snapshots appear, and query the table from another engine.
Finally, we cover exactly-once behavior and what happens after failures. By the end of this lecture you will be able to build a dependable streaming pipeline that persists data in Iceberg, with sensible file sizes, partitions, and commit settings that you can explain and defend.
Data models change, and analysts sometimes need to see data as it was in the past. This lecture explains Iceberg's schema evolution and time travel features.
We start with schema evolution. In Iceberg you can add, drop, rename, and reorder columns, promote compatible types such as integer to long, and change nested fields, all without rewriting existing files. This is possible because Iceberg tracks columns by unique identifiers rather than by name or position, which prevents the silent data corruption that plagues simpler formats. We discuss which changes are safe and how to coordinate them with producers and consumers.
Next, we cover time travel. Every commit creates a snapshot, and you can query a table as of a specific snapshot identifier or timestamp. This supports auditing, reproducing past reports, debugging a faulty pipeline, and comparing data before and after a change. You will also learn how to roll back a table to a previous snapshot after a bad write.
We explain the limits of time travel: it depends on snapshots being retained, so expiration policies affect how far back you can go. By the end of this lecture you will be able to evolve schemas safely and use historical snapshots to answer questions and recover from mistakes.
Iceberg tables need care to stay fast and affordable, and this lecture explains partitioning, compaction, and maintenance tasks for long-running streaming workloads.
We begin with partitioning. A good partition design lets queries skip most files. You will learn hidden partitioning transforms such as day, month, bucket, and truncate, how to select partition columns that match common filters, and the risks of too many small partitions. Iceberg also supports partition evolution, so you can change strategy as data grows without rewriting old data.
Next, we discuss the small-files problem. Streaming jobs commit often, producing many tiny files that slow queries and bloat metadata. Compaction rewrites small files into larger ones, ideally around hundreds of megabytes, and can be run on a schedule or as a background job. We also cover rewriting manifests to speed up planning.
Then we cover snapshot expiration and orphan file cleanup, which reclaim storage while respecting your time travel needs, and the importance of running them carefully with concurrent writers.
We finish with monitoring table health through metadata tables. By the end of this lecture you will be able to plan a maintenance routine that keeps streaming tables efficient and predictable, including compaction, manifest rewrites, snapshot expiration, and orphan file cleanup on a safe schedule.
In this hands-on lab you will persist streaming transaction data in Apache Iceberg tables and use schema evolution and time travel to explore how the data changes over time.
Begin by configuring an Iceberg catalog in Flink and creating a table for retail transactions, partitioned by day. Define the schema carefully and set table properties such as file format and write mode. Start a Flink job that reads the Kafka topic and continuously inserts events into the table, then confirm that Parquet files and snapshots appear in storage.
Next, query the table with Flink SQL or Trino. Count rows, compare results across several minutes, and inspect the snapshots and files metadata tables to see how each checkpoint creates a commit. Change the checkpoint interval and observe how file sizes and commit frequency respond.
Now evolve the schema by adding a column such as a loyalty tier. Update the producer to include it, and verify that old and new records are both readable. Use time travel to query the table as of an earlier snapshot, and then practice rolling back after a deliberately bad insert.
Finally, run a compaction job, check the new file layout, and expire old snapshots. Write down your observations and settings, because the next section places this table under catalog governance.
Data is only useful when people and systems can find it, understand it, and trust it. This lecture introduces metadata and data catalogs, the foundation of governance in a Streamhouse.
We begin with the different kinds of metadata. Technical metadata describes schemas, data types, partitions, and file locations. Business metadata explains meaning, owners, definitions, and sensitivity. Operational metadata records freshness, volume, job runs, and quality results. Together, they turn a pile of tables and topics into a navigable, understandable platform.
Next, we explain what a data catalog does. It stores table definitions, tracks where data lives, supports search and discovery, and lets engines such as Flink, Trino, and Spark agree on what a table is. In an Iceberg environment, the catalog also holds the pointer to each table's current metadata, which makes it essential for correct and atomic commits.
We discuss common catalog types, including Hive Metastore, JDBC-based catalogs, cloud catalogs, and REST catalogs, and the tradeoffs among them. We also look at what good catalog practice looks like: consistent naming, clear ownership, documented columns, and tagging for sensitive data.
By the end of this lecture you will understand why catalogs matter, what information they hold, and how they support discovery, consistency, and control across your streaming and analytical systems.
The Iceberg REST catalog specification gives every engine a common way to talk to a catalog, and this lecture explains why that matters and how it works.
Historically, each engine needed its own connector and configuration for each catalog, which made multi-engine environments fragile and hard to secure. The REST catalog standard defines an HTTP API for operations such as listing namespaces, creating and loading tables, committing changes, and renaming or dropping objects. Any engine that implements the client side can work with any compliant catalog server.
You will learn the key benefits. Engines remain loosely coupled to the storage and catalog implementation, upgrades are easier, and the catalog can enforce authentication, authorization, and policies in a single place. The REST design also supports credential vending, where the catalog hands out short-lived storage credentials scoped to a particular table, so clients never need broad access to the underlying data files.
We walk through a typical interaction: a client authenticates, requests table metadata, writes data files, and sends a commit that the catalog validates atomically. We also describe configuration properties such as the catalog URI, warehouse, and credentials.
By the end of this lecture you will be able to explain the REST catalog model and why it supports open, interoperable, and secure Streamhouse platforms.
Apache Polaris is an open-source catalog that implements the Iceberg REST specification, and in this lecture you will learn what it provides and how it fits into your Streamhouse.
We begin with its purpose. Polaris acts as a central, vendor-neutral catalog that multiple engines can use at the same time, so Flink can write a table that Trino reads moments later, with consistent metadata and permissions. It stores the catalog state and handles table commits while the data itself remains in your own storage.
You will learn its main concepts. A catalog groups namespaces and tables and is tied to a storage location. Principals represent users or services, principal roles group them, and catalog roles hold privileges on catalogs, namespaces, or tables. This model lets you grant precise access, such as read-only on one schema and write on another.
We also cover how Polaris supports credential vending for secure storage access, how it is deployed in your Docker environment, and how engines connect using the REST endpoint and tokens.
Finally, we discuss operational considerations such as backing storage for its own metadata, high availability, and auditing. By the end of this lecture you will understand Polaris and be ready to register and secure Iceberg tables with it.
Reliable analytics requires reliable data, and this lecture covers three practices that build trust in a Streamhouse: data quality, schema contracts, and lineage.
We start with data quality. You will learn the main dimensions: completeness, validity, uniqueness, consistency, accuracy, and timeliness. We discuss how to apply checks in streaming pipelines, such as rejecting records with missing keys, routing invalid events to a dead-letter topic, validating ranges and formats, and measuring the freshness and volume of each dataset. We also explain why quality rules should be defined near the source and monitored continuously.
Next, we cover schema contracts. A data contract is an agreement between a producer and its consumers that specifies fields, types, semantics, and service expectations. We show how schema registries, compatibility checks, and versioning enforce these contracts and prevent accidental breaking changes.
Then we explore lineage, the record of where data came from and how it was transformed. Lineage helps with impact analysis, debugging, auditing, and compliance, and it can be captured automatically from jobs or documented in a catalog.
By the end of this lecture you will be able to design practical controls that make your streaming data dependable, explainable, and easier to manage as teams grow and as more consumers rely on the same shared datasets.
Real-time data often includes information that is sensitive, such as customer identities, payment details, or personal addresses. This lecture explains how to secure access and protect that data across a Streamhouse.
We begin with core principles: least privilege, separation of duties, defense in depth, and auditability. You will learn how authentication verifies who is calling and how authorization decides what they can do, and why both should be centralized wherever possible.
Next, we look at access control at each layer. In Kafka, access control lists restrict who can read or write topics. In the catalog, roles and privileges control access to namespaces and tables. In query engines, additional policies can restrict rows or columns. We discuss role-based and attribute-based approaches and how to organize roles by team and function.
We then cover protecting sensitive data directly. Techniques include classification and tagging, masking, tokenization, hashing, and encryption in transit and at rest. We discuss column-level controls, handling personal data under privacy regulations such as GDPR, retention policies, and deletion requests, which Iceberg can support through row-level deletes.
By the end of this lecture you will understand how to design layered security and make sensitive data safe to use for analytics, applications, and AI without exposing it unnecessarily.
In this hands-on lab you will register and query Iceberg datasets through a catalog, then implement basic governance controls such as roles, quality checks, and documentation.
Begin by starting the Polaris catalog in your Docker environment and creating a catalog with a storage location for your lab data. Create a namespace for retail data, then configure Flink to use the REST catalog endpoint with the proper credentials. Register or create your transaction table so that it appears in the catalog, and confirm that its metadata is visible.
Next, configure a second engine, such as Trino, to connect to the same catalog and query the table. Verify that rows written by Flink are immediately visible, proving that both engines share a consistent view.
Now add governance. Create principals and roles such as analyst and data engineer, grant the analyst read-only access to selected tables, and test that write attempts are denied. Add a simple data quality rule that routes invalid transactions to a rejection table, and measure the rejection rate.
Finally, document your tables with owners, column descriptions, and sensitivity tags, and sketch a lineage diagram from Kafka to Iceberg. Save your configuration, because the next section builds query and serving layers on top of it.
Once data is captured, processed, and stored, you must deliver it to the people and systems that need it. This lecture introduces the main serving patterns in a Streamhouse and how to choose among them.
We begin with the requirements that differ between consumers. A business analyst running exploratory queries over months of history needs scalable SQL. An operational application showing the current stock for a product needs a response in milliseconds. A dashboard needs continuously refreshed aggregates, and an AI agent needs fresh context with strong guardrails.
You will learn the primary patterns. Analytical serving queries Iceberg tables directly with an engine like Trino. Current-state serving materializes the latest value for each key into a low-latency store such as a key-value database or cache. Streaming serving pushes updates to subscribers through topics or event feeds. API serving wraps these sources behind well-defined REST or GraphQL interfaces that hide implementation details and enforce security.
We compare the patterns by latency, freshness, query flexibility, cost, and complexity, and discuss hybrid designs that combine them. By the end of this lecture you will be able to match each consumer need to the right serving approach and explain the tradeoffs in your architecture to technical and business stakeholders alike.
Trino is a distributed SQL query engine that lets you analyze data where it lives, and this lecture introduces its architecture and role in your Streamhouse.
We start with the basic idea. Trino separates compute from storage and uses connectors to query many systems with standard SQL, including Iceberg tables, relational databases, and Kafka topics. This allows one query to join data from several sources without moving it first, which is a powerful way to explore and analyze across the platform.
You will learn the architecture: a coordinator that parses, plans, and schedules queries, and workers that execute tasks in parallel and exchange data in memory. We explain catalogs, schemas, and tables in Trino terminology and how the Iceberg connector reads metadata and data files using partition pruning and file statistics.
We discuss strengths and limitations. Trino excels at interactive analytics over large data and federated queries, but it is not designed for ultra-low-latency lookups or heavy transactional workloads. You will also see how it is configured in your Docker environment, how to connect through the command line or a SQL client, and how to view running queries in the web interface.
By the end of this lecture you will understand where Trino fits and be ready to write queries against your Streamhouse data.
With Trino connected to your catalog, you can now explore Iceberg tables using familiar SQL. This lecture shows how to query them effectively, including advanced Iceberg features.
We begin with fundamentals: listing catalogs, schemas, and tables, describing columns, and running SELECT queries with filters, aggregations, and joins. You will see how partition pruning and column statistics reduce the data scanned, and how to read query plans using EXPLAIN to understand performance.
Next, we use Iceberg-specific capabilities. Time travel lets you query a table as of a snapshot identifier or timestamp, which is ideal for comparing yesterday's numbers with today's or reproducing a report. Metadata tables expose snapshots, manifests, files, and history so that you can inspect table health directly with SQL. We also cover reading changes between snapshots.
We then discuss writing and maintenance statements that Trino supports, such as inserting data, deleting rows, updating records, and running table optimization commands to compact small files.
You will also learn query-writing habits that improve speed: selecting only needed columns, filtering on partition columns, and avoiding unnecessary shuffles. We touch on federation by joining an Iceberg table with a PostgreSQL table.
By the end of this lecture you will be comfortable analyzing live and historical retail data with Trino.
Analytical engines are excellent for large queries, but applications often need the latest value for a single key within milliseconds. This lecture explains how to serve current state with low-latency stores.
We begin with the typical requirement: show the current stock level for a product, the status of an order, or a customer's latest score. Scanning an analytical table for each request would be too slow and expensive, so we maintain a separate, compact view that contains only the current value per key.
You will learn how to build it. A Flink job reads the changelog or event stream, computes the latest state, and upserts it into a serving store. We compare options such as a relational database like PostgreSQL, a key-value store like Redis, and a search or document store, and explain how access patterns, consistency needs, scale, and operational skills guide the choice.
We discuss key design questions: how to model keys, how to handle deletes, how to make writes idempotent, and how to keep the serving store consistent with Iceberg, which remains the system of record. We also cover freshness monitoring and rebuilding the store by replaying history.
By the end of this lecture you will be able to design a reliable current-state serving layer for operational applications.
Applications and AI tools rarely connect directly to databases or query engines. They call APIs, and this lecture shows how to build data APIs on top of your Streamhouse with FastAPI.
We start with the reasons for an API layer: it hides storage details, enforces authentication and authorization, validates input, applies rate limits, and offers stable contracts to consumers even when the underlying systems change.
You will learn FastAPI essentials. We define path and query parameters, use Pydantic models to describe and validate responses, and rely on automatic interactive documentation generated from your code. We then design endpoints for the retail scenario, such as current inventory for a product, inventory for a store, low-stock alerts, and historical sales over a time range.
Next, we connect the endpoints to data sources. Current-state requests read from the low-latency store, while historical requests run parameterized queries against Trino. We emphasize safe practices: using parameter binding to prevent injection, setting query timeouts, limiting result sizes, and returning clear error messages.
We also discuss pagination, caching, health checks, and logging. By the end of this lecture you will be able to design and implement a clean, documented, and secure API that exposes live and historical data to applications, dashboards, and AI tools alike.
In this hands-on lab you will build a REST API that exposes current inventory and historical sales, combining a low-latency store with Trino queries over Iceberg.
Begin by creating the serving layer for current state. Write or reuse a Flink job that maintains the latest inventory per product and store and upserts it into your chosen store. Verify that values change as new sales events arrive.
Next, create a FastAPI project with a clear structure for routes, models, and configuration. Implement an endpoint that returns the current stock for a product, another that lists products below a reorder threshold, and a health endpoint. Then add historical endpoints that use Trino to return daily sales by store and product category for a requested date range, with validation, parameter binding, and limits on result size.
Open the automatically generated documentation page and try each endpoint. Generate more events and confirm that the current inventory endpoint reflects them within seconds, while the historical endpoint returns consistent totals.
Add basic authentication with an API key, measure response times, and note which requests are fast and which are slower. Write a short README describing the endpoints. In the next section, this API becomes a source of tools for an AI agent.
This course contains the use of artificial intelligence.
Master Real-Time Data Engineering with Apache Kafka, Flink, Iceberg, CDC, Streaming Analytics, and AI-Ready Data Platforms
The future of data engineering is real-time! Traditional data warehouses, data lakes, and lakehouse architectures have transformed how organizations manage information. However, modern enterprises increasingly need continuously updated data to power AI agents, real-time analytics, intelligent applications, and automated business decisions.
Welcome to Streamhouse Architecture: Build Real-Time Data Systems, a comprehensive, hands-on course designed to help you understand, design, and implement modern streaming data architectures using industry-leading open-source technologies.
Whether you're a Data Engineer, Software Developer, Cloud Architect, AI Engineer, or technology enthusiast, this course will help you develop practical skills in real-time data processing, event-driven architecture, stream processing, and modern data platform engineering.
What You'll Learn
Throughout this course, you'll explore essential technologies and architectural patterns, including:
Streamhouse Architecture: Understand how continuous data processing connects streaming systems, data lakes, and analytical applications.
Apache Kafka: Build scalable event streaming pipelines, implement producers and consumers, and understand distributed messaging.
Apache Flink: Develop stateful stream processing, real-time transformations, windowing operations, and streaming SQL queries.
Apache Iceberg: Manage open table formats, metadata, schema evolution, snapshots, and historical data.
Change Data Capture (CDC): Stream database changes using Debezium, PostgreSQL, and Kafka.
Streaming ETL and ELT: Design efficient data ingestion, transformation, and integration pipelines.
Real-Time Analytics: Process live business events, calculate operational metrics, and build continuously updated insights.
Data Governance: Explore data quality, metadata management, access control, data lineage, and enterprise security.
Trino and SQL Analytics: Query large datasets and connect streaming platforms with analytical engines.
Docker and Python: Create reproducible development environments and practical data engineering applications.
AI Agents and MCP: Explore how Model Context Protocol (MCP) and AI applications can access fresh, governed enterprise data.
Distributed Systems: Understand fault tolerance, scalability, checkpoints, monitoring, and production reliability.
Build Real-World Projects
This isn't just another theory-focused data engineering course. You'll work through practical exercises that demonstrate how modern enterprises build reliable, scalable data platforms.
You'll create Kafka producers and consumers, implement Flink SQL pipelines, capture database changes through CDC, store streaming data in Apache Iceberg tables, and expose operational information through REST APIs.
You'll also explore how real-time data infrastructure supports AI-powered applications, enterprise automation, inventory management, fraud detection, and operational intelligence.
Complete an Enterprise Streamhouse Capstone
Your final project brings everything together.
You'll design and build a Real-Time Retail Intelligence Streamhouse that integrates event ingestion, streaming transformations, historical storage, governance, and application integration.
This portfolio-ready project demonstrates practical data pipeline development, streaming analytics, event-driven systems, and AI-ready data architecture.
Who Should Enroll?
This course is ideal for aspiring and experienced Data Engineers, Data Architects, Backend Developers, Cloud Engineers, DevOps Professionals, AI Developers, and anyone interested in Apache Kafka, Apache Flink, Apache Iceberg, streaming data platforms, or next-generation enterprise data architecture.
Basic Python and SQL knowledge is helpful, but previous Streamhouse experience isn't required.
Start building modern, real-time, scalable, and AI-ready data systems today!