We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Database Types Storage
Free preview: the first 2 parts of this 9-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Database Types Storage
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
It's quarter-end. The VP of Sales asks: "What was our revenue by product category, by region, for the last 12 months, compared to the same period last year?"
You could run that query against your production PostgreSQL database. But here's what happens:
Running analytical queries on a production database is like using your daily commuter car for an off-road expedition. It technically works, but it's miserable for everyone involved.
Data warehouses solve this by creating a separate, purpose-built database optimized for analytical queries. Data flows from your production systems into the warehouse, transformed, cleaned, and reorganized for fast aggregations. The production database stays fast. The analysts get their answers in seconds.
A differs from a production (OLTP) database in almost every dimension:
| Dimension | OLTP Database | Data Warehouse |
|---|---|---|
| Purpose | Run the application | Answer business questions |
| Queries | Simple, row-level (get user, place order) | Complex, aggregated (total revenue by region) |
| Schema | Normalized (3NF) to avoid redundancy | Denormalized (star/snowflake schema) for fast queries |
| Data freshness | Real-time | Periodic (hourly, daily, or near-real-time) |
| Storage engine | Row-oriented | Columnar |
| Typical size | GBs to low TBs | TBs to PBs |
| Concurrent users | Thousands | Dozens to hundreds |
| Write pattern | Many small writes | Large bulk loads |
The ETL/ELT Pipeline:
Data gets into the warehouse through a process called ETL (Extract, Transform, Load) or ELT (Extract, Load, Transform):
Modern cloud warehouses favor ELT, load raw data first, then transform inside the warehouse using . This is simpler and uses the warehouse's massive compute power for transformations.