The Lakehouse Architecture – Unifying Your Data Lake and Warehouse

Sriram KrishnanSriram Krishnan
6 min read

Introduction: The Next Step in Our Data Journey

Over the past several chapters, we've journeyed deep into the world of building a world-class data platform on Snowflake. We have mastered the essentials of data loading, architected robust security with RBAC and policies, optimized performance with clustering and query tuning, and learned to control costs with diligent monitoring.

In short, we have architected a world-class Data Warehouse.

But a fundamental question remains, one that has defined data architecture for over a decade: what about the data outside the warehouse? What about the raw application logs, the semi-structured JSON event streams, or the vast archives of raw files that are too varied or voluminous to fit neatly into a structured schema?

Historically, the answer was the Data Lake—a separate, low-cost repository for all this raw data. This created a divided world:

  1. The Data Lake: Flexible and cheap, but often unreliable and difficult to govern, risking the descent into a "data swamp."

  2. The Data Warehouse: Structured and reliable, but rigid and expensive, requiring data to be copied and transformed out of the lake and into the warehouse.

This division created complexity, data duplication, and latency, with fragile ETL pipelines acting as the messy glue between the two systems.

Image Source

This is the exact problem the Lakehouse Architecture was born to solve. It is not a new product but a powerful new design pattern that seeks to unify these two worlds. And critically, we'll see how this modern pattern is not just theory but is being fully embraced by platforms like Snowflake through transformative features like Iceberg Tables, making our journey so far more relevant than ever.


The Crucial Role of an Open Table Format like Apache Iceberg

A Lakehouse is not merely a data lake with a new name. It is a modern data architecture that combines the low-cost, flexible storage of a Data Lake with the powerful management features and reliability of a Data Warehouse.

The "magic ingredient" that makes this possible is a transactional metadata layer that sits directly on top of open-format files (like Parquet) in your cloud object storage. Apache Iceberg is the open-source table format that has emerged as the industry standard for this layer.

Think of Iceberg as the "engine" of the Lakehouse. It supercharges your simple data files with the features that were previously exclusive to data warehouses:

  • ACID Transactions: Iceberg provides snapshot isolation, guaranteeing that operations are atomic and consistent. This means multiple users and jobs can safely write to the same table at the same time without corrupting data—a problem that plagued traditional data lakes.

  • Schema Enforcement & Evolution: Iceberg tracks a table's schema over time. It prevents "bad" data with incorrect schemas from being written, while still allowing for safe schema evolution (like adding or renaming columns) without having to rewrite terabytes of underlying data files.

  • Time Travel (Data Versioning): Every change to an Iceberg table creates a new, queryable snapshot. This allows you to query the exact state of your data at any point in history, making audits, rollbacks, and debugging incredibly simple.

In short, Iceberg gives your data lake a "brain," allowing you to perform data warehousing workloads directly on the same low-cost storage you use for raw data ingestion.


The Lakehouse Flow

With a powerful table format like Iceberg as the foundation, we can now reliably structure our data flow using the Medallion Architecture. This pattern organizes data into progressive layers of quality: Bronze, Silver, and Gold.

  1. Ingestion into the Lake: Data from various sources is landed in its raw format into your cloud data lake.

  2. Bronze Layer (Raw): The raw data is ingested into an Iceberg table with minimal transformation. This creates a versioned, queryable archive of your source data with a full history.

  3. Silver Layer (Cleaned & Conformed): This is where the core work of an Analytics Engineer happens. Data from Bronze tables is cleaned, filtered, and joined into a set of validated, business-ready tables.

  4. Gold Layer (Aggregated & Business-Ready): These tables are highly refined and aggregated, designed specifically to power business intelligence and reporting.


Lakehouse Architecture Explained with an Example

Let's walk through an e-commerce scenario.

  • Objective: Analyze customer purchasing patterns and website activity.

  • Data Sources: A Postgres database and JSON clickstream events.

Step 1: Ingestion
Raw JSON events and a CDC export of the Postgres tables are landed daily into an S3 bucket: s3://ecommerce-lakehouse/raw/.

Step 2: Creating Bronze Iceberg Tables
An ETL job reads the raw files and writes them into versioned Iceberg tables.

-- Create a Bronze table to archive raw clickstream data using the Iceberg format
CREATE TABLE bronze.clickstream_events (
  event_id STRING,
  user_id STRING,
  event_timestamp TIMESTAMP,
  payload VARIANT
) USING iceberg PARTITIONED BY (days(event_timestamp));

Step 3: Creating Silver Iceberg Tables (The Analytics Playground)
We read from our reliable Bronze tables and create an enriched, clean source of truth.

-- Create a cleaned, sessionized activity table, also using Iceberg
CREATE TABLE silver.user_sessionized_activity
USING iceberg
AS
SELECT
s.session_id,
s.user_id,
c.customer_name,
c.region,
COUNT(*) AS actions_in_session
FROM bronze.clickstream_events s
LEFT JOIN bronze.customers c ON s.user_id = c.customer_id
WHERE s.user_id IS NOT NULL
GROUP BY s.session_id, s.user_id, c.customer_name, c.region;

Step 4: Creating Gold Tables (For the Business)
We now create aggregated tables that directly power our BI dashboards.

-- Create a daily summary table for our BI tool
CREATE TABLE gold.daily_regional_performance
USING iceberg
AS
SELECT
  DATE(session_start) AS activity_date,
  region,
  COUNT(DISTINCT user_id) as active_users
FROM silver.user_sessionized_activity
GROUP BY 1, 2;

Step 5: Consumption

  • BI Analysts connect Tableau to the gold tables for fast dashboards.

  • Data Scientists use the clean silver tables to train models.

  • Data Engineers can query any version of the bronze tables for audits.


Why the Lakehouse Matters: The Key Benefits

  1. Reduces Data Duplication and Complexity: Eliminates the need for separate data lake and data warehouse systems and the ETL pipelines that connect them.

  2. A True Single Source of Truth: All data—raw, semi-structured, and structured—lives and is governed in one place.

  3. Cost-Efficiency: Leverages cheap, scalable cloud object storage.

  4. Openness and Flexibility: Because it is built on open standards like Apache Parquet and Apache Iceberg, it prevents vendor lock-in and allows you to use the best engine for the job.

Final Thoughts

The Lakehouse architecture is not just a buzzword; it represents a fundamental evolution in data platform design. By bringing warehouse-like reliability and performance to the data lake through the power of open table formats like Apache Iceberg, it breaks down the long-standing silos between data engineering, business intelligence, and data science. For Analytics Engineers, it provides a unified environment to build end-to-end data products that are reliable, performant, and cost-effective.

0
Subscribe to my newsletter

Read articles from Sriram Krishnan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sriram Krishnan
Sriram Krishnan

Sharing lessons, tools & patterns to build scalable, modern data platforms —one post at a time.