Flexibility: schema-on-read and the data lake

After this lesson you will explain why big-data platforms apply the schema after the write instead of before it, draw the logical architecture of big data from ingestion to BI, and say what each zone of a data lake adds — and what all this flexibility costs.

Take the hospital of the most recent past paper (30 January 2026) — heating systems, floors, departments — and picture this. Two winters ago its IT team spent weeks agreeing on one table for the heaters' hourly readings: heater, time, kWh. Every reading since has been written into it, typed and checked. This morning the facility manager asks two questions: on which floors did it drop below 18 °C last winter, and did the gas heaters report errors before they broke down?

The thermostats sent the room temperature every hour; the gas heaters sent their error codes. The database holds none of it. Nothing crashed, nobody deleted anything. So where did the data go — and what would a system look like in which a question invented today can still be answered on data collected two years ago? The deck's answer fits in one word, alone on a slide. By the end of the lesson you will know where the values went, and what keeping them would have cost.

One keyword: flexibility

The deck "Towards NoSQL" opens its first section, "Towards Big Data Architectures", with a three-row comparison (p. 165). Read the rows as answers to three questions: which data, on what hardware, for what purpose.

"Big Data vs. Traditional Data" (p. 165), cell by cell. In the first row the Big Data cell shows only icons — a globe, a film strip, a hand on tiles, a bird, a magnifier; its label exists only in the slide's text layer.
TraditionalBig Data
Data Characteristics"Relational (with highly modeled schema)"icons only; text layer: "All Data (with schema agility)"
Cost"Expensive (storage and compute capacity)""Commodity (storage and compute capacity)"
Culture"Rear-view reporting (using relational algebra)""Intelligent action (using relational algebra AND ML, graph, streaming, image processing)"

Data. The traditional side admits data only after it has been modelled into tables — a "highly modeled schema" designed before the first row arrives. The big-data cell has no words, only icons — read them as web pages, video, touch screens, tweets, searches: whatever form the data happens to have. "Schema agility" is the name for being able to take it anyway.

Cost. One expensive machine against many cheap, ordinary ones, for storage and for computing alike. Why the cheap machines win beyond a certain size — the cost curves and their grey area — is the subject of lesson 3.

Culture. A report looks backwards, like a rear-view mirror: what happened last month, computed with relational algebra. "Intelligent action" acts on the data, with machine-learning models, graph algorithms, streams and image processing. Notice the capital AND: relational algebra stays in the toolbox; the new tools join it.

The next slide is a single line: "One keyword: FLEXIBILITY" (p. 166). Every row is flexibility of a kind — in the data you accept, in the way you grow, in what you do with the data. This lesson follows the first kind, and its price.

Big data trades the guarantees of a structure designed up front for flexibility: in the data it accepts, the hardware it grows on and the analyses it runs.

Schema-less or implicit schema?

Page 168 is titled "The schema-less idea", and its first line is a question: "Schema-less or implicit schema?" Look at two documents from one collection of the hospital's heating systems — an HVAC system and a gas heating system, the two children of the (T, E) hierarchy in the exam's ER diagram:

{ "Heater_Sys_ID": "HS_1",
  "Heating_Power": 150,
  "Hourly_KWh_Cons": 42.0,
  "Cost_Per_KWh": 0.25 }

{ "Heater_Sys_ID": "HS_2",
  "Heating_Power": 120,
  "Hourly_SQM_Cons": 3.5,
  "Cost_Per_SQM": 0.9 }

No table declared these fields, and the store accepted both. Yet nothing about the data is shapeless: a program that computes the cost of an hour of heating must know that an HVAC system carries Hourly_KWh_Cons and Cost_Per_KWh and a gas system Hourly_SQM_Cons and Cost_Per_SQM.

# hourly cost of a heating system,
# whatever its kind
def hourly_cost(d):
  if "Hourly_KWh_Cons" in d:
    # an HVAC system
    return (d["Hourly_KWh_Cons"]
            * d["Cost_Per_KWh"])
  if "Hourly_SQM_Cons" in d:
    # a gas heating system
    return (d["Hourly_SQM_Cons"]
            * d["Cost_Per_SQM"])
  raise ValueError("unknown kind")

For the two documents it returns 10.5 and 3.15. The if lines are a schema: they say which fields exist and what they mean. The schema has moved out of the database — where a relational DBMS would declare it and refuse every row that breaks it — into the code that reads the data. That is the answer to the slide's question.

