Data Lakes and Lakehouses
What Is a Data Lake?
A maintenance team has sensor readings, repair notes and photographs of damaged pumps. They do not all have the same structure, and different programs need to use them. A data lake is a way of keeping datasets such as these in shared storage, often cloud object storage, without first converting everything into the same set of database tables.
The storage still contains actual files with names and formats. Calling it a lake does not decide which readings are valid, which files make up a published table or who may read them. We will work through those distinctions before Botie opens a second batch of readings.
This local model receives decoded Python-like records and already reconstructed manifests. It does not access storage, replay a Delta transaction log or implement the real table format’s transaction and failure guarantees.
Step 1 of 1
A stored file and a published table are different things
These invented object keys all exist in storage. Version 0 names only batch-0.parquet.
| Object key | Contains | In version 0? |
|---|---|---|
| readings/batch-0.parquet | P7: 12 °C; P2: 18 °C | Yes |
| readings/batch-1.parquet | P9: 27 °C | No; not committed to this version |
readings/batch-0.parquet
- Contains
- P7: 12 °C; P2: 18 °C
- In version 0?
- Yes
readings/batch-1.parquet
- Contains
- P9: 27 °C
- In version 0?
- No; not committed to this version
Files, object keys and shared storage
The active file list is chosen before the records are read. Adding an unrelated stored file cannot change an earlier committed result.
Why Storing the Files Was Not Enough
BOTIE
The lakehouse architecture described in the 2021 CIDR paper brought table-management capabilities to data held in open file formats. The aim was to support analytical tables and other data work without always maintaining separate copies in a lake and a warehouse. This is an architectural approach, not a rule that every warehouse or lake must behave the same way.
Delta Lake addresses part of that reliability problem by recording committed table changes. A reader determines which data belongs to a table version from that recorded state. A file can therefore exist in storage without belonging to the version being read. Our workshop isolates that distinction with an already reconstructed file list; it does not implement Delta transactions.
Read the files belonging to this table version
Botie can read the first batch. A second file now exists, but the producer has not committed it to the requested table version.
BOTIE
Records from the requested committed file list
- pump
- P7
- temperature_c
- 12
- pump
- P2
- temperature_c
- 18
| pump | temperature_c |
|---|---|
| P7 | 12 |
| P2 | 18 |
Follow the operations
1. Retained committed file lists
- version
- 0
- files
- ["readings/batch-0.parquet"]
version files 0 ["readings/batch-0.parquet"] 2. Requested version number
0
3. Select a committed file list
- 0readings/batch-0.parquet
4. Stored files with decoded records
[ { "key": "readings/batch-0.parquet", "rows": [ { "pump": "P7", "temperature_c": 12 }, { "pump": "P2", "temperature_c": 18 } ] } ]5. Read only the named files
- pump
- P7
- temperature_c
- 12
- pump
- P2
- temperature_c
- 18
pump temperature_c P7 12 P2 18 6. Result
- pump
- P7
- temperature_c
- 12
- pump
- P2
- temperature_c
- 18
pump temperature_c P7 12 P2 18
This local model receives decoded Python-like records and already reconstructed manifests. It does not access storage, replay a Delta transaction log or implement the real table format’s transaction and failure guarantees.
1. Files, object keys and shared storage
A file contains bytes. A reader needs to know their format before it can turn those bytes into records. Cloud object storage keeps each object under a key, which identifies it within a container such as an Amazon S3 bucket.
For our team, readings/batch-0.parquet is an object key. The slashes help organize related names. In a general-purpose S3 bucket, a folder display is based on key prefixes rather than the same directory structure a local filesystem provides. The object store can keep the file without understanding that P7 is a pump.
Storage is where the bytes persist. Compute is the processing that reads and changes them. Stopping a notebook’s compute does not, by itself, mean the stored files should disappear.
Keep the object key beside the file contents in the small Python model. The key identifies the file; it does not describe the meaning of its rows.
Inspect one stored file record
The dictionary represents a file already decoded for this exercise. rows contains the pump records; this is not the binary content of a real Parquet file.
file = {"key": "readings/batch-0.parquet", "rows": [{"pump": "P7", "temperature_c": 12}]}
print(file["key"])
print(file["rows"][0]["pump"])readings/batch-0.parquet
P7A real storage client retrieves bytes and a format reader decodes them. The local exercise supplies the decoded records so we can focus on choosing the correct files.
2. CSV and Parquet organize the same values differently
A CSV file stores text records, with a delimiter separating fields. A header can name pump and temperature_c, but a reader still needs rules for interpreting missing values and numerical types. A comma inside a field also needs the format’s quoting rules.
Parquet is a binary, column-oriented file format. It divides records into portions called row groups. Within each group, the values of each column are stored together in a column chunk. The file also records a schema, describing the fields and their data types.
A query that needs only temperatures may be able to read less data than one that needs every column. Keeping similar values together also helps compression. The exact saving depends on the files and the query; column storage does not guarantee every operation will be faster.
These formats describe how values are stored, not whether the values are trustworthy. A well-formed numerical temperature can still use the wrong unit or come from a broken sensor. Our workshop labels files .parquet but receives Python dictionaries that have already been decoded.
CSV illustration:
pump,temperature_c
P7,12
P2,18The two observations keep their row relationships whichever format stores them. Choosing a column does not give permission to reorder its values independently of the pump identifiers.
Check yourself
Questions on Parts 1 to 2
Question 1 of 2
Which description fits a data lake?
Question data
The maintenance team stores a CSV of readings and photographs of damaged pumps in shared object storage.3. A lake and a warehouse describe different storage arrangements
The team can retain original readings and photographs in a lake, then run different programs over them. A warehouse focuses on managed analytical tables and queries, often after records have been prepared for reporting. These are useful starting distinctions; modern products have overlapping capabilities.
A lakehouse applies table-management and analytical-query capabilities to lake storage, commonly using open table formats. Delta Lake is one such table format. It adds information and rules around data files so compatible engines can treat a changing collection as a table. It is not another name for Databricks or for the object store.
Databricks provides services for working with these stored datasets. The platform can manage table storage and its maintenance, while Spark and other supported compute perform calculations. Storing files, describing a table and running a query are related responsibilities with different jobs.
Ask what each layer is doing. A file format explains bytes; a table format explains table state; a computation engine executes work against that state.
4. Publish a complete version before readers use it
Suppose the first batch is ready and a second file is still being prepared. A program that reads every matching filename can include the second file simply because it exists. That does not establish that the producer has published it as part of this table.
We need an agreed state that says which files a reader should use. In our model, a manifest is a record containing a version number and its complete active file list. Version 0 names batch-0.parquet. A later version may also name batch-1.parquet. The reader asks for a version before opening any of its files.
The manifest has names of files, not copies of their rows. An empty file list is a valid empty table in this exercise. A missing version is a failed read, not permission to substitute whichever files happen to be available.
version 0: ["readings/batch-0.parquet"]
version 1: ["readings/batch-0.parquet", "readings/batch-1.parquet"]The same stored objects can support more than one table version. The reader must know which version it was asked to use.
5. How Delta keeps track of table changes
Delta records committed table changes in a transaction log. A transaction groups changes into one update. Atomic publication means that a reader sees the completed update or the earlier state, rather than half of the update. From the recorded state, a compatible reader identifies the data files active in the requested version.
In a file-based Delta table, the _delta_log directory holds transaction information and checkpoints used to reconstruct that state. It is not a second copy of every measurement. A correction can replace an old data file with a new one in a later version. Both files may remain in storage for a time, while each version selects its own active files. Reading all Parquet files directly would bypass that choice and can include superseded or uncommitted data.
Our manifests are already reconstructed file lists, not literal Delta log entries. Real Delta readers also handle table metadata, supported protocol features and concurrency rules. We do not reproduce those responsibilities by reading a list of filenames.
version 0 active files: ["readings/batch-0.parquet"]
version 2 active files: ["readings/corrected-0.parquet", "readings/batch-1.parquet"]A recorded remove means a file stops contributing to that table state. It does not necessarily mean its physical bytes are deleted at that moment.
6. Schema tells us the structure, while a contract explains the meaning
A schema describes fields and their data types. For example, pump is text and temperature_c is numerical. A table can use that information to reject incompatible writes.
The maintenance team still has to explain which pump an identifier belongs to, whether a reading is Celsius and how a missing reading is represented. Those meanings need a data contract and checks appropriate to the source. A number does not become a good training value merely because it fits a numerical column.
Converting the files to Delta does not decide those policies. The later cleaning and quality lessons will make explicit choices about invalid values. Here, we keep the supplied records intact so that file selection is the only operation being tested.
A table with a consistent schema can still contain the wrong observations. Inspect structure and meaning separately.
7. Read a table version through its table interface
A registered table name lets a program ask for the dataset without manually listing its data files. Databricks connects that name to table metadata and storage. We will unpack catalog.schema.table in the upcoming table-names lesson.
The optional reference requests a retained Delta version by name. The format reader is responsible for interpreting the table state. A bounded display is enough to inspect the example; collecting a complete production dataset into one notebook would be a different operation.
Use the table interface for the table read. Do not treat a directory scan as a replacement for a Delta reader.
Run in your own environment
Read an existing retained Delta version
This optional reference uses your own configured Databricks environment. The browser challenge uses local Python data and does not contact a cloud service.
Use your own Databricks notebook with supported Spark compute and access to an existing Delta table operations.maintenance.readings.
The table must have pump and temperature_c columns and a retained readable version 0. Replace the example name and version with an approved dataset. The code performs a read and can incur compute charges.
snapshot = (spark.read
.option("versionAsOf", 0)
.table("operations.maintenance.readings"))
snapshot.select("pump", "temperature_c").limit(20).show()The request names a table and a retained version. The reader resolves that table state instead of opening every file with a matching prefix.
Official interface documentation. Documentation checked .
8. Retaining a version also requires retaining its files
A version identifier is useful only while the information needed to read it is available. Retention policies and maintenance can remove old data files or old log history. Keep the required files and transaction information for as long as reproducibility requires. A saved version number is not an indefinite backup.
Botie’s floor makes that dependency visible. Select a committed file list, then use it to read exactly those keys from the supplied storage records. The second case adds an uncommitted file. If your machine starts reading that file, the storage listing has replaced the publication rule.
This local activity does not access object storage, decode Parquet, commit transactions or establish guarantees about concurrent updates and failures. It checks whether your construction respects an explicitly supplied file-selection boundary. Manifest order makes the local output repeatable; a real table query needs explicit sorting when row order matters.
Predict which pump identifiers will appear before running the changed case. Then inspect the chosen keys before changing any record-processing code.
Check yourself
Questions on Parts 1 to 8
Question 1 of 6
A numerical schema alone establishes that the unit is correct.
Question data
A Parquet column named temperature_c accepts numerical values. A producer mistakenly sends a Fahrenheit value as 90.Try it with Botie
Build with Botie
Write and run Python