Lompat ke konten

Pelajaran 5 ยท Architecture

Cloud Warehouses, Data Lakes and Lakehouses

Learn how cloud data warehouses work, including parallel processing and separate storage and compute, and how they compare with data lakes and lakehouses.

The design ideas of warehousing are decades old, but the machines underneath have changed. Many warehouses now run as cloud services, and they sit next to data lakes and lakehouses. This lesson explains the terms without tying you to any vendor. Product features change often, so check each vendor's official documentation before you decide.

Parallel processing

Large analytical platforms usually use massively parallel processing (MPP) or a similar distributed design. A table is split into pieces, several workers each process their pieces at the same time, and the partial results are combined.

Some operations need rows moved between workers, for example when two large tables must be joined on a key and matching rows are on different machines. This movement is often called a shuffle or redistribution, and it can dominate the run time. Some platforms let you control how data is distributed; others handle it for you.

You can imitate the idea: split rows into groups, aggregate each group, then combine.

SQL Stand-in: split, aggregate, combine

Press Run (or Ctrl + Enter) to see the result here.

Notice how the average is combined: each worker sends a sum and a count. Averaging the workers' averages would give a wrong answer when they hold different numbers of rows. Only the splitting is real here; SQLite runs everything on one machine.

Separating storage and compute

Many cloud platforms keep data in shared storage and run queries on separate compute resources. This brings useful options:

  • Grow storage without adding query power, and the reverse.
  • Give the loading job and the dashboards separate compute so they do not slow each other.
  • Pause or shrink compute when nobody needs it.

Pricing models differ. Some charge for compute time, others for the amount of data a query scans, and others for reserved capacity. Read the current pricing page of your platform, and set budgets and alerts early.

Well-known cloud warehouse services include Snowflake, Google BigQuery and Amazon Redshift. This tutorial does not rank them. For hands-on product detail, see the Snowflake tutorial.

Data lakes

A data lake stores files of any kind, such as CSV, JSON, Parquet, images and logs, usually in cheap object storage. You can store data before you know exactly how you will use it. The structure is often applied when the data is read, called schema-on-read. A traditional warehouse applies structure when data is loaded, called schema-on-write.

A lake without ownership, a catalog and quality rules becomes hard to trust, often nicknamed a "data swamp".

Lakehouses

A lakehouse tries to bring warehouse behavior to files in a lake. The key ingredient is a table format such as Apache Iceberg, Delta Lake or Apache Hudi. A table format keeps metadata about which files make up a table, which makes features such as atomic changes and schema evolution possible. What exactly is supported depends on the format and the engine. See lakehouse table formats.

Comparing the three

Question Warehouse Data lake Lakehouse
Main form of data Tables Files of any type Files managed as tables, plus other files
When is structure applied? Mostly on write Often on read On write for managed tables
Typical strength Reliable SQL analytics Flexible, broad storage One storage layer for several workloads
Typical risk Less suited to unstructured data Disorder without governance More components to understand and tune

The lines are blurring: many warehouses can query files in object storage, and many lake engines offer SQL tables. Judge platforms by what you need, not by the label.

Modeling still matters on all three. A pile of well-stored files does not define what a customer is or how revenue is counted.

Questions to ask before choosing

  1. Which data types and volumes must you handle?
  2. Who queries it, with which tools and skills?
  3. How fresh must results be?
  4. Where may data be stored and processed, given your legal duties?
  5. How do you export data and move away if you need to?
  6. How will you see and limit spending?

Distribution and skew

How rows are spread across workers matters. If a large fact table and a large dimension are both distributed by the same join key, matching rows can already sit together, so less data moves. Distributing by a column with few distinct values, or with one dominant value, gives some workers much more to do than others. This imbalance is data skew. The whole query then waits for the busiest worker.

Whether you can choose distribution at all depends on the product. Do not assume that a technique from one platform exists on another.

Compare costs with your own workload

Published claims about speed and price rarely match your data. To compare options fairly:

  1. Choose a representative sample: your biggest tables, your typical joins and a few awkward queries.
  2. Load realistic volumes, using masked or synthetic data if the real data is sensitive.
  3. Run the loading jobs and the queries at the same time, as in real life.
  4. Record run time, the cost shown by the platform and the effort needed to set up and tune.
  5. Include the tasks people forget: access control, backup and restore, monitoring and export.

Write down the platform settings used, so that the test can be repeated. Results from a trial may change as products and prices change.

Lock-in and open formats

Storing data in open file and table formats can make it easier for several engines to read the same data, and can lower the effort of changing tools. It is not automatic. SQL dialects, stored procedures, permission models and scheduled jobs often tie you to a platform more strongly than the files do. Keep transformation logic in version control, prefer standard SQL where it costs little and test your export path before you need it.

Where each fits, in one example

Harbor Outfitters might keep raw clickstream files and product photos in a lake, curated sales stars in warehouse tables, and use a table format if several engines must work on the same large event data. A smaller shop might put everything in one managed warehouse and add a lake later. Both can be sound decisions.

Common mistakes

Moving an old warehouse to the cloud unchanged can move its problems too. On the other hand, a cloud platform does not remove the need for access control. A storage bucket or table that is opened too widely can expose sensitive data to many people.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. What does separating storage and compute allow?

    Compute can be sized, separated by workload or paused without moving the data.
  2. 2. Why should parallel workers send sums and counts when computing an average?

    The correct overall average is total sum divided by total count.
  3. 3. What is the role of a table format in a lakehouse?

    The format's metadata is what lets engines treat a set of files as a reliable table.

Summary

  • Distributed platforms split work across workers; moving rows between them is costly.
  • Separate storage and compute allow independent scaling and workload isolation.
  • Lakes store many kinds of files; lakehouses add table behavior through table formats.
  • Check current official documentation and pricing, and keep modeling and governance.

Next: The Dimensional Design Process

Progres Anda disimpan di browser ini. Tidak perlu akun.