Implicit schema — the structure that the programs writing and reading the data assume when the database itself neither declares nor enforces one. "Schema-less" means "no schema enforced by the DBMS", not "no structure".

The slide then sorts the non-relational models by what they treat as the unit of data (Fig. 1):

The reference at the bottom of the slide, "Domain-Driven Design, by Eric Evans", is the book that named the aggregate.

hospitals { Hospital_ID: "HOSP_1", Name: "City Care", buildings: [ {Building_ID: "B1", Year: 1967}, {Building_ID: "B2", Year: 2004} ], departments: [ {Specialty: "cardiology"}, {Specialty: "neurology"} ] }

Aggregate-based: one hospital, one unit

F2 F3 HS_2 D1 :Floor :Floor :HeatingSystem :Department :HEATS :PLACED_INTO two hops

Relationship-based: the links are the data

Fig. 1. The same hospital seen the two ways of p. 168. Left: an aggregate — the hospital with its buildings and departments, stored, read and moved as one unit; a key-value store would keep it as an opaque value under the key HOSP_1, a document store can look inside. Right: heating system HS_2 heats floors F2 and F3, on which department D1 (cardiology) is placed. "Which departments does HS_2 heat?" walks two stored relationships (orange) instead of joining tables.

This split is the first thing that the one-point question of five past papers, "Which DB technology would be the best to store the entities/rel. of the ER diagram?", asks of you: which parts of a diagram are aggregates, read as a unit, and which are webs of relationships. Lesson 5 completes the list of database types; the last exam question below is a first try.

The schema moves after the write

The hospital of the hook ran the traditional pipeline. Pages 169–170 set it next to the new one under the title "Paradigmatic shift introduce by Big Data", and redrawn side by side the two stacks make their point by position alone.

Analyse Analyse […] Analyse Write Data Apply Complex Schema Collect Data

Before: schema on write (p. 169)

Analyse Analyse […] Analyse Apply Simple Schema Apply Simple Schema […] Apply Simple Schema Write Data Collect Data

After: schema on read (p. 170)

Fig. 2. The slides' two stacks, read bottom to top as steps in time. The violet blocks are the schema, the blue band is the write. On the left one complex schema stands between collecting and writing, and every analysis must live with it. On the right the write comes straight after the collection, and each analysis brings its own simple schema. The data is the same; the schema moved above the write.

Schema on write (p. 169): collect, apply a complex schema, write, analyse. The schema comes first, so it has to be designed before anybody knows all the questions — the slide's "Long lasting discussion about the schema that can accommodate all needs". Whatever the finished schema has no place for is dropped or refused on the way in, and the second bullet follows from the order of the steps: "Some analysis can no longer be performed because the data were lost at writing time". That is where the room temperatures went.

Schema on read (p. 170): collect, write, and only then — separately for every analysis — apply a simple schema and analyse. The slide says it in three lines: "Load data first, ask question later"; "All data are kept, the minimal schema need for an analysis is applied when needed"; "New analyses can be introduced in any point in time". The data-wrangling deck puts it in one sentence: "In schema on read, data is applied to a plan or schema as it is pulled out of a stored location, rather than as it goes in", right after "Today data modeling at design time is a luxury" (p. 1142, lesson 37).

You have met this move before, at the level of method: one of the four paradigmatic shifts of lesson 2 sets "Carefully cleanse information Before any analysis" against "Analyze information as is, Cleanse as needed" (p. 27). Schema on read is the same shift applied to the data model.

Both ideas have a twin you already know. In statistics, keeping only the sample means you planned is schema on write; keeping the raw observations is schema on read, the only way to compute a statistic nobody thought of at collection time. And Python checks a type when the line runs, not before — Kleppmann compares schema on read to exactly this dynamic type checking (background, not slides).

Schema switch: where the schema sits decides what survives

