Storage Layers: Beginner
What you will be able to do
Storage Is Not Just the Database
Recognize that storage is plural and name the three foundational shapes that solve different jobs.
Three Jobs, Three Shapes
| Job | Access Pattern | Storage Shape That Wins |
|---|---|---|
| Run the application | Read and write a few rows by primary key, thousands of times per second | Operational database (Postgres, MySQL, DynamoDB) |
| Answer business questions | Scan billions of rows, summing or counting a few columns at a time | Data warehouse (Snowflake, BigQuery, Redshift) |
| Hold raw and bulk data | Land enormous files cheaply, read them later in flexible shapes | Data lake (S3, GCS, Azure Data Lake Storage) |
- ▸An operational database optimized for fast point lookups is slow at scanning a billion rows
- ▸A data warehouse optimized for analytical scans cannot handle thousands of small writes per second
- ▸A data lake optimized for cheap bulk storage has no concept of transactions or row-level updates
- ▸Mixing the jobs into one system means one of them gets bad service all of the time
The Postgres-as-Everything Antipattern
- Analytical queries lock production tables and slow the app
- Schema changes for analytics break the application
- Storage costs scale with the largest workload, not the smallest
- Backups have to be tuned for two different shapes simultaneously
- Production stays fast; analytical work runs on a copy that cannot affect the app
- Analytical schema evolves separately from operational schema
- Each storage layer pays only for the work it actually does
- Each layer is backed up and tuned for its own access pattern
The Pipeline Maps to the Shapes
Naming the storage shape at every node in a pipeline diagram is the single most useful documentation habit. A diagram that does not name the shapes hides the most important physics of the system.
The Data Warehouse
Identify a data warehouse by columnar layout, enforced schema, and separated storage and compute, and name three production examples.
Columnar Storage in One Picture
| Layout | How Rows Are Stored on Disk | Fast Access Pattern |
|---|---|---|
| Row store (Postgres, MySQL) | All columns of row 1, then all columns of row 2 | Read or write an entire row by key |
| Column store (Snowflake, BigQuery) | All values of column A, then all values of column B | Read a few columns across many rows |
Schema Enforced at Write Time
Separated Storage and Compute
What Warehouses Are Bad At
- Aggregations across billions of rows
- Joining large tables with SQL
- Storing structured fact and dimension tables long term
- Concurrent analytical workloads with elastic compute
- Point lookups by primary key at sub-50ms latency
- Single-row INSERT/UPDATE/DELETE at high frequency
- Application traffic that demands thousands of small operations per second
- Storing unstructured blobs (images, audio, raw event JSON before parsing)
- Reach for a warehouse when scans dominate the workload
- Declare schema explicitly and let the warehouse reject bad data at load time
- Use separate compute warehouses for ETL, BI, and ad-hoc work to avoid contention
- Use the warehouse as the operational database for an application
- Issue thousands of single-row writes when a bulk load would do the same work
- Store raw unstructured payloads in warehouse tables when a lake would be cheaper and more flexible
The Data Lake
Identify a data lake as files in object storage, name the typical zone structure, and pick Parquet for analytical reads.
What Lives in a Lake
| Layer | Typical Contents | Format |
|---|---|---|
| Raw zone | Source data unchanged from the producer | JSON, CSV, Avro, sometimes Parquet |
| Staging zone | Cleaned, deduplicated, conformed | Parquet |
| Curated zone | Business-ready datasets shared across teams | Parquet, often through an open table format like Iceberg or Delta |
| Archival zone | Cold data kept for compliance | Parquet on infrequent-access storage class (S3 Glacier, GCS Archive) |
Why the Lake Is Cheap
Schema on Read, Not on Write
- ▸Object storage offers eleven nines of durability with no operational work
- ▸Files are immutable once written; updates produce new files
- ▸Listings are eventually consistent; readers must handle missing files gracefully
- ▸Compute is external; readers like Spark, Athena, Trino open files in parallel
The Two Dominant File Formats
| Format | Shape | When To Use It |
|---|---|---|
| JSON / CSV | Row-oriented, human-readable, no compression of repeated values | Raw landing zone where the source decides the format |
| Parquet / ORC | Columnar, binary, compressed per column, embedded statistics | Curated zone where read efficiency matters |
What the Lake Cannot Do
The Operational Database
Distinguish an operational database by row layout, ACID transactions, and OLTP access pattern, and explain why analytical queries belong elsewhere.
Row Storage in One Picture
| Operation | Operational Database Performance | Why |
|---|---|---|
| SELECT row WHERE id = 'user_123' | Sub-millisecond on a hot index | Index points to one block; one disk seek; row stored together |
| UPDATE row SET balance = balance - 10 WHERE id = 'user_123' | Single-digit milliseconds | B-tree index plus row-level locking; small in-place update |
| SELECT SUM(amount) FROM orders WHERE country = 'US' | Slow at scale; locks pages; competes with app traffic | Full scan of row blocks; reads every column whether needed or not |
| INSERT 1,000 rows in one bulk command | Fast, but transaction log fills; replication lag possible | Operational databases are tuned for many small writes, not few large ones |
ACID Transactions
Postgres Versus MySQL Versus DynamoDB
- Read one row by primary key in under a millisecond
- Insert thousands of small rows per second
- Maintain ACID transactions across multiple rows
- Handle live customer traffic without queueing
- Scan a billion rows for a quarterly revenue total
- Hold raw clickstream events for analytical replay
- Join three large fact tables for a dashboard
- Train a machine learning model over a year of history
Why the Operational Database Should Not Be the Analytical Database
The Read Replica as a Halfway Step
- ▸Analytical queries are degrading application latency or causing lock contention
- ▸Analysts ask for joins or shapes that the operational schema makes painful
- ▸The cost of scaling the operational database for analytics exceeds the cost of a separate warehouse
ACID is the operational database's flagship property. Lakes and modern warehouses offer transactional semantics in narrower forms, but small-write ACID at high frequency is still the operational database's exclusive job.
Picking the Right Storage Shape
Pick the appropriate storage layer for a workload by access pattern, freshness needs, and scale.
The Selection Question Tree
| Question | If Yes | If No |
|---|---|---|
| Will the application read or write this data during a user request? | Operational database | Continue to the next question |
| Will analysts or dashboards scan this data with SQL? | Data warehouse | Continue to the next question |
| Is the data raw, bulk, semi-structured, or larger than the warehouse will tolerate cheaply? | Data lake | Reconsider whether the data needs to be stored at all |
Three Workloads, Three Decisions
| Workload | Storage Choice | Reason |
|---|---|---|
| User profile read on every page load | Operational database | Application traffic, sub-millisecond reads, point lookups by user_id |
| Daily revenue dashboard for the executive team | Data warehouse | Analytical scan over a fact table, SQL-shaped, runs once a day |
| Three years of mobile event JSON for ad-hoc analysis | Data lake | Bulk semi-structured data, queried infrequently, must be cheap to retain |
| Live inventory count visible in the app | Operational database | Application traffic, must be fresh and consistent at the row level |
| Year-over-year sales report by region | Data warehouse | Analytical aggregation that scans many rows of a few columns |
| Training data for a recommendation model | Data lake plus warehouse | Lake holds the raw history; warehouse or lake compute extracts features |
The Three Layers Working Together
- Analytical SQL is the dominant downstream consumer
- BI tools (Looker, Tableau, Mode) need a place to point
- Data is structured and benefits from enforced schema
- Concurrency among analysts matters more than per-byte storage cost
- Raw, semi-structured, or unstructured data dominates volume
- Storage cost at petabyte scale is part of the budget conversation
- Multiple compute engines (Spark, Trino, Athena) need to read the same data
- Schema flexibility outweighs the friction of conforming on read
The Common Mistakes
- ▸Operational database for application traffic and ACID transactions
- ▸Data warehouse for analytical SQL that produces dashboards and reports
- ▸Data lake for raw, bulk, and semi-structured data that needs to be cheap
- Name the storage shape for every node in the architecture diagram
- Move analytical workloads off the operational database before they cause incidents
- Hold raw data in the lake even when it is also loaded into the warehouse
- Use the warehouse as a key-value store for application reads
- Treat the lake as a free-for-all without a curated zone
- Pick a single storage layer for every job and tune around the mismatch
Each storage shape fits a job: the lake holds cheap raw files, the warehouse serves analytics, the operational DB serves the live app. Pick by how the data is read.
> A growing e-commerce company has one Postgres database serving the app, the analytics, and the data science team. Checkouts have started slowing during the analyst's afternoon ad-hoc queries. The CEO wants a daily revenue dashboard, the ML team wants three years of clickstream history for a recommendation model, and the application still needs to support a thousand transactions per second. The new lead engineer is asked: 'What storage layers should this company actually have, and what goes where?'
Different shapes of storage exist because different jobs need different physics
- Category
- Pipeline Architecture
- Difficulty
- beginner
- Duration
- 25 minutes
- Challenges
- 0 hands-on challenges
Topics covered: Storage Is Not Just the Database, The Data Warehouse, The Data Lake, The Operational Database, Picking the Right Storage Shape
Lesson Sections
- Storage Is Not Just the Database (concepts: paDataLake)
Engineers entering data work often picture storage as one thing: a database. The mental model collapses every kind of persistent data into the same shape. That mental model breaks the moment a real workload meets it. A row that an app writes once and reads once belongs in a different physical layout than a row an analyst scans across two billion peers to compute a sum. The storage layer that is fast for the first job is slow for the second, and the layer that is fast for the second is wrong for
- The Data Warehouse (concepts: paColumnarVsRow)
A data warehouse is the storage layer optimized for analytics. The shapes that win in a warehouse are very different from the shapes that win in an operational database. A warehouse stores data column by column rather than row by row. It enforces schema before data is written. It scales compute and storage independently so an analyst can run a thousand-dollar query without buying a thousand-dollar machine. The dominant cloud warehouses in 2026 are Snowflake, Google BigQuery, and Amazon Redshift,
- The Data Lake (concepts: paDataLake)
A data lake is files in object storage. That sentence sounds anticlimactic and is. The lake is not a database. It is a directory of files in S3, GCS, or Azure Data Lake Storage, organized by convention rather than enforced rules. Each file holds a chunk of data in some format (Parquet, ORC, JSON, CSV). Files are immutable once written. Reading is done by some external compute engine (Spark, Presto, Athena, Trino) that opens the files and parses them. The lake's superpower is cheap storage and co
- The Operational Database (concepts: paColumnarVsRow)
An operational database is the storage layer the application reads and writes during its normal operation. Postgres, MySQL, SQL Server, Oracle, and DynamoDB are all operational databases. The defining property is that the access pattern is small and frequent. A user logs in: read one row by user_id. A user places an order: insert one row, update one row in inventory, write one row to a payment log. Thousands of these tiny operations per second is the design center. Row Storage in One Picture An
- Picking the Right Storage Shape (concepts: paMedallion)
Three shapes, three jobs, one rule. The rule is short and worth memorizing: warehouses for queries people read, lakes for raw and bulk, operational databases for the app. Most architectural confusion at junior levels collapses once that rule sits in working memory. The rest of this section unpacks the rule into the questions that select between the three when the choice is not obvious. The Selection Question Tree The tree is not exhaustive. Real architectures often store the same logical data in