Data Warehouses
A data warehouse is a database built to answer analytical questions over all of a company's data: "revenue by region by week for the last three years," "which marketing channel brings users who are still active after 90 days," "how many riders cancelled after a price change." Data is copied in from many operational systems (application databases, event streams, payment providers, SaaS tools), cleaned, modeled into consistent tables, and queried with SQL by analysts, dashboards and machine learning pipelines.
Modern cloud warehouses like Snowflake, Google BigQuery, Amazon Redshift and Databricks SQL share a common set of properties:
- Columnar, massively parallel: tables are stored by column with heavy compression, and a query is split across many machines that each scan part of the data. A query over billions of rows takes seconds, not hours.
- Storage separated from compute: data lives in cheap, durable object storage (S3, GCS, Azure Blob). Compute clusters are spun up, resized and shut down independently, and several clusters can read the same data at once.
- Full SQL: big joins, window functions, CTEs, semi-structured JSON. Analysts work in SQL rather than code.
- Schema on write: data is loaded into defined tables with types, which is what makes it trustworthy enough for finance reports.
- Managed: no servers, indexes or vacuuming to tune in the traditional sense. You pay for storage and for compute time or bytes scanned.
In system design interviews, warehouses appear at the edges of many designs: the place an analytics pipeline lands, where a payment system's reconciliation reports run, where a recommendation system's training data is built, the "offline" side of an ad click aggregator. You rarely design a warehouse from scratch, but you should know where one fits, how data gets into it, why it's separate from your production database, how storage-compute separation works, and how a lakehouse (open table formats like Iceberg and Delta Lake on object storage) changes the picture.
Why a Separate Warehouse?
You could run analytical queries against your production Postgres database, and at small scale people do. It breaks down for three reasons:
- Workload interference. A query that scans a year of orders competes for CPU, memory and disk with the checkout flow. One analyst's bad join can take the site down.
- Wrong storage layout. Row-oriented OLTP databases read entire rows to answer a question about three columns, and they lack the parallel execution to scan terabytes quickly.
- Data lives in many places. Orders are in Postgres, events in Kafka, payments in Stripe, support tickets in a SaaS tool, and marketing spend in a spreadsheet. Answering "what's our customer acquisition cost by channel" needs all of them in one place, joined on consistent keys.
So companies build a pipeline that copies data out of operational systems into a central analytical store, where it can be modeled, joined and queried without touching production.