Eight readings from the hospital's heaters arrive one by one: press Next. Choose where the schema is applied — before the write, as the table Reading(heater, time, kwh) declared in advance, or after it, as a small schema per analysis over a raw landing zone — and choose an analysis that someone asks for later. Before the write, a loader copies each reading's heater, time and kwh into the table and drops every other field; a kwh that is not a number gets the whole reading refused.

  1. Keep schema on write and choose the analysis gas used per heater. Before pressing Next, predict: once all eight readings are written, will this analysis be possible? Then step to the end and watch the red bin.
    What you should see

    No. sqm is not a column of the table, so R2, R5 and R8 lose their sqm on the way in (3.2, 3.6, 3.9) and the analysis reports Impossible. At the end 13 of the 31 values that arrived are in the bin — "the data were lost at writing time" (p. 169). Where the schema block sits decides what survives.

  2. Now switch to schema on read and change nothing else. Predict the gas total before you look.
    What you should see

    All 31 values sit in the landing zone exactly as they came, and the bin is gone. The analysis applies its own small schema {heater, sqm: number} at read time and finds HS_2: 10.7 SQM (3.2 + 3.6 + 3.9). Nothing about the data changed — only the position of the schema in the pipeline.

  3. Choose energy per heater (kWh) and compare the two modes at reading R6. Who notices that its kwh is "n/a", and when?
    What you should see

    In schema on write the typing check refuses R6 at the write: the table stays clean, and the totals are HS_1 80.5, HS_3 44.1, HS_4 40.2 kWh. In schema on read R6 is written as it came; the analysis meets it at read time and has to skip it ("1 unreadable") — same totals, but the check moved from the database into the reader. That is the price of flexibility.

  4. Stay in schema on read and choose cold readings — the facility manager's question from the hook. Which of the cold readings could schema on write never have saved, even with a room_temp column?
    What you should see

    Two cold readings: HS_3 at 09:00 (17.6) and HS_4 at 09:00 (16.9). The first comes from R6, the record that schema on write refused for its bad kwh — it took a perfectly good room temperature with it. A new analysis can be introduced at any point in time only because the raw records were kept whole.

What is gained, what is paid

Nothing is lost at writing time: every field of every record is kept.

New analyses at any time, each with its own minimal schema.

No "long lasting discussion" before the first byte is stored, and faster writes, since nothing is checked (course notes, §3.1.2).

The guarantees of the relational schema — "Typing", "Coherence", "Uniformity" (p. 144, lesson 3) — are no longer checked at the write.

Bad values are found late, by every reader that meets them.

Every analysis re-interprets the raw data: the schema is written many times, and two readers may assume different ones.

"Schema on read means there is no schema." There is one per analysis, applied when the data is read — the small {heater, sqm: number} of the gas analysis in the widget. What disappears is the single schema imposed on everything at write time.

Schema on write decides at design time what will survive; schema on read keeps everything and lets each analysis bring its own schema.

The logical architecture of big data

Page 171, "Logical Architecture of Big Data", turns the principle into a platform. Follow one thermostat reading of the hospital through it, from the bottom up.

  1. Data Ingestion. The reading arrives with thousands of others and is imported, transferred and loaded — "The process of importing, transferring and loading data for storage and later use" (p. 159, lesson 3).

  2. Raw Big Data Landing Zone — "Any data, any form, many schemata (if any) (e.g., csv, json, txt, …)". The JSON is written as it came, room_temp and all. This is the write of schema on read: nothing is dropped.

  3. Data Wrangling — "understanding, cleansing, augmenting and shaping data" (p. 160). Here the "n/a" values are found and a format is chosen; the method itself fills lessons 35–37.

  4. Big Data Long Term Storage — "Data format optimized for querying, but without an integrated schema (e.g., ORC, parquet)". The readings are rewritten in a columnar file format: fast to scan, still not bound to the schema of any one analysis.

  5. ETLs #1 … #n. For the facility manager's question an ETL extracts floor, time and room temperature, transforms them into the schema that fits the analysis and loads them. This is the point where a schema is applied — one per purpose.

  6. Data View #1 … #n, and on top the consumers: BI dashboards ("BI #1.a", "BI #1.b" …) or "<<anything>> e.g., algorithm for process optimization" — say, a model that schedules the heaters.

BI #1.a BI #1.b BI #2.a BI #2.b <<anything>> Data View #1 Data View #2 […] Data View #n ETLs #1 ETLs #2 ETLs #n Big Data Long Term Storage Data format optimized for querying, but without an integrated schema (e.g., ORC, parquet) Data Wrangling Raw Big Data Landing Zone Any data, any form, many schemata (if any) (e.g., csv, json, txt, …) Data Ingestion flows up schema applied here, once per data view stored without an integrated schema
Fig. 3. The slide's layers redrawn (p. 171); the slide's example for the last consumer is "e.g., algorithm for process optimization". Below the ETLs (violet) nothing has an integrated schema; the schema enters at the ETL of each data view, separately for each — schema on read built into a platform.

