Data Pre-Processing, Data Architecture, and Warehouse Schemas
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
- Data pipelines — covered in Lecture 2 (What is a Data Pipeline?)
- ETL vs. ELT — covered in Lectures 1 and 2
- Data warehouse architecture — covered in Lecture 2
- Star schema design — covered in Lecture 2
- Data warehouse vs. data lake — covered in Lecture 2
- Data management framework — covered in Lecture 2
This session starts with a recall quiz and the carpenter story, then moves into hands-on data cleaning in Google Colab with an AI assistant. From there it climbs to the framework layer: TOGAF, DAMA-DMBOK, PMBOK, and ITIL; structured prompting with the CoStar framework; categorizing data architectures; data warehouses, data marts, and master data management; the star and snowflake schemas; and ETL versus ELT. It closes with the course roadmap and hands-on goals.
3.1 The Carpenter's House and the Data Quality Mindset
3.1.1 The Week-Three Recall Quiz
We are in the third week of the course. The opening activity was a recall quiz: students type something they remember about the subject so far. The answers included four ideas that form the foundation vocabulary of data management:
- Garbage in, garbage out — bad input data produces bad results downstream, no matter how good the tools are.
- Data silos — isolated stores of data that cannot talk to each other, so each department sees only its own slice.
- Data lake — a large repository that keeps raw data in its original form until it is needed.
- Data warehouse — a central, organized store of data prepared for reporting and analysis.
That these four answers came up unprompted showed the group was making good progress. But the phrase that frames the entire session is garbage in, garbage out: if the data going into a pipeline is bad, everything downstream inherits the damage. No model, report, or dashboard built on dirty data can undo that damage later.
Why this matters before anything else: every later session in this course — cleaning, transforming, warehousing, and modeling — exists because data arriving from the real world is messy. The recall quiz is not a warm-up; it sets the test every idea in this lecture must pass: does this improve the data before it becomes somebody's decision?
3.1.2 The Story: The Carpenter's Last House
The session's story was read aloud. An elderly carpenter was ready to retire. He told his employer about his plans to leave the house-building business and live a more leisurely life with his wife and extended family. He would miss the paycheck, but he needed to retire.
The contractor was sorry to see his good worker go and asked whether he could build just one more house as a personal favor. The carpenter said yes, but his heart was not in the work. He resorted to shoddy workmanship and used inferior materials — an unfortunate way to end a career.
When the carpenter finished and the builder came to inspect the house, the contractor handed him the front-door key. "This is your house," he said, "my gift to you."
What a shock, what a shame: the house he built so carelessly turns out to be his own, and now he has to live in it. If he had known he was building his own house, he would have done it all so differently. The moral: every job must be completed with expertise.
3.1.3 Student Question: Was the Carpenter Fired?
One student asked whether the carpenter was fired — a wrong conclusion reached by jumping ahead while discussing the story. The correction became a lesson in itself.
Q: Was the carpenter fired? A: No. He wanted to retire — he chose to retire voluntarily, a voluntary retirement, not a firing. He chose to leave on his own. The lesson inside the correction: active listening. Read carefully, listen carefully, and do not jump to conclusions. Too much jumping is a problem. The same habit causes real damage when you meet a new data set: you assume the schema, assume the meaning of a column, assume the units, and only later discover the assumption was wrong.
3.1.4 Takeaways for Data Engineers
The takeaways from the story and the exchange:
- Admitting mistakes. The student accepted the correction openly, and that act of acceptance is itself a lesson: accepting a data quality problem is a good quality of a data engineer. Admit if there is a problem; admit if there is a mistake. A data professional who hides a bad column, a wrong merge, or a broken load only delays the damage.
- "Success is not doing extraordinary things." Do your best every time, on every task, with the same energy as your first day — even in a notice period, even on your last task. There is a quote for it: till your last minute, you are your best.
- The carpenter's house is a picture of building a data pipeline. Shoddy work today becomes the house you live in tomorrow. Every job must be completed with expertise, and the last word of your work is part of your work.
Where the analogy holds — and where it is strongest: the pipeline you build is the house you live in. A data load you "temporarily" hack in week three is the data quality problem your team debugs in month twelve, because downstream systems keep living in that house. Skip the schema check once and every report built on that table inherits the mistake.
Recap: one story, one rule — the quality of the work you do today is the quality of the data you live with tomorrow. Everything that follows in this lecture (cleaning, architecture, warehousing) is the same lesson applied to real data: build the house as if you will live in it, because you will.
3.2 Hands-On Kickoff: Google Colab and AI Assistants
3.2.1 Choosing a Coding Environment
Hands-on coding begins here. From this session to the last, each session includes one or two small, quality code snippets plus database tips. Any environment works: local Jupyter notebooks, Spyder, VS Code, or any of the many IDEs available. Because the participant count is large, the choice was Google Colab: go to colab.google.com, log in with your email, and create a new notebook. Colab runs in the browser, needs no local setup, and stores notebooks in your Google account, so everyone in a large class starts from the same place.
Q: Can we use Jupyter instead of Colab? A: Yes. Any environment works — Jupyter, Spyder, VS Code, or others. Pick what is comfortable; the code is the same. The environment is a surface detail; the logic you write and the data you handle are what matter.
3.2.2 Gemini Inside the Notebook
On the right-hand side of a new Colab notebook sits a Gemini panel (the flash model) — an AI teaching assistant built into the notebook. The point is not to replace learning but to learn effectively: you can ask the assistant anything, from "how can I install a Python library?" to questions about the data you are looking at. This connects to a wider point about generative AI tools — Gemini, Claude, and NotebookLM are all available, and you need to use AI effectively to do your work.
Why this is a data engineering skill, not a shortcut: Gen AI assistants are now a standard part of a data engineer's toolkit. Using them well means asking precise questions, checking the answers against your own reasoning, and knowing when the answer is wrong — the same judgment the rest of this course trains on data. The assistant accelerates you; it does not replace the need to understand what your code and your data are doing.
3.2.3 Tools, Not Magic: The Plumbing Analogy
A data engineer needs many tools, and to use any tool you first have to set it up.
The plumbing analogy: to clear a blocked pipe you need at least a screwdriver and a remover — you gather the tools first, then you work. Installing a library is the same idea: asking the assistant to install a Python library is like a plumber gathering tools. First you install the tool, then the assistant accepts your request, runs it for you, and shows you the command it used (a pip install command, for example). Where the analogy breaks: a plumber's tools sit in a box until the job; a library is code that lives in your notebook the moment it is installed, so the "gathering" step is visible every time you run a cell. The shared lesson stays: nothing works until the right tool is in place.
The assistant can install packages automatically — you watch it do it — or hand you the exact command to run yourself. It also knows the common libraries: Pandas for data frames and NumPy for numeric work. Those two names will appear constantly in this course: Pandas gives you tables with labeled rows and columns, and NumPy gives you fast array math underneath.
3.2.4 Notebook Cells and the Learning Rhythm
Colab notebooks are built from cells. You add a code cell with the plus code button and a text cell with the plus text button; text cells are where you write explanations about what a cell does. The plan for the course: at least two hands-on activities per session related to data management for machine learning, starting simple and getting complex, taught for a mixed audience — the explanation assumes nothing, so everyone follows.
Recap: one environment (Colab), one assistant (Gemini), one habit (install the tool before you use it). This is the working setup for the cleaning walkthrough in the next section, where the first step of the code creates a deliberately dirty data frame.
3.3 Data Pipelines and the Pre-Processing Workflow
3.3.1 What a Data Pipeline Is
The definition was read aloud in the session, and it is worth unpacking piece by piece:
A data pipeline architecture defines the structured flow of data from multiple sources through processing stages to its final destination for storage, analytics, or operational use. It ensures data integrity, scalability, and efficiency, while supporting both real-time and batch processing needs.
Walk through the parts: structured flow means the movement of data follows a designed route, not an accident. Multiple sources means the pipeline exists precisely because data arrives from more than one place. Processing stages are the steps in between — cleaning, transforming, validating. Final destination is where the data becomes useful: a database for storage, a dashboard for analytics, or a live system for operations. Data integrity, scalability, and efficiency are the three promises a well-built pipeline keeps: the data stays correct, the design copes with growth, and the work does not waste resources.
Modern architectures often follow ETL (extract, transform, load) or ELT (extract, load, transform) patterns. In ETL, transformation happens before loading, which is ideal for structured data. In ELT, data is loaded first and then transformed inside powerful cloud warehouses for flexibility and speed. Other models include stream processing pipelines for real-time analytics, batch pipelines for scheduled large-volume processing, and zero ETL for direct system-to-system integration.
Which pattern fits which job: batch pipelines move big volumes on a schedule (nightly loads), stream pipelines handle events as they happen (sensor readings, clicks), and zero ETL means two systems talk directly without a middle step. Most real estates mix them: a batch load for the warehouse plus a stream path for live dashboards.
3.3.2 From Many Sources to One Structured Frame
The water pipeline analogy: at home you build a pipeline when a well, a bore well, and the corporation water supplies all feed into one structured container. Data works the same way: many sources send data in any format, and you build some structured format to hold it — the earlier session covered JSON and other structured formats. An adapter converts each incoming format into that structure. Where the analogy breaks: water mixing is lossless — the streams just combine. Data sources bring incompatible encodings, units, and meanings, so a data pipeline must actively convert (adapt) each format rather than simply pouring everything together.
The first code of the session creates such a frame: sample data is defined in code (synthetic data), deliberately including various data quality issues — wrong values, missing values, inconsistencies — and then printed. In the real world the data could come from many places: a downloaded file, a Google file, social media data (Instagram), a URL feed, a sensor connection, or a database query. Data may be images, video, or streaming data. In this first example it comes from a single source: the code itself.
Q: What was the first step in the code? A: Creating a sample data frame with various data quality issues on purpose, then printing the frame so we can see the original data without any modification. The print step is deliberate: you must see the "before" picture before any cleaning happens, so you can verify later that every fix changed the data for the better.
3.3.3 The Pipeline Big Picture
The standard workflow shown in the session: data understanding first, then data pre-processing, then clustering, association, classification algorithms, validation, and advanced topics. This course focuses on the first two stages plus data engineering. The reason is garbage in, garbage out: roughly 70% of machine learning models and pipelines live in the first two stages — data pre-processing, data cleaning, data engineering, ETL, and EDA.
Why the first stages own the project: in industry, most project time goes into getting the data right, not into the model. A model is only as good as its training data, so teams spend the bulk of their effort understanding the data, cleaning it, and engineering it into a usable form. When a project fails, the cause is far more often dirty or misunderstood data than a badly chosen algorithm.
3.3.4 The Four Data Pre-Processing Tasks
Data pre-processing is the process of making the data more suitable for data mining. There are four tasks:
- Data cleaning — fill missing values, smooth noise, remove outliers, correct inconsistencies, drop duplicates.
- Data transformation — change the data's form or scale (normalizing, aggregating, encoding).
- Data reduction — shrink the data set to a manageable size without losing its essential information.
- Data discretization — convert continuous values into intervals or categories.
These four were stressed strongly — "trust me" — because they are the workhorse vocabulary of the field; mastering them lets you do hundreds of other tasks.
Scope of the four tasks: they are a classification of what pre-processing does, not a strict recipe. Real cleaning sessions mix them — a single walkthrough may fill missing values (cleaning), bin a column (discretization), and drop duplicate rows (cleaning again). Do not treat the four as sequential phases; treat them as the full set of tools you can reach for.
Recap: a data pipeline is a structured flow from many sources to a destination, built on ETL, ELT, stream, or batch patterns; the water-pipeline analogy says many inputs, one structured container. The course focuses on the front of the workflow — understanding and pre-processing — because that is where about 70% of real ML effort lives, and the four pre-processing tasks (cleaning, transformation, reduction, discretization) are its working vocabulary. The next section dives into the first task: cleaning.
3.4 Data Cleaning and Handling Missing Data
3.4.1 What Data Cleaning Is
Q: Why do you need data cleaning? A: Because data can contain wrong values, missing values, and inconsistencies — for example, the unit is not correct. Data cleaning corrects data quality problems.
The tasks in data cleaning: filling in missing data, smoothing out noisy data, removing outliers and artifacts, correcting inconsistent data, and removing duplicate data. The session then works through each one. Notice the pattern: every task is a repair — you are fixing problems that exist in the data before you can trust it, not adding anything new.
3.4.2 Four Ways of Handling Missing Values
When a value is missing, you have four classic choices:
- Ignore the instance. If a record is very bad or a column is missing, you can ignore that data instance. It is not an effective method, but why carry the burden — better to not have the garbage at all. This is the fastest option and also the most wasteful: you throw away the good columns of a bad row along with the bad ones.
- Fill in the missing value manually. Age missing → fill the age; car year missing → fill the year. Manual filling works but is very tedious and typically infeasible at scale; it takes lots and lots of time. It is the right tool only when the data set is tiny and the missing values are few.
- Use a global constant. Country missing → put India; currency missing → fill with the currency; location missing → replace with some location. A single constant stands in for every missing value in the field. Simple, but it can quietly poison statistics — if you replace fifty missing countries with one constant, your data now claims fifty records from a country that may not be the real one.
- Imputation — fill the missing value using the feature mean or the most probable value. This is the most used option because it preserves the rest of the record while supplying a plausible value.
Assumption behind imputation: imputation assumes the missing values are not systematically different from the observed ones. If the missing values are not random — for example, income is missing exactly for the poorest customers — then even a clever fill will carry a bias. The choice of method always trades effort, accuracy, and the risk of distorting the data's real distribution.
3.4.3 Imputation Techniques in Detail
A terminology contrast first: the course is called data management for machine learning, but the reverse direction also exists — machine learning for data management.
Q: Is this about data management for machine learning or machine learning for data management? A: Both. Data management for machine learning and machine learning for data management feed each other — it is like a father and mother who sometimes swap roles. Machine learning algorithms can help data management, for example by predicting the most probable value to fill in. And data management, in turn, produces the clean, well-organized data that machine learning needs to succeed.
The imputation techniques:
- Delete the missing observation. Deleting can lead to serious biases; if the missing share is small — say 5% or 10% of the sample — deletion is acceptable, but beyond that it starts to distort the data. The rule of thumb: when the missing share grows, the deleted rows stop being a random sample of your data, and everything you compute afterwards is built on a tilted picture.
- Hot-deck imputation: substitute the missing value with the value from the most similar cases. "Most similar" means a similarity method — a kind of analogy matching. The session first floated the term "cold check," then settled on the standard term hot-deck imputation: the donor value comes from a similar record inside the same data set. (The related cold-deck imputation variant draws donors from a different data set — the warm data set vs. the cold external one.)
- Distribution-based imputation: distribute values according to the observed distribution — for example, 20% or 15% shares based on previous observations. If 20% of your known records have a certain category, then 20% of the missing slots are randomly filled with that category, keeping the overall distribution intact.
- Statistical imputation with expectation-maximization (EM). EM works in two repeating steps. First it estimates the distribution of the data from what is observed (the expectation step). Then it fills the missing values in the way that is most likely under that distribution (the maximization step), and repeats until the estimates stop changing.
- Predictive imputation: write a code — for example a linear regression — that predicts the best value. Given a sequence like 16, 17, 18, missing, 20, 21, 22, the model fills the gap with the value it predicts.
Worked example — mean imputation: a small age column has values 25, 30, missing, 35, 28. The mean of the four known values is (25 + 30 + 35 + 28) / 4 = 118 / 4 = 29.5, so the missing age is filled with 29.5. Sense-check: 29.5 sits squarely in the middle of the observed range (25 to 35), so the fill does not invent an extreme value.
Worked example — predictive imputation sense-check: the sequence 16, 17, 18, ?, 20, 21, 22 rises by one at every observed step, so a linear model fit to the observed points predicts about 19 for the gap — consistent with the pattern, and the fill keeps the series smooth.
3.4.4 Smoothing Out Noisy Data
Noise means a random error or variance in a measured variable — the reading wobbles around the true value. Three classic smoothing techniques:
- Binning — smooth a sorted data value by consulting its neighborhood, the values around it, with the sorted values distributed into a number of bins. A noisy value is replaced by its bin's summary (mean, median, or boundary), so local wobble is absorbed into the bin.
- Clustering — detect and remove outliers. Group the data into clusters; points that sit far from every cluster are treated as noise and removed.
- Regression — smooth by fitting the data into regression functions. A fitted line or curve gives each point a predicted value, and the predictions replace the noisy observations.
The cost of smoothing: every smoothing technique trades information for stability. Binning loses the exact value (you keep the bin, not the number), clustering can remove a real rare event as a "noise," and regression can hide genuine nonlinear behavior. Smooth only when the noise is real and the downstream use tolerates the loss — never to make data "look nicer."
3.4.5 The Colab Walkthrough: Cleaning the Sample Data
The walkthrough cleaned the synthetic frame step by step. This is the full trace of the session's first hands-on:
- np.nan appeared in the age column.
Q: What does np.nan mean? A: It means not a number — a missing value marker. When you see np.nan, you know the value is missing, and you can ask the assistant what to do with it.
- Task one — handling missing data by deleting the missing observation; the missing name was deleted.
- The name column was filled with "Unknown" where values were missing (a global constant fill).
- Age: missing values filled with the age mean — the Pandas
fillnamethod with the mean value. - Height: missing values filled with the median; height shown in cm (this also fixes a unit inconsistency).
- Inconsistent data corrected with a lambda function — a small inline function that rewrites the non-conforming values into one format.
- Duplicate rows dropped.
- Outliers removed — the age value of minus 160 (a negative age) was flagged as an outlier or incorrectly collected data and removed.
Q: Do you see negative values here? What do we do with the negative age value? A: Yes — it looks like an outlier or incorrectly collected data, so we remove it and fill the missing age with the mean value. Removing the impossible negative creates a gap; the gap is then treated like any other missing value and filled with the mean.
- Noisy price data was smoothed by binning: the price column became a price bin with values bin 0, bin 1, bin 2. The sorted prices were cut into three bands, and each price was replaced by its band's label.
- Final print of the data frame to confirm the cleaning. The cleaned frame now shows a price bin column and heights in cm, and no negative values.
Example trace with real numbers: suppose the raw frame holds ages 25, 30, np.nan, 35, 28 and a height of 1.7 (meters) alongside 170 (cm). Step 4 fills the missing age with the mean 29.5; step 5 converts 1.7 into 170 cm so every height shares one unit; step 7 removes the duplicate row; step 8 removes the impossible -160; step 9 turns prices 95, 120, 150, 210, 260 into bins 0, 1, 2. After the run, the frame has no missing age, one consistent unit, no duplicates, no negatives, and a binned price column — a data set ready for the next stage.
Exam note: normalization techniques come in later sessions — expect more transformation work in the upcoming hands-on exercises. For this session, the examinable core is the five cleaning tasks and the four missing-value strategies, with imputation (mean, hot-deck, distribution-based, EM, predictive) as the detailed layer.
Recap: cleaning repairs the data — fill missing values, smooth noise, remove outliers, correct inconsistencies, drop duplicates — and the Colab walkthrough applied every one of these to a deliberately dirty frame, ending with a print that confirms the fixes.
3.5 Data Architecture Frameworks
3.5.1 Why Frameworks Exist
There are lots of data architecture frameworks available, and companies can also define their own. This is not theory pulled from a book: the trainer worked as a data architect on a British Telecom account and as a consultant for banking and Cisco projects dealing with data architecture.
Why experience leads to frameworks: data architecture work happens in telecom, banking, and consulting, and every client project restarts the same set of questions — what data exists, where it lives, how it flows. Frameworks exist so the thinking is repeatable: the same steps, the same vocabulary, the same checklists across different companies and industries.
The standing advice for students without a computer science background: breathe in, breathe out, relax — computer science is a common sense. You use your common sense and your knowledge; the frameworks just make the thinking explicit. Nobody expects you to memorize frameworks by heart; the frameworks are scaffolding that shows you what to look at.
The frameworks introduced in this session: TOGAF, DAMA-DMBOK, PMBOK, and ITIL.
3.5.2 Process, Project, and Product
Before the frameworks, three words need clean definitions:
- Process — a repeatable sequence of steps that turns inputs into outputs. Processes build products.
- Project — a time-boxed effort with a purpose and a timeline — three months, six months, one year, depending on the company's needs. Projects are done for a specific purpose: a migration project, a consolidation project, a data management project.
- Product — the outcome the process and project deliver.
Every process must have a process owner — somebody owns it; not everything can be done by everybody. Every process needs inputs, follows constraints, produces an output, has tasks that must be executed, and depends on other processes. This five-part shape — inputs, constraints, outputs, tasks, dependencies — is the same shape you will see inside every framework below.
Process anatomy: think of a process as a machine with a control panel. Inputs feed in (raw data, a ticket). Constraints limit the run (budget, regulations, deadlines). Tasks are the buttons that do the work. The output is what comes out (a cleaned table, an approved change). Dependencies are the other machines it must wait for. Naming these five parts is the first step of understanding any framework, because every framework is a collection of such processes.
3.5.3 PMBOK and ITIL
Q: What is PMBOK? A: PMBOK is a body of knowledge for project management — it explains how you define the scope, how you run the initiation phase, and the processes to follow, with activities for each process.
PMBOK explained in one sentence: the reference manual of project management. One participant was a PMP-certified project manager, so PMBOK got a live definition from someone who works with it daily. PMBOK organizes the work of projects — scoping, initiating, planning, executing, controlling, closing — into processes with named activities, so a project team anywhere speaks the same language.
ITIL works the same way for operations. In change management, an incident becomes a problem, the change is approved, then the change must be checked against availability — do we have the tools — and capacity — do we have the capacity. Lots and lots of processes are interconnected: a change in one place ripples into availability, capacity, and incident processes elsewhere.
PMBOK vs. ITIL — the division of labor: PMBOK governs projects (a one-time effort with a finish date, like building a warehouse). ITIL governs operations (the ongoing running of systems, like keeping that warehouse alive after launch). A data organization needs both: a project to build the pipeline, and operational processes to run it.
3.5.4 TOGAF and DAMA-DMBOK
TOGAF — The Open Group Architecture Framework, a standard of The Open Group and one of the most widely used architecture frameworks today. TOGAF gives you the different types and sources of data, the logical data sets, the physical data sets, and the data management resources available. In short: TOGAF is the framework for architecting the enterprise, and data is one of its layers.
DAMA-DMBOK is like PMBOK for data. It identifies the data needs of the enterprise, regardless of structure, and designs and maintains the master blueprint.
Q: What is the DMBOK? A: A guidebook on how to properly manage data across its entire life cycle — data governance, data architecture, data modeling, data storage, data security, and data warehousing. Version note: the course material referenced a version labeled "DM book one" — that is the first edition of the DAMA-DMBOK. The current widely used edition is DMBOK 2 (often written DAMA-DMBOK2), which is organized around the knowledge areas of data management. Know that the framework is edition-aware: the core idea — one body of knowledge for managing data — is the same in both.
3.5.5 Why Data Architecture Matters Today
Data requirements change rapidly, and new tools and practices keep appearing — what is current now becomes obsolete within months or a year. So we study the frameworks to understand business needs, know the trade-offs, and translate requirements properly.
Data architecture addresses the functional requirements of what needs to happen related to people, process, and technology — who uses the data, what processes work with it, what technologies relate to it. At the operational level it outlines how data is ingested, stored, transformed, and served along the data engineering lifecycle. Every project has a lifecycle, and data engineering has its own: how data is ingested, stored, transformed, mapped, converted, delivered, and disseminated.
Scope and limits of frameworks: frameworks give structure, not answers. A framework tells you which questions to ask (who owns this data? what are the dependencies?), but the correct architecture still depends on your business context, budget, and team. Frameworks also age: TOGAF's core thinking is durable, but the tools and platforms it guides you toward change every year — study the principles, not the vendor lists.
Real-world connection: moving 10 terabytes of data every hour from a source database into a data lake is exactly the kind of problem this lifecycle describes — ingestion at scale, storage decisions, transformation, and serving. The frameworks in this section are what make that work repeatable across clients: the same process anatomy, the same bodies of knowledge, applied to a new context every time.
Recap: four frameworks — TOGAF for enterprise architecture, DAMA-DMBOK as PMBOK-for-data, PMBOK for projects, ITIL for operations — all built on the same process anatomy of inputs, constraints, outputs, tasks, and dependencies.
3.6 Prompt Engineering with the CoStar Framework
3.6.1 Prompt versus Prompt Engineering
Q: What is a prompt? A: A prompt is an instruction. Prompt engineering is giving that instruction in a structured form so you get the desired result.
A plain prompt — for example "what is DMBOK" — returns a plain answer. A structured prompt returns a structured answer.
The analogy: prompt engineering is like data engineering: you give the structure, you get the result. A data pipeline gets structured data out because someone designed the structure in; a prompt gets a structured answer out because someone designed the instruction in. Structure is not decoration — it is the mechanism that produces the outcome.
3.6.2 The CoStar Framework
The CoStar framework structures a prompt into six parts, and it is itself a procedure you follow every time you need a high-quality answer from an AI assistant.
Purpose: the CoStar framework exists because an unstructured instruction leaves the assistant free to guess what you want — and it will guess differently every time. CoStar forces you to specify the six things that decide the answer.
Inputs & Outputs: inputs are your raw need and your domain knowledge; outputs are the six filled fields below, ready to paste into any assistant.
The six steps:
- Context — tell the assistant who you are and what you are working with (your role, your stack, your data).
- Objective — state exactly what you want as the outcome.
- Style — set how the answer is written (formal, technical, conversational).
- Tone — set the emotional register (professional, encouraging, neutral).
- Audience — say who will read the answer.
- Response format — specify how it should be laid out (steps, table, JSON, checklist).
Fill all six and the assistant has no room to wander; skip any of them and it will invent its own default for that part.
3.6.3 Worked Example: The Mainframe-to-Linux Modernization Prompt
Q: Which domain do you work in? A: Mainframe data architect in the retirement domain (financial industry), currently migrating mainframe data to open systems on Linux for better reporting.
The worked prompt was built live for this domain. Task: DMBOK architecture and mainframe to open system modernization, financial industry.
The worked CoStar prompt:
- Context: You are a senior enterprise data architect, banking transformation consultant, mainframe modernization strategist, and practitioner with deep expertise in DAMA frameworks. The stack is COBOL, JCL, VSAM, DB2, and RACF files, with siloed reporting systems.
- Objective: Provide a complete step-by-step enterprise transformation blueprint for applying DAMA architecture principles to modernize the financial institution from mainframe to an open system Linux platform.
- Style and tone: formal, expert, practical — written for a professional who will act on it.
- Audience: a leader who wants to become this architect.
- Response format: a structured blueprint with phases, steps, and rationale.
Why this works: the unstructured version of this question returns a general answer about mainframe modernization. The CoStar version returns a blueprint — because every field told the assistant what kind of answer to produce and for whom.
The real-world stack in the context field is the classic mainframe estate — COBOL programs, VSAM files, DB2 data, plus separate reporting systems. The trainer knew the same pattern from State Street, where lots of data was pulled from mainframes and legacy systems were rebuilt on Linux and Unix systems.
3.6.4 The Skill-Building Follow-Up Prompt and Its Roadmap
From the blueprint you can take any single slice. The slice chosen: skills. The follow-up prompt, run in Perplexity or Copilot: "I want only skills to be given and a roadmap for skill building using the above prompt. Skills and techniques to be learned. Roadmap using the above prompt."
The response was a personal capability development plan: it is going to take four years to become a successful person at this level. The skills domains to master:
- Enterprise data architecture aligned with DMBOK
- The DAMA-DMBOK framework and all 11 knowledge areas
- The three levels of data architecture — conceptual architecture, logical architecture, physical architecture
- Capability mapping and maturity models
- Banking-specific data domains
- Mainframe systems and open systems
- Data governance and data stewardship
- Integration (including graph query language)
- Reporting
- Securities and risks
- AML (anti-money-laundering) readiness
- Feature engineering pipelines
The lesson: a structured prompt made the assistant produce this specific, skill-focused roadmap instead of the full blueprint. The first prompt set the domain and objective; the follow-up reused that context and narrowed the output to one slice. You can then edit the prompt, change the domain, and run it again — the same structure, a different problem.
3.6.5 Hands-On Exercise: Build Your Own Structured Prompt
The exercise for the session: open ChatGPT, take your own domain and your own work, change the prompt fields, and build a structured CoStar prompt for yourself. Paste it into a notepad, put it in the chat box, and validate it. Then use Perplexity or Copilot to extract a skills roadmap from it.
Exam note: structured prompting is one of the promised hands-on best-practice topics — expect to use it. The examinable shape is simple: name the six CoStar fields, and be ready to build or critique a prompt that has them all.
Recap: a prompt is an instruction; prompt engineering gives it structure. CoStar's six fields — context, objective, style, tone, audience, response format — turn a generic answer into a tailored blueprint, and the same structure reuses across domains.
3.7 Categorizing Data Architectures
Data architectures can be categorized by centralization, by storage, by governance, and by processing. The image used: DAMA-DMBOK is the biryani — the full dish — and now we look at what is inside the content, the ingredients.
The biryani image: DAMA-DMBOK describes the whole enterprise data landscape — the full dish. This section opens the lid and looks at the ingredients: the architectural choices that make up the dish. Each ingredient (centralization, storage, governance, processing) is a dimension you can choose independently.
3.7.1 By Centralization: Centralized, Distributed, Hybrid
Centralized data architecture: one central database server, and every system feeds everything into that server. Advantages: a single point of control, simplified management — good for banking, healthcare organizations, and regulatory environments, where one authoritative store makes compliance and control straightforward.
Distributed data architecture: each unit works within its own thing — banking systems work separately, retail systems work separately; each unit takes care of its own sources, its own aggregations, its own reporting, like a group aggregation. It is good for many different sources and many different aggregations; insurance companies may use this approach, and master data management (MDM) is often decentralized because customer data, product data, bank data, and application data live in different places.
Hybrid data architecture: combine a few centralized and a few decentralized parts and mix based on need — the data structure mixes the two, some done centrally, some done decentralized, depending on your infrastructure and how you exchange data.
| Dimension | Centralized | Distributed | Hybrid |
|---|---|---|---|
| Where data lives | One central server | Each unit owns its own stores | A mix, chosen per need |
| Control | Single point of control | Each unit controls its slice | Controlled centrally where it matters |
| Best for | Banking, healthcare, regulated environments | Many sources and aggregations (insurance, MDM) | Infrastructure with both needs |
| Main risk | Single point of failure, bottleneck | Inconsistent definitions across units | More design and coordination |
When to pick which: choose centralized where control and compliance dominate; choose distributed where units genuinely need autonomy; choose hybrid when both needs exist and you can afford the coordination.
The trap of "everything hybrid": hybrid is not a default that avoids decisions — it is a decision about each data flow. Deciding which flows are central and which are distributed, and who owns the exchanges between them, is the actual work. Naming the architecture is easy; making the per-flow call is where projects succeed or stall.
3.7.2 By Storage: Warehouse, Lake, Lake House, and Data Mart
By storage you can have a data warehouse, a data lake, or a data lake house.
- Data warehouse — a structured store, organized around subjects, optimized for reporting and analysis; data is cleaned and modeled before it serves queries.
- Data lake — a repository that keeps raw data in its original form until it is needed; cheap to fill, flexible later, but the cleaning burden moves to whoever queries it.
- Data lake house — combines both: lake-scale storage of raw data with warehouse-style table support, schema management, and update/delete capabilities.
- Data mart — a subset of a warehouse, built for one department, team, or use case.
The earlier session covered the data lake and the data warehouse; this session adds the data mart. The healthcare example: clinical data passes from one hospital to another (the example named Kaveri hospital in Chennai sharing with its other branches), research data and clinical operations data get exchanged, and different activities use the data.
Real-world connection: hospital networks, research institutions, and insurers all run data exchange architectures like this — one network of branches sharing clinical, research, and operations data, with each activity pulling its own slice. That slice is, in miniature, a data mart: the same data, filtered for one purpose.
3.7.3 By Governance and Processing: Mesh, Fabric, Lambda, Kappa
Governance-wise you have data mesh and data fabric:
- Data mesh — decentralize by domain: each team owns and serves its own domain data as a product. It inverts the monolithic platform: instead of flowing data into a centrally owned lake, domains host their own datasets and consume each other's. Key principles: domain-oriented ownership, data as a product, self-serve infrastructure, federated governance.
- Data fabric — a centralized metadata and integration layer that connects data wherever it lives, providing a unified view without moving everything into one store.
Processing-wise you have lambda processing and kappa processing:
- Lambda — run two parallel paths: a batch layer for accurate historical results plus a speed layer for near-real-time results, merged for the final answer.
- Kappa — one streaming path only: treat everything as a stream and replay it for batch-style results, avoiding the double logic of lambda.
The practical default: most of the time, in practice, kappa processing is used — one pipeline, one logic, replayable from the stream. Lambda's two paths mean two codebases to keep consistent, so teams favor the single streaming path wherever latency and correctness allow.
Recap: architectures sort along four dimensions — centralization (centralized/distributed/hybrid), storage (warehouse/lake/lakehouse/mart), governance (mesh/fabric), and processing (lambda/kappa). The next sections zoom into the storage ingredient: the mutual fund warehouse story shows a real mart built from a real warehouse.
3.8 The Mutual Fund Warehouse Story
3.8.1 The Original Warehouse
The story is a real one from practice. The team built a data warehouse for a global mutual fund business — the mutual fund business engine — covering 10,000 funds. A fund is related to many stocks: short-term funds, mid-cap funds, tech funds, and so on.
There was lots and lots of mainframe data. Mainframe pushed the data into a staging area; the team wrote extraction, transformation, and loading (ETL) jobs to get the data, massage and clean it, and load it into Oracle and Informix databases (the architect had also worked with DB2 and other databases). Databases were built on a nightly basis with a lot of batch processing. Reporting went to Crystal Reports and Business Objects, plus other front-end and development tools.
Real-world placement: nightly batch ETL into an enterprise warehouse, with business intelligence on top, was the standard pattern for years. If you meet a financial data team from the 1990s or 2000s, this is the shape of their system: mainframe sources → staging → ETL → warehouse → reports.
3.8.2 The Ontario Teachers' Pension Board Request
After about a year the warehouse became so big and huge that processing specific funds was taking a long time. Then a real client arrived: the Ontario Teachers' Pension Board, which wanted to have its own mutual fund. The pension board was investing in only some of the funds — for the example, 90 funds out of the 10,000.
Q: What should the team have done for a client investing in only 90 funds? A: Build a data mart. Filter the miniature data — same data model, same tables — and load it. It is like filtering in Excel: you select and group what you need. The 8 terabytes of the full warehouse became maybe 90 gigabytes for the pension board.
3.8.3 The Data Mart Solution
The data model did not change: same data, same tables, same structure. The team ran one more process — extraction, filtering, loading — creating an exact miniature that mimics the structure.
The grandson analogy: the data mart mimics the warehouse like a grandson mimics the son. Same family line, same shape, one generation smaller — the mart is structurally identical to the warehouse it came from, just filtered down to one client's slice. Then "bingo" — the pension board had its own thing.
Worked example with real numbers:
- The warehouse holds 10,000 funds; the client invests in 90 of them.
- The warehouse is 8 terabytes; the filtered mart is about 90 gigabytes.
- Same data model, same tables, same structure — only the rows for the client's 90 funds are loaded.
The build was one extra pipeline: extract from the warehouse → filter to the 90 funds → load into a dedicated mart. Sense-check: 90 out of 10,000 funds is under 1% of the rows, and 90 GB is just over 1% of 8 TB — the size drop matches the row drop, exactly what a subset should do.
Delta processing followed: whenever a fund changes, a stock changes, or the market changes on the mainframe, the delta is loaded nightly into the mart. Data warehouses are usually about eight hours behind the live systems (some are near-time, some five to six hours behind).
Scope — the warehouse is a snapshot, not live: warehouses and marts are built on batches, so they lag the live systems that feed them — typically hours behind. If a report says "yesterday," the underlying data is at least a batch old. This is fine for reporting and analysis; it is wrong for anything that must react in real time. When your use case demands immediacy, you are designing for a stream, not a warehouse.
The advantage: portfolio administrators and banking people can build reports — this fund performed like this over one month, last week it was like this, yesterday like that — and show them to customers. Customers give inputs on changes; trading happens in real time; the trades go back into the mainframe; and the cycle repeats.
Real-world connection: data marts for specific client portfolios, hours behind, driving reporting and trading inputs — this is the classic loop of a financial data estate. A strategic warehouse serves many tactical marts, and the marts feed the decisions that flow back into the source systems. The mart pattern answered a business problem (a big warehouse too slow for one client's slice) with a structural move, not a rewrite.
Recap: when one client needs a slice of a huge warehouse, build a data mart — same model, filtered rows, a miniature like a grandson mimicking the son — and keep it fresh with nightly delta loads.
3.9 Master Data Management
3.9.1 What Master Data Is
Q: What is master data? A: Data that rarely changes — it is permanent, central, and attribute-like. Examples: master customer data, master product data, master application data.
Master data is defined as data that is rarely changing, permanent, and central; you find those data and manage them as master data. The class discussion added that master data does not change often and is made of attributes. In practice, master data is the shared truth about the things your organization keeps referring to — the customers, products, employees, and applications that many systems reference again and again.
What makes data "master"? Three tests: it changes rarely (a customer's name stays stable for years), it is central (many systems depend on the same copy), and it is attribute-like (it describes a thing — name, address, category — rather than measuring events). Contrast master data with loosely coupled data: values that change often and are not referenced everywhere.
The mobile number example: when a mobile number changes, it causes a chain of headaches — the email is linked, accounts are linked — so many problems. The mobile number shows why master data is managed carefully: one change ripples through every system holding it. Things like a change of company, a new car, or changed food habits are loosely coupled and less critical — nothing downstream breaks when they change.
3.9.2 MDM in Practice: Finding New Lines of Business
Master data management (MDM) can be decentralized to accommodate the needs of different units, since customer data, product data, bank data, and application data all live in different places.
The trainer is IBM InfoSphere MDM certified, so the example comes from practice: a new business unit head joins an insurance company and wants to run a new business. The existing systems are scattered, so first you build data pipelines from the different insurance data, collect everything, and build a master data. Once the master data exists, you have information about everything the company does. Then you can find out whether a new line of business (LOB) or a new vertical can be created from it, and build new systems or change existing ones. MDM practice finds new lines of business this way.
Worked example — the insurance scenario: suppose the scattered systems hold customer data in one unit, policy data in another, and claims data in a third. Pipelines collect all three into a master record per customer — the same customer now has their policies and claims in one place. The business head asks: who are our customers, what do they hold, where are the gaps? The master data answers the question directly — for example, it reveals a large group of policyholders who hold auto policies but no home insurance, which is a candidate new line of business. The insight exists only because the scattered data was first unified.
Real-world connection: MDM in insurance and finance is the standard way to discover new lines of business. The master data is not just a clean list — it is a strategic asset that reveals what the company knows about itself, and that knowledge is what new products get built on.
Recap: master data is rare-changing, permanent, central, attribute-like data — managed carefully because every change ripples (the mobile number). MDM unifies scattered records so the business can see itself whole and find new lines of business.
3.10 Data Warehouse Fundamentals
3.10.1 The Classic Definition
Q: Who defined the data warehouse, and how? A: W.H. Inmon and Ralph Kimball, the two famous data warehouse gurus. The definition: a data warehouse is a subject-oriented, integrated, non-volatile, time-variant collection of data in support of management's decisions.
That one sentence is the classic definition of the data warehouse, and every word in it is a design decision. Four of its terms deserve separate treatment, because together they distinguish a warehouse from any ordinary database.
3.10.2 Subject-Oriented and Integrated
Subject-oriented: the data is organized around the subject you are looking for — accounts data, sales data, customer churn data — the subject being the product or the customer. A warehouse is not organized around applications ("what the order-entry system stores") but around subjects ("everything we know about the customer").
Integrated: data comes from multiple sources, from multiple locations, and is brought together for that particular subject. It is the same integration the story showed: data coming from different topics and many sources is combined — that is how big data evolves and how streaming data evolves.
Subject orientation vs. application orientation: an operational system organizes data for one task (this screen, this transaction). A warehouse organizes data for one subject (the customer, the product, the sale) across every task and system that touches it. That is why two order systems with different formats can still feed one customer subject: the warehouse's job is to bring their data together.
3.10.3 The Integration Example
Worked example — one field, three encodings: three applications represent the same field differently:
- Application A represents gender as M and F
- Application B represents it as 1 and 0
- Application C uses male and female
The warehouse integrates all three into a single representation, M and F — every source's value is mapped to the same standard before it enters the warehouse. The same applies to balances: "balance on hand," "current balance," and "cash on hand" all become one format. One source puts it in one format; the warehouse changes it to one standard format.
Sense-check: after integration, a report reading the gender column sees exactly two values everywhere, and a report summing balances sees one consistent definition of "balance" — the integration is what makes cross-system reporting possible at all.
3.10.4 Non-Volatile, Time-Variant, Read-Only
Non-volatile means it does not change. Volatile means it is changing. Once data enters the warehouse, it is never removed. Regular, real-time, and transaction systems let you insert, change, update, delete, and replace — all kinds of things. The warehouse is different: load, extract, transform, load — then read-only access is given. You never "edit history" in a warehouse; you add new snapshots.
Time-variant: you want the data from old to now, with the timing — the data carries its time dimension. Every warehouse record knows when it was true, so you can ask "what did sales look like last quarter?" and get the state as it was then, not as it is now.
There is also a classic list of 12 rules of data warehousing (from Bill Inmon) worth reading on this topic — the four-part definition here is the compressed version of those rules.
3.10.5 Data Warehouse Architecture
The typical architecture: lots of operational data comes from multiple sources; you select, extract, transform, and integrate, and build the data warehouse and the metadata. From the warehouse you create subsets of data, which are the data marts. From the marts you use APIs, AWS calls, web service calls — and you build your reporting systems on top.
Sources → Extract/Transform/Integrate → Warehouse + Metadata → Data marts → Reporting (APIs, web services)
Real-world connection: this is the reference architecture you will see in every warehouse project, from the Oracle and Informix world of the 1990s to today's cloud warehouses. The names of the tools change (Crystal Reports becomes Power BI, Informix becomes Snowflake), but the shape of the pipeline stays: sources in, integrated warehouse in the middle, marts as subsets, reporting on top.
3.10.6 Data Warehouse versus Data Mart
| Aspect | Data warehouse | Data mart |
|---|---|---|
| Data sources | Many — operational and external data | Few — operational and external data |
| Implementation time | 9 to 18 months for the first stage | 4 to 12 months |
| Characteristics | Flexible, extensible, durable, strategic data orientation | Restrictive, non-extensible, short life, tactical project operations |
Sometimes a dynamic data mart is created just to show somebody something strategic — and then dismantled. Data marts are tactical; the warehouse is the strategic asset.
Scope — when the table lies a little: the "few sources" of a mart means few for that mart — the mart still inherits the warehouse's integrated data underneath. And "short life" describes tactical marts (built to answer one question, then retired); a mart feeding a long-running client like the pension board lives as long as the client does. Use the table to compare the typical positioning, not as a legal contract.
Recap: the warehouse is subject-oriented, integrated, non-volatile, time-variant — history that never changes, organized around subjects, integrated across sources, carrying its time dimension. Marts are its tactical subsets. Next up: the schemas that shape how facts and dimensions sit inside the warehouse.
3.11 Warehouse Schemas: Star and Snowflake
3.11.1 Facts and Dimensions
A warehouse schema ensures you have tables, keys, and relationships — the skeleton that holds the warehouse together. Every schema has two kinds of tables:
- Fact table — holds quantitative data, measurable facts — like sales, revenue, amount, and units. Each row is one measurable event (one sale, one order line) and the values are numbers you can add, average, and sum.
- Dimension tables — hold context data, descriptive information like product names, customer information, or dates. Each dimension describes one way of slicing the facts: by product, by customer, by time, by city.
The two words map to the two kinds of data: qualitative data describes — it is not numbers and not measurable (product name, brand, color); quantitative data is anything measurable (price, units, sales amount). Product data — product, brand, category, color, size — is mostly descriptive, qualitative; customer data in the customer dimension is qualitative too. In a schema, facts answer "how much?" and dimensions answer "about what?".
The shape of a query: every analysis in a warehouse is a join between the two: slice the fact table by a dimension's categories ("sales by product category") or filter by a dimension's attributes ("sales for customers in Chennai"). That is why the number and structure of dimensions decide how fast and how flexible the warehouse is.
3.11.2 The Star Schema
The star schema places the fact table at the center, with dimension tables attached around it. The example: dimensions city, product, period, and customer; facts price, amount, sales amount, and units — a product-sales fact table. (The session audio transcribed the facts as "pages, amount, sales amount and units"; price is the natural reading for a product-sales fact table, and that is the form used here.)
city (dimension)
|
product (dimension) --- FACT table --- period (dimension)
(price, amount, sales amount, units)
|
customer (dimension)
Q: Why is it called a star schema? A: Because the fact table sits in the center and the dimension tables attach around it — a star shape. Stars in the sky have multiple points; star topology has many connections, and the fact table connects to many dimensions.
The star schema has single-level dimensions: each dimension is one flat table. A dimension can be extended further for convenience: a product dimension can split into electronic and non-electronic products; cars can split into e-cars versus non-e-cars. That is called a denormalized design — the extra category levels are stored inside the dimension table itself rather than in separate tables.
Advantages: quick analysis, faster query performance, easy to understand — every query is one join from the center out, and the schema reads like the business story. The drawback: because of denormalization there is redundancy — the same category names repeat across many product rows — and that is where the snowflake schema comes in.
3.11.3 The Snowflake Schema
The snowflake schema is an extension of the star schema.
Q: What do you see in the snowflake schema? A: Dimension tables split into smaller sub-dimensions — just like snowflakes distribute, the dimensions distribute further. There is one dimension table, and that dimension table has another sub-dimension table; many tentacles come off the fact table.
city (dimension)
|
product --> product_category --> FACT table --> period --> date_level
(sub-dimension) (sub-dimension)
|
customer (dimension)
Dimension tables are split into smaller sub-dimensions to keep data more organized and detailed, just like snowflakes. It is a multi-level dimensional table with normalization for storage efficiency, suitable for complex data environments. Each repeated attribute (category, region, date part) moves out of the flat dimension into its own normalized table.
Advantages: less data redundancy, efficient storage — each fact is stored once, each category once, so nothing repeats. Drawback: queries can be slow because you have to go through multiple joins — reaching the fact table now crosses dimension to sub-dimension to sub-sub-dimension.
Scope — the real trade-off: the snowflake's "efficient storage" buys disk at the cost of query time, and in modern warehouses the savings are often small while the join cost is real. The upcoming database exercise will run queries on both schemas so you can feel the join cost directly: the star answers with fewer joins, the snowflake needs more — that is the price of normalization.
| Aspect | Star schema | Snowflake schema |
|---|---|---|
| Dimension structure | Single-level (flat) | Multi-level (normalized sub-dimensions) |
| Redundancy | Present (denormalized) | Low (normalized) |
| Query speed | Faster — fewer joins | Slower — multiple joins |
| Best for | Quick analysis, easy understanding | Complex environments, storage efficiency |
When to pick which: choose the star for fast, simple analysis on most warehouses; choose the snowflake when storage efficiency and organized detail outweigh join cost.
Recap: facts are the measurable numbers, dimensions are the descriptive context; the star schema centers the fact table with flat dimensions around it, the snowflake normalizes those dimensions into sub-tables — trading redundancy and speed for organization and storage efficiency.
3.12 ETL versus ELT
3.12.1 The Two Patterns
ETL (extract, transform, load): transformation occurs before loading, ideal for structured data. The pipeline pulls data from sources, cleans and shapes it on a separate transformation system, and only then loads the finished product into the warehouse.
ELT (extract, load, transform): data is loaded first, then transformed inside powerful cloud warehouses, for flexibility and speed. The pipeline pulls raw data and loads it as-is; the transformation happens later, inside the warehouse itself, with the warehouse's own compute.
Why the order matters: the difference between the two patterns is the order of the final two steps, but the design consequences are large. ETL needs a transformation engine outside the warehouse and requires the team to predict, up front, what shape the data must take. ELT keeps the raw data available and defers transformation — analysts and data scientists can transform the loaded data themselves with SQL whenever a new need appears.
Related models: stream processing pipelines for real-time analytics, batch pipelines for scheduled large-volume processing, and zero ETL for direct system-to-system integration.
3.12.2 Why ELT Wins
The trend in practice: companies use ELT because it transforms during the loading itself — one load, multiple transformations — and it supports multiple pipelines and real-time dashboards. If one place fails in ETL, the whole flow can fail; ELT gives flexibility. That is why ELT is considered more powerful than ETL today.
The history behind the trend: ETL was the gold standard for decades. Back then warehouses were row-based databases built for transactions, not for bulk analysis, so heavy transformation had to happen on a separate system before loading. Today's warehouses are highly scalable columnar systems that can store raw data cheaply and run big transforms in place — so the sensible division of labor moved: extract and load the raw data, transform where the power is. Some pipelines keep a small lowercase-t transform (EtLT) between extract and load — deduplicating records, parsing URLs, masking sensitive data — for work that must happen early, but the heavy business transformation moved into the warehouse.
| Aspect | ETL | ELT |
|---|---|---|
| Order | Extract → Transform → Load | Extract → Load → Transform |
| Where transformation runs | Separate transformation system | Inside the cloud warehouse |
| Data available to analysts | Only the transformed result | Raw data stays available |
| Flexibility | Fixed pipeline; changes need rework | Transform any time, per need |
| Failure mode | One failing step can break the flow | Warehouse load, then transform on demand |
| Best for | Structured data, strict compliance needs | Flexible analytics, multiple pipelines, real-time dashboards |
When to pick which: choose ELT wherever the warehouse is powerful and flexibility matters — the modern default; choose ETL where transformation must happen outside the warehouse, for example under strict compliance or with limited warehouse compute.
Recap: ETL transforms before loading; ELT loads first and transforms inside the warehouse. Modern cloud warehouses made ELT the practical winner: one load, multiple transformations, more flexibility — while a small EtLT prefix still handles dedup and masking early.
Bridge: the warehouse schemas from the previous section are exactly what the T in both patterns produces — the transformed, modeled data ready for reports.
3.13 Course Roadmap and Hands-On Goals
3.13.1 The Three Practical Goals
The course roadmap has three hands-on goals. One: Python-based data engineering, connecting data management and machine learning. Two: working with a database — running effective queries, building a data warehouse and a data mart. Three: sharing best practices from experience, starting with structured prompting. On top of that: the Hadoop ecosystem for big data systems, and, if time permits, statistical and visualization techniques that help with effective data management.
3.13.2 The Upcoming Database Hands-On
The database exercise uses XAMPP — a bundle containing Apache, PHP, and MySQL — with MySQL or MariaDB. You download the software from a shared Google Drive, build a data warehouse and a data mart, run the queries, and see the OLAP-style operations. Simple reporting first, then it can be taken into Power BI or other dashboards.
Exam note: database hands-on is one of the promised practical exercises — expect to run queries on warehouse schemas. This is the moment the star and snowflake schemas from the earlier section become real: you build the tables, load facts and dimensions, and feel the join cost yourself.
3.13.3 The HR Recruitment Data Mart Example
A data mart example from planning: HR wants to see how recruitment is performing, so they build a separate data mart. The warehouse holds summary data, raw data, and metadata. Data sources — flat files, operational systems, database systems, mainframe systems — all stage into a staging area, then ETL processing builds the warehouse, and the warehouse splits into small miniature data warehouses called data marts for specific purposes, like data mining.
Worked example — the HR mart pipeline:
- Sources: flat files, operational systems, database systems, mainframe systems.
- All sources stage into a staging area.
- ETL processing builds the warehouse (summary data, raw data, metadata).
- The warehouse splits into miniature data marts for specific purposes.
- HR queries its recruitment mart — hires per month, time to hire, source of hire — instead of querying the whole warehouse.
Sense-check: instead of building a machine learning model on one big garbage pile, you build it on a clean data set — which gives better data mining algorithms, better reporting, and better analytics. The mart is the clean set the model deserves.
3.13.4 Structure of the Course
The course structure: 16 sessions, 4 webinars, 2 quizzes, and 1 assignment. Exam notes:
- Quiz 1 is worth 5 marks, opens on 24 May and closes on 28 May — no extensions; the dates were finalized with the other faculty, and four days of flexibility were already built in. Quiz 2 follows later, also worth 5 marks.
- The assignment: groups of 3 to 4 members, formed by the operations team. The announcement described it as simple and worth a handful of marks — the wording of the marks was garbled in the session, but the shape (group assignment, formed by operations) is clear.
- Webinar topics include: AWS account creation; working with AWS tools; building the modern data stack ELT architecture; and data extraction using AWS Databricks.
- Next session covers a full EDA and feature engineering — "trust me, that will take you to the next level."
- The session's material covered about 80% of the planned content; the remainder continues next time.
- The DAMA-DMBOK introduction is a must-read; the material will be uploaded to the course folder.
Q: What hands-on work is expected in this course? A: Python data engineering, database queries on MySQL and MariaDB, structured prompting best practices, and big data systems (the Hadoop ecosystem), plus statistical and visualization techniques.
Recap: three practical goals — Python data engineering, database work (warehouse + mart), and best practices from experience — plus Hadoop for big data. The roadmap is the container for everything in this session: cleaning in Colab, schemas in a warehouse you build yourself, and structured prompting as the first best practice.
Exam Guidance Summary
- Two quizzes, 5 marks each. Quiz 1 opens 24 May and closes 28 May; no extensions (final dates agreed with the other faculty, with four days of flexibility already included).
- One assignment in groups of 3 to 4 members, formed by the operations team; simple and worth a handful of marks.
- Course structure: 16 sessions, 4 webinars, 2 quizzes, 1 assignment.
- Webinar topics: AWS account creation, working with AWS tools, building the modern data stack ELT architecture, and data extraction using AWS Databricks.
- Practical hands-on expected: Python data engineering in Google Colab, database queries on MySQL and MariaDB with XAMPP, structured prompting with the CoStar framework, the Hadoop ecosystem, and statistical and visualization techniques.
- Next session: a full EDA and feature engineering — promised to take your skills to the next level.
- The four data pre-processing tasks (data cleaning, data transformation, data reduction, data discretization) were stressed as core vocabulary.
- Normalization techniques come in later sessions.
- The DAMA-DMBOK introduction is a must-read.
How to prepare: the two quiz-relevant cores of this session are the four pre-processing tasks (cleaning, transformation, reduction, discretization) and the warehouse vocabulary — facts and dimensions, star versus snowflake, ETL versus ELT, and warehouse versus data mart. The CoStar framework's six fields are the other likely question: be ready to name them and build a prompt with all six.
Key Industry Applications
- Real-world: about 70% of machine learning project time goes into data understanding and pre-processing — garbage in, garbage out drives industry practice.
- Real-world: nightly batch ETL into enterprise warehouses with Oracle, Informix, and DB2, with Crystal Reports and Business Objects on top — the classic warehouse pattern.
- Real-world: data marts for specific clients — the 10,000-fund warehouse and the 90-fund Ontario Teachers' Pension Board mart, 8 terabytes down to 90 gigabytes.
- Real-world: mainframe estates (COBOL, JCL, VSAM, DB2, RACF) being modernized to open systems on Linux for better reporting — the basis of the CoStar worked prompt.
- Real-world: master data management (IBM InfoSphere MDM) in insurance and finance to find new lines of business.
- Real-world: healthcare networks exchanging clinical data between hospital branches.
- Real-world: generative AI assistants (Gemini, ChatGPT, Perplexity, Copilot, NotebookLM) as standard data engineering tools.
- Real-world: cloud warehouses and ELT for flexibility, multiple pipelines, and real-time dashboards.
- Real-world: Power BI and Tableau for analytics and visualization on top of warehouses; XAMPP (Apache, PHP, MySQL) for database work; Hadoop for big data systems.
The pattern behind the list: every entry is the same lesson — data management work happens where real systems run. The warehouse and mart pattern, the mainframe modernization path, and the clean-data-for-models principle are not academic. They are the daily shape of financial, healthcare, and cloud data engineering, and the skills this session practices (cleaning, schemas, prompting) are the ones those industries hire for.
DMML Lecture 3 notes · Data Pre-Processing, Data Architecture, and Warehouse Schemas
Sections Breakdown
Session overview: the recall quiz, the carpenter story, hands-on data cleaning in Google Colab, architecture frameworks, warehouse schemas, and the course roadmap.
The recall quiz vocabulary (garbage in garbage out, data silos, data lake, data warehouse), the carpenter story, and its takeaways for data engineers.
Choosing a coding environment, the Gemini assistant inside the notebook, the plumbing analogy for installing tools, and notebook cells.
The data pipeline definition, ETL/ELT/stream/batch patterns, the water pipeline analogy, and the four data pre-processing tasks.
Data cleaning tasks, four ways to handle missing values, imputation techniques, noise smoothing, and the Colab cleaning walkthrough.
Why frameworks exist, the process anatomy, and the four frameworks: PMBOK, ITIL, TOGAF, and DAMA-DMBOK.
Prompts versus prompt engineering, the six CoStar fields, the mainframe-to-Linux worked prompt, and the skills roadmap follow-up.
Four categorization dimensions: centralization, storage, governance, and processing, with warehouse, lake, lake house, mart, mesh, fabric, lambda, and kappa.
A 10,000-fund warehouse, the Ontario Teachers' Pension Board request, and the data mart solution with delta processing.
What makes data master, the mobile number example, and MDM in practice finding new lines of business.
The classic Inmon/Kimball definition, the four terms, the integration example, warehouse architecture, and warehouse versus data mart.
Facts and dimensions, the star schema with single-level dimensions, and the snowflake schema with normalized sub-dimensions.
The two patterns, why the order matters, why ELT wins in modern cloud warehouses, and the EtLT subpattern.
Three practical goals, the XAMPP database hands-on, the HR recruitment data mart example, and the course structure.
Quiz and assignment logistics, webinar topics, and the quiz-relevant cores of the session.
Real-world applications: ML project time, nightly batch ETL, client data marts, mainframe modernization, MDM, and cloud ELT.
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.
The Carpenter's House and the Data Quality Mindset
Must-know: Garbage in, garbage out frames data management: if data entering a pipeline is bad, everything downstream inherits the damage. Every job must be completed with expertise.
⚠️ Top pitfall: Jumping to conclusions without active listening (e.g., assuming the carpenter was fired) — the same habit causes wrong assumptions about real data.
Self-check: What does the carpenter story teach about building a data pipeline?
Hands-On Kickoff: Google Colab and AI Assistants
Must-know: Any coding environment works (Jupyter, Spyder, VS Code, Colab); this course uses Google Colab with Gemini as an in-notebook AI assistant. Set up the tool before you use it.
⚠️ Top pitfall: Trying to run code before the library is installed — no tool works until it is set up.
Self-check: Can you use Jupyter instead of Colab?
Connects to: Data Pipelines and the Pre-Processing Workflow (3.3).
Data Pipelines and the Pre-Processing Workflow
Must-know: A data pipeline is a structured flow of data from multiple sources through processing stages to a destination; ETL transforms before load, ELT loads then transforms. About 70% of ML effort sits in data understanding and pre-processing (garbage in, garbage out).
⚠️ Top pitfall: Treating the four pre-processing tasks as a strict sequence instead of a toolset; data cleaning sessions mix cleaning, discretization, and reduction freely.
Self-check: Name the four data pre-processing tasks.
Connects to: Data Cleaning and Handling Missing Data (3.4); ETL versus ELT (3.12).
Data Cleaning and Handling Missing Data
Must-know: Data cleaning tasks: fill missing, smooth noise, remove outliers/artifacts, correct inconsistencies, drop duplicates. Four missing-value strategies: ignore, manual fill, global constant, imputation. Deletion is acceptable only when the missing share is small (5-10%).
⚠️ Top pitfall: Deleting too many missing observations biases the data; replacing missing values with a global constant can distort the real distribution.
Self-check: What does np.nan mean, and what does hot-deck imputation do?
Connects to: Data Pipelines and the Pre-Processing Workflow (3.3).
Data Architecture Frameworks
Must-know: TOGAF = enterprise architecture framework; DAMA-DMBOK = body of knowledge for managing data across its lifecycle; PMBOK = project management reference manual; ITIL = operations processes (change, incident, availability, capacity).
⚠️ Top pitfall: Treating frameworks as answers instead of question lists — the correct architecture still depends on business context, budget, and team.
Self-check: What is the DMBOK, and what version note applies to it?
Connects to: Prompt Engineering with the CoStar Framework (3.6); Categorizing Data Architectures (3.7).
Prompt Engineering with the CoStar Framework
Must-know: CoStar = Context, Objective, Style, Tone, Audience, Response format. A structured prompt returns a structured answer; unstructured prompts return generic answers.
⚠️ Top pitfall: Skipping fields in the prompt — each skipped CoStar field lets the assistant invent its own default and the answer drifts generic.
Self-check: Name the six fields of the CoStar framework.
Connects to: Data Architecture Frameworks (3.5).
Categorizing Data Architectures
Must-know: Four categorization dimensions: centralization, storage, governance, processing. Centralized = single point of control; distributed = units own their own; hybrid = mix. Mesh/fabric for governance; lambda/kappa for processing (kappa used most in practice).
⚠️ Top pitfall: Using 'hybrid' to avoid decisions — hybrid requires a per-data-flow choice about what is central and what is distributed.
Self-check: Name the four ways to categorize data architectures.
Connects to: The Mutual Fund Warehouse Story (3.8); Data Warehouse Fundamentals (3.10).
The Mutual Fund Warehouse Story
Must-know: A data mart is a filtered miniature of a warehouse: same data model and tables, subset of rows (e.g., 90 funds from 10,000; 8 TB down to 90 GB). Data warehouses are usually about 8 hours behind live systems.
⚠️ Top pitfall: Expecting a warehouse to be real-time — warehouses and marts are batches and lag live systems by hours; real-time needs belong on a stream.
Self-check: Why was a data mart the right answer for a client investing in only 90 funds?
Connects to: Data Warehouse Fundamentals (3.10); Warehouse Schemas: Star and Snowflake (3.11).
Master Data Management
Must-know: Master data = rarely changing, permanent, central, attribute-like data (customer, product, application). MDM unifies scattered unit data and can reveal new lines of business.
⚠️ Top pitfall: Treating loosely coupled data as master data — not every change matters; only central, rarely-changing attributes deserve master data management.
Self-check: What is master data, and what makes the mobile number a master data example?
Connects to: Categorizing Data Architectures (3.7).
Data Warehouse Fundamentals
Must-know: Data warehouse definition (Inmon/Kimball): subject-oriented, integrated, non-volatile, time-variant collection in support of management's decisions. Marts are subsets; warehouse is strategic, marts tactical.
⚠️ Top pitfall: Treating a warehouse like a transaction database — it is read-only after load and never loses history; also confusing tactical mart characteristics with the strategic warehouse.
Self-check: What do the four terms subject-oriented, integrated, non-volatile, time-variant mean?
Connects to: The Mutual Fund Warehouse Story (3.8); Warehouse Schemas: Star and Snowflake (3.11).
Warehouse Schemas: Star and Snowflake
Must-know: Fact table = quantitative measures; dimension tables = qualitative context. Star schema: denormalized flat dimensions around the fact table, fast but redundant. Snowflake: normalized multi-level sub-dimensions, efficient storage but multiple joins slow queries.
⚠️ Top pitfall: Expecting snowflake queries to match star speed — the multiple joins of the normalized snowflake are the cost of reduced redundancy.
Self-check: Why is it called a star schema, and what do you see in the snowflake schema?
Connects to: Data Warehouse Fundamentals (3.10).
ETL versus ELT
Must-know: ETL = extract, transform, load; ELT = extract, load, transform (transform in the warehouse). ELT is the modern pattern: one load, multiple transformations, flexibility, real-time dashboards; ETL can fail entirely at one point.
⚠️ Top pitfall: Designing ETL as if the warehouse cannot transform — modern columnar warehouses make loading raw data and transforming in place the faster, more flexible path.
Self-check: Why is ELT considered more powerful than ETL today?
Connects to: Data Pipelines and the Pre-Processing Workflow (3.3); Data Warehouse Fundamentals (3.10).
Course Roadmap and Hands-On Goals
Must-know: Three hands-on goals: Python data engineering, database queries building a warehouse and data mart (XAMPP, MySQL/MariaDB), best practices from experience (structured prompting). Course: 16 sessions, 4 webinars, 2 quizzes (5 marks each), 1 assignment (groups of 3-4). Quiz 1: opens 24 May, closes 28 May, no extensions.
⚠️ Top pitfall: Building an ML model on the raw warehouse instead of a clean data mart — marts provide the clean data sets that give better mining, reporting, and analytics.
Self-check: What hands-on work is expected in this course?
Connects to: Hands-On Kickoff: Google Colab and AI Assistants (3.2); Warehouse Schemas: Star and Snowflake (3.11).
Exam Guidance Summary
Must-know: Two quizzes worth 5 marks each; Quiz 1 opens 24 May, closes 28 May, no extensions. One assignment in groups of 3-4. 16 sessions, 4 webinars, 2 quizzes, 1 assignment.
⚠️ Top pitfall: Missing the Quiz 1 window — no extensions are granted.
Self-check: What is the course structure and quiz schedule?
Connects to: Course Roadmap and Hands-On Goals (3.13).
Key Industry Applications
Must-know: Garbage in, garbage out drives industry practice: about 70% of ML project time goes into data understanding and pre-processing.
Self-check: Why do data teams spend most of their time before modeling?
Connects to: Data Pipelines and the Pre-Processing Workflow (3.3); The Mutual Fund Warehouse Story (3.8).