Course contentsShow
← Data Engineering
Lesson 248 of 8254. Modern Data Warehousing and LakehousesFree lesson

Implementing Data Lakes for Unstructured Storage

Construct scalable data lakes using object storage to ingest raw, semi-structured, and unstructured data without upfront schema enforcement requirements.

In this lesson, you will learn how to design scalable data lakes that ingest raw, semi-structured, and unstructured data without the bottleneck of upfront schema enforcement.

The Shift from Schema-on-Write to Schema-on-Read

In traditional relational database systems, you must define your tables and enforce strict data types before you can ingest a single byte. While this ensures data integrity, it creates a massive "schema-on-write" bottleneck. In the modern data lakehouse architecture, we flip this paradigm. By using object storage (like S3, GCS, or Azure Blob Storage), we store data in its raw, native format—whether it’s a PDF, a JSON stream, a raw log file, or an image.

We defer the schema definition until the moment we actually query the data, a strategy known as "schema-on-read." This allows us to ingest high-velocity data from diverse sources without needing to understand the structure of the data in advance.

Building the Scalable Ingestion Pipeline

To implement this, you structure your storage in a "landing zone" or "bronze layer." You don't need to transform the data to make it fit; you simply stream it into a hierarchical directory structure based on date or source.

For example, a raw ingestion process might look like this:

# Raw ingestion example: dumping unstructured JSON logs to Object Storage
storage_client.upload_file(
    local_path="raw_logs_2023_10_27.json",
    bucket="my-data-lake-raw",
    destination="ingestion/logs/year=2023/month=10/day=27/raw_log.json"
)

By decoupling storage from the compute engine, you avoid the overhead of relational constraints. If the structure of your JSON files changes tomorrow—adding new fields or nesting deeper—the ingestion pipeline doesn't break. You simply update your compute engine’s logic during the read phase to handle the new fields. This architectural flexibility is the primary engine for building data lakes that grow alongside your business without requiring constant database migrations or schema redesigns.

Key Takeaway: By utilizing object storage for raw ingestion and applying schema-on-read, you decouple data capture from processing, allowing for infinite scalability across heterogeneous and unstructured data types.