Two things in the picture deserve a second look. Nothing below the ETLs carries an integrated schema: the landing zone takes "any data, any form", and even the long-term storage keeps the data free of the schema of any particular use. And "ORC, parquet" are columnar file formats: a file stores the values of each column together, block by block, so a job that needs three columns reads only those three — the "best format (e.g., columnar)" that the wrangling slide asks for (p. 160). Lesson 40 opens such a file.

ETL, and virtual ETL

The arrows "ETLs #i" have a slide of their own, "Extract Transform Load (in the Big Data era)" (p. 175): "The process that extracts data from heterogeneous data sources, transforms it in the schema that better fits the analysis to perform and loads it in the system that will perform the analysis." The slide then draws it twice.

Query target ETL clock source #1 source #2 […] source #n a copy

ETL: scheduled, into a target

Query Virtual ETL source #1 source #2 […] source #n on demand

Virtual ETL: on demand, no target

Fig. 4. The two drawings of p. 175. Orange arrows carry requests, blue ones data; a dashed blue arrow is data coming back to a request (the slide draws these links as two-way arrows). Left: a clock starts the ETL, which pulls from the sources and loads a target; the query asks the target. Right: no clock and no target — each query goes through the virtual ETL down to the sources, and the data comes back the same way.

The slide shows only the pictures; the standard reading of them is a trade-off. The classic ETL, run every night say, gives fast queries on a materialised copy — but the data is only as fresh as the last run, and the copy has to be stored. The virtual ETL keeps no copy and is always fresh, but every query pays for the extraction and loads the sources. The slides do not say which kind feeds the data views of p. 171: a view that is stored and refreshed needs a classic ETL, a view computed when it is queried a virtual one. The target of a classic ETL is typically a data warehouse — lesson 23.

The data lake and its zones

The next slide names the store in which all this raw data collects: "The Concept of Data Lake" (p. 172), an infographic built as a water cycle: "The concept can be compared to a water body, a lake, where water flows in, filling up a reservoir and flows out." Its four numbered circles:

  1. "The incoming flow represents multiple raw data archives ranging from emails, spreadsheets, social media content, etc."
  2. "The reservoir of water is a dataset, where you run analytics on all the data."
  3. "The outflow of water is the analyzed data."
  4. "Through this process, you are able to "sift" through all the data quickly to gain key business insights."

Around the lake the slide lists both inflows: STRUCTURED DATA, "Information in rows and columns", and UNSTRUCTURED DATA — "Raw, unorganized data", emails, PDF files, images, video and audio, social media. The course notes (§3.1.3) add why one lake is better than many: the organisation gets "only one centralized data source for all its analytical needs, as opposed to silos based approaches" — not a database per department, each with its own schema and its own copy.

Data lake — one centralised reservoir that receives structured and unstructured data in raw form, and on which all the analytical jobs run; the schema is applied when the data is read.

The word comes from a blog post. On 14 October 2010 James Dixon, then CTO of Pentaho, wrote that a data mart is "a store of bottled water", "cleansed and packaged and structured for easy consumption", while a data lake is "a large body of water in a more natural state". Background from the resources, not from the slides.

A lake of raw files has an obvious way to fail, and the notes name it: "it's important to organize and index well all the incoming data, or we could end up with a huge Data Swamp where it's impossible for everyone to find what they're looking for". They give the remedy in the next sentence: the incoming raw data "gets incrementally refined and enriched in order to improve accessibility, by adding metadata and indexing tags and by performing quality checks". The next slide, "Data Lakes in Process" (p. 173), draws that refinement as four zones.

On its left the slide shows where data comes from — STREAMING, FILE DATA, RELATIONAL — and on its right who uses it, the CONSUMER SYSTEMS: "Data Catalog, Data Prep Tools, Data Visualization, External Connectors". Try the zones on three of the hospital's files.

Through the zones of a data lake

Three files from the hospital, one per kind of source on p. 173. Tap a file and then a zone, or drag the file onto the zone; with a file focused, the keys 1–4 send it to a zone and → moves it one zone on. Each zone stamps the file with what it adds (green); a zone you skip leaves a dashed red stamp. The consumer systems underneath report what they can do with the lake you built.

  1. Select heater_readings.csv and move it one zone on, into the transient zone. Predict first: which consumer system starts working, and why?
    What you should see

    The Data Catalog. The transient zone is "Ingest, Tag, & Catalog Data", so the file now carries tags and a catalogue entry, and the catalog finds 1 of 1 files. The dashboard still says the readings are not refined yet: one zone adds one thing.

  2. Now drag staff_roles — from the relational source, with e-mail addresses — straight into the refined zone, skipping the other three. Predict what the consumer systems will report.
    What you should see

    It arrives enriched but with three dashed red stamps: no catalog entry, Email in clear, no validation. The Data Catalog cannot see it (with the CSV of the first task in the transient zone, it finds 1 of 2 files), External Connectors would ship the e-mails in clear, and the verdict turns to swamp: a file sits in the lake that nobody can find.

  3. Press Start over, then Send every file straight to the refined zone. Then start over again and move every file through all four zones, one zone at a time. Compare the two verdicts.
    What you should see

    The shortcut gives three files that nobody can find (the catalog finds 0 of 3), e-mails in clear, and a kWh-per-floor dashboard that looks fine but contains the two readings with kwh = -1 — the swamp, "impossible for everyone to find what they're looking for". Zone by zone, the same three files end findable, protected, validated and enriched: "a well-kept lake". The files are identical; only the zones they went through differ. That is the insight: the zones, not the storage, make a lake a lake.

Put p. 171 and p. 173 side by side and they tell one story: the transient and raw zones do their work where the landing zone of p. 171 sits, wrangling produces trusted data, and the ETLs and data views draw on refined data. The slides do not draw this link; it is a reading that ties an answer together.

"A data lake is a data warehouse with more data." A warehouse is the schema-on-write side: data modelled, cleaned and integrated before it is loaded, for reporting (lesson 23). A lake is schema on read: raw data first, structure per analysis. The data views of p. 171 are warehouse-like products built from the lake.

Objects against tables — and the hospital's answer

The deck adds one more motivation, from the programmer's side: "Another issue: ORM" (p. 174), with three bullets — "Impedance Mismatch", "Object-Relational Mapping problem (and solution)", "Object Orientation (OODB)" — and under the last one, "Commercial failure!".

Concretely: in a program, a department of the hospital is one object, with its specialty, the list of floors it occupies and the list of people who work for it, each with a role. In a relational database the same department is spread over three tables — Department, Placed_Into and Works_For — rebuilt with joins at every read and taken apart into rows at every write.

D1 : Department specialty = "cardiology" floors staff F2 F3 P_7 · nurse P_9 · maintenance nested, with references

In the program: one object

Department Placed_Into Works_For id specialty D1 cardiology dept floor D1 F2 D1 F3 dept person role D1 P_7 nurse D1 P_9 maintenance flat rows, joined by keys

In the database: three tables

Fig. 5. The impedance mismatch of p. 174 on department D1. The program holds one object with nested lists; the database holds three flat tables linked by the key D1 (dashed). Every read joins them back into the object, every write takes the object apart — the translation an ORM framework automates. The MongoDB deck draws the same picture with an order and its line items (p. 291).

That translation is the impedance mismatch: the program thinks in nested objects with references, the database in flat rows linked by keys. Object-relational mapping (ORM) frameworks are the "solution" in brackets: they generate most of the translation code — but the two shapes stay different. Object-oriented databases tried to remove the mismatch by storing the objects themselves; the slide's verdict is the sub-bullet, "Commercial failure!".

Document stores attack the same problem from the data side: a document has the shape of the object. The MongoDB deck lists "Solves Impedance Mismatch problem" among the reasons for going document-based, next to "Handles Schema Changes Well (easy development)" (p. 291, lesson 13). Flexibility again — this time for the programmer.

The hospital's question, answered

Now the hook. The room temperatures were not deleted: they were never written. The heater table was schema on write — its schema stood between the collection and the write, and every field outside heater, time and kWh was dropped by design; "the data were lost at writing time" (p. 169). In the widget, the reading whose kwh was "n/a" even took a good room temperature with it when the typing check refused it.

A schema-on-read platform would have written the thermostat JSON into the landing zone as it came, and today's question would bring its own small schema — floor, time, room temperature — to two-year-old data: "Load data first, ask question later" (p. 170). The price would have been paid elsewhere. Someone had to tag and catalogue those files in the transient zone, or the lake would be a swamp in which nobody could find them today; and the analysis itself must cope with values like "n/a" that no DBMS refused at the write. Flexibility is not free: it moves the work from the writer to the reader.

Exam-style questions

Theory questions in the form of the written exam — short open answers, multiple-choice and true/false questions, where wrong answers may be penalised (that is announced just before the exam) — and one exercise in the form of the papers' one-point table.

Describe the paradigmatic shift from schema on write to schema on read introduced by Big Data. Explain the two pipelines and give one advantage and one disadvantage of schema on read.

Show model answer

In schema on write, the traditional approach, data is collected, a complex schema is applied, and only then the data is written and analysed. The schema must be designed in advance, after a long discussion, to accommodate all needs; whatever does not fit is dropped or refused when it is written, so some analyses can no longer be performed later because the data were lost at writing time. In schema on read, data is collected and written as it is, and each analysis applies, when needed, the minimal simple schema it requires: load data first, ask questions later. Advantage: all data is kept, so new analyses can be introduced at any point in time (and writes are fast, since nothing is checked). Disadvantage: nothing is checked at write time — typing and coherence are no longer enforced by the DBMS, errors are discovered late by every reader, and each analysis must interpret the raw data itself; without metadata and organisation the data lake can turn into a data swamp.

A complete answer gets three things right: the order of the steps in both pipelines — the position of the schema relative to the write — the slides' two consequences (data lost at writing time against new analyses at any time), and one real cost of schema on read. Writing "schema on read means no schema" contradicts the slides.

True or false: in a "schema-less" NoSQL database the stored data has no schema.

  • True The data still has a structure, which the applications that read and write it assume: an implicit schema.
  • False Schema-less means that the DBMS does not declare and enforce a schema; the schema is implicit, in the code that reads and writes the data.
Show model answer

False. The data always has a structure, but in a schema-less store it is not declared to and enforced by the database: it is an implicit schema, assumed by the applications that write and read the data, and with schema on read it is applied when the data is read.

The slide itself asks "Schema-less or implicit schema?" (p. 168). In an open variant of the question, "implicit schema" is the phrase to write.

Consider the hospital heating management system of the exam of 30 January 2026 (Hospital, Building, Floor, Department, Person, Heating System with its children HVAC System and Gas Heating System). The hospital wants to keep its heater readings (CSV), thermostat events (JSON) and maintenance reports (PDF) for analyses that are not known yet. Describe the logical architecture of big data presented in the lecture, from ingestion to the consumers, saying what each layer would hold for this hospital and at which point a schema is applied.

Show model answer

Data ingestion imports, transfers and loads the readings, the thermostat events and the reports from their sources. The raw big data landing zone keeps any data in any form, with many schemata if any — here the CSV, JSON and PDF files exactly as they arrive. Data wrangling understands, cleanses, augments and shapes the raw data, for example removing invalid readings. The big data long-term storage keeps the wrangled data in a format optimised for querying but without an integrated schema, such as ORC or Parquet columnar files. On top of it, one ETL per purpose extracts the data it needs, transforms it into the schema that fits the analysis and loads it into a data view — for example a view of kWh per floor and day. The consumers of the data views are BI dashboards or any other application, such as an algorithm that optimises the heating schedule. The schema that fits an analysis is applied only at the ETL step, separately for each data view: this is schema on read.

Get the layers in the right order first; the sentence on where the schema enters shows why the architecture is built this way. The hospital examples are ours: the slide gives only csv, json, txt and ORC, parquet. A variant asks for the ETL of p. 175: learn its definition word for word — it "extracts data from heterogeneous data sources, transforms it in the schema that better fits the analysis to perform and loads it in the system that will perform the analysis" — and the contrast with a virtual ETL, which keeps no target and integrates the sources when a query arrives.

Which statements about data lakes are correct, according to the lecture? Select all that apply.

  • Data must be cleaned and modelled into one integrated schema before it is loaded into the lake. That is schema on write, the way of a data warehouse. A lake loads raw data and applies the schema when the data is read.
  • A data lake is a single reservoir that receives structured and unstructured raw data, on which analytics are run on all the data. The water-body picture of p. 172: inflow of raw data archives, a reservoir where you run analytics on all the data, outflow of analysed data.
  • The transient zone is where data is enriched and workflows are automated. The transient zone ingests, tags and catalogs; enrichment and automated workflows belong to the refined zone.
  • In the trusted zone, data quality checks and validation are applied. p. 173: TRUSTED ZONE — "Data quality & Validation".
  • Without organisation, metadata and indexing, a data lake can turn into a "data swamp". Course notes, §3.1.3: a huge Data Swamp "where it's impossible for everyone to find what they're looking for".
Show model answer

The second, fourth and fifth statements. The zones, in order: transient (ingest, tag and catalog data), raw (apply metadata, protect sensitive attributes), trusted (data quality and validation), refined (enrich data and automate workflows).

Wrong answers may be penalised, so a zone matched to the wrong task costs you: learn the four zones as a sequence, each with what it does.

What is the impedance mismatch? Explain how object-relational mapping and object-oriented databases relate to it.

Show model answer

The impedance mismatch is the difference between the data structures of application code — objects, nested and connected by references — and those of a relational database — flat tables whose rows are linked by keys. Every read must join tables to rebuild an object, and every write must take the object apart into rows. Object-relational mapping (ORM) frameworks automate this translation layer: they reduce the hand-written code but do not remove the mismatch. Object-oriented databases (OODB) tried to remove it by storing the objects directly, but they were a commercial failure. Document databases address it from the data side, because a document has the nested structure of the object.

A complete answer has the three items of the slide: the definition, ORM as the translation layer (its "problem (and solution)"), and the commercial failure of OODBs. The last sentence connects to the MongoDB deck (p. 291).

In the form of Exercise 1, "Unstructured data models (1 PT)", of five past papers (6 June 2024 to 13 June 2025), on the ER diagram of the exam of 30 January 2026 (a hospital heating management system; that paper itself has no such exercise). Entities: Hospital (Hospital_ID, Name), Building (Building_ID, Name, Year), Floor (Floor_ID, Number, Has_Elevator), Department (Department_ID, Specialty, N_Beds, Head_Physician_ID), Person (P_ID, Email), Heating System (Heater_Sys_ID, Heating_Power) with the children HVAC System (Hourly_KWh_Cons, Cost_Per_KWh) and Gas Heating System (Hourly_SQM_Cons, Cost_Per_SQM), ISA (T, E). Relationships, with the cardinalities as printed on the paper: Has H. Sys. (Hospital 1:N, Heating System 1:1), Has Building (Hospital 1:N, Building 1:1), Has Dept. (Hospital 1:N, Department 1:1), Has Floor (Building 1:N, Floor 1:1), Placed Into (Department 1:N, Floor 1:N), Heats (Heating System 1:N, Floor 1:N; Start_Time, End_Time), Works For (Department 1:N, Person 1:N; Role).

Which DB technology would be the best to store the entities/rel. of the ER diagram? [you may not need all the rows of the table] (1 PT) — ENTITIES / REL. | DB TYPE | MOTIVATION

Show model answer
ENTITIES / REL.DB TYPEMOTIVATION
Heating System (with HVAC System and Gas Heating System), Floor, Building, Department; Heats, Placed Into, Has FloorGraph DB (Neo4j) — relationship-basedMany-to-many relationships with attributes (Heats: Start_Time, End_Time) and questions that walk several of them, e.g. departments occupying more than two floors of the same building and the power of the heaters of those floors: each hop follows a stored relationship instead of a join. The two children become nodes with an extra label and their own properties.
Hospital with Building and Department, Person; Has Building, Has Dept., Works ForDocument DB (MongoDB) — aggregate-basedA hospital is read together with its buildings and departments: one aggregate, with nested sub-documents (the people of a department with their role). Queries count inside the aggregate, e.g. hospitals with more than 10 buildings or departments with more than 25 people, with no join and no $lookup.

The split follows the paper's own exercises: its Neo4j exercise uses Heating System, Floor, Building and Department, its MongoDB exercise Hospital, Building, Department and Person — so Building and Department appear in both rows. The real table also admits key-value, columnar and search-based rows; lesson 5 completes the list. Here the point is the split of p. 168: aggregates for what is read as one unit, a graph for webs of relationships.

Check yourself

In the schema-switch widget, in schema-on-write mode, reading R7 arrives with heater, time, kwh, room_temp and floor. What does the database end up holding for R7?

  • The whole record, with room_temp and floor in two new columns Adding columns means changing the schema — exactly the "long lasting discussion" that schema on write settles once, before the data arrives.
  • A row with heater, time and kwh; room_temp and floor are dropped The declared schema decides at the write what survives: the three columns are kept, the rest is lost at writing time.
  • Nothing: the record is refused because it has extra fields In the widget only a value that breaks a declared type (R6's "n/a") gets a reading refused; the loader simply does not copy the fields that have no column.
  • Everything, because no analysis has been chosen yet In schema on write the analysis plays no part at the write: the declared schema alone decides.

Which of these are costs of moving the schema from the write to the read? Select all that apply.

  • Some analyses can no longer be performed because data was lost at writing time That is the cost of schema on write (p. 169), the very thing schema on read avoids.
  • A value of the wrong type is discovered only when an analysis reads it R6's "n/a" in the widget: refused at the write in one mode, skipped by the reader in the other.
  • Writes become slower, because the database checks every field The opposite: nothing is checked at the write, so writes get faster (course notes, §3.1.2).
  • Every analysis must interpret the raw records itself, and two analyses may assume different structures The schema is now written once per analysis — an implicit schema in each reader.
  • Without tags, metadata and a catalogue, the stored raw files become hard to find The data swamp of the course notes, and the reason for the zones of p. 173.

Why is "Apply Complex Schema" drawn below "Write Data" on p. 169, while "Apply Simple Schema" is drawn above it on p. 170?

  • Complex schemas need more storage, so they sit lower The drawing is a pipeline, not a storage diagram.
  • In schema on read the database applies the schema during the write In schema on read nothing is applied at the write; each analysis applies its schema when it reads.
  • The stacks are steps in time, read bottom to top: the schema comes before the write in one, after it in the other Position is the message: the schema block moved above the write.
  • The two pictures show the same pipeline at two scales They are two different pipelines: the order of the steps differs.

A shop stores each order with its order lines and shipping address, always read and written as one unit. It also wants "customers who bought this also bought" over chains of four purchases. Following p. 168, which pairing fits?

  • Both relationship-based, because "Graph DBs are better than relational!" The slide's exclamation is not a rule: an order read as a unit has no hop to save, and a graph would split it into many nodes.
  • Orders: aggregate-based (document or key-value); purchase chains: relationship-based (graph) The order is an aggregate read as one unit; the recommendation walks a web of relationships, one hop per purchase.
  • Orders: graph; purchase chains: key-value Backwards: a key-value store fetches a value by its key and cannot follow chains of relationships.
  • Both aggregate-based, because aggregates are easier to distribute Easier to distribute, yes; but a four-hop chain across aggregates becomes lookups that the application has to stitch together.

A file with staff e-mail addresses goes straight from its relational source into the refined zone, skipping the transient, raw and trusted zones. Which problem comes from skipping the raw zone in particular?

  • Nobody can find the file in the Data Catalog True, but that comes from skipping the transient zone: "Ingest, Tag, & Catalog Data".
  • Nobody has checked that the values make sense True too, but that is the trusted zone: "Data quality & Validation".
  • The file is not enriched The file did enter the refined zone, which enriches it.
  • The e-mail addresses are not masked, so External Connectors would ship them in clear Raw zone: "Apply Metadata, Protect Sensitive Attributes".

A dashboard must show the heating of the last minute, read from three operational systems that change all the time; it is opened a few times a day. Which kind of ETL from p. 175 fits better?

  • Classic ETL started by a nightly clock The target would be up to a day old; the dashboard needs the last minute.
  • Virtual ETL: integrate when the query arrives, keep no copy Few queries and data that must be current: paying the extraction at each query is cheap, while any stored copy would already be stale.
  • No ETL: let the dashboard read the raw landing zone directly The dashboard needs the data in the schema that fits it; that transformation is exactly what an ETL, classic or virtual, does.

On p. 165 the Culture row reads "Intelligent action (using relational algebra AND ML, graph, streaming, image processing)". What does the capitalised AND tell you?

  • Relational algebra is replaced by machine learning Then the row would not mention relational algebra at all.
  • Every analysis must use all five techniques at once AND lists the toolbox, not a requirement for each analysis.
  • Relational processing stays and is extended by other kinds of analysis Big data adds ML, graph, streaming and image processing to relational algebra; it does not throw it away.

Key take-aways

What to watch and read