Optional: Modern Big Data Economics

Concept. Modern data systems lower cost by keeping simple workloads in PostgreSQL, loading raw data before transforming it, and separating inexpensive storage from on-demand compute. At scale, teams add specialized systems and use raw SQL when abstractions hide expensive or unsafe behavior.

Intuition. A startup can run one managed PostgreSQL database for $10 to $100 a month. A 100 TB analytics workload can instead keep files in object storage and rent compute only while a query runs.

Reading Time: 5 mins

This optional exploration follows the SQL Introduction and examines how Big Tech pays for scale.

Four costs that shape the modern data stack

Once you can write SQL, the next question is what it costs to run at scale. Four trends shape that bill.


Trend 1: Specialize only when scale requires it

  • Startup: Run managed PostgreSQL for $10 to $100 a month through AWS, GCP, Supabase, or Neon. Add a JSONB column for flexible, semi-structured data instead of operating a separate NoSQL system.

  • Big Tech: Run a hybrid stack: an OLTP database, an OLAP warehouse, an ELT pipeline, and NoSQL stores as needed. Managed services and custom engines add a specialization tax. At Big Tech scale, building and operating every component by hand would be prohibitively expensive.

The simple default (cyan): basic Postgres plus a JSONB column, one database holding typed columns and a JSON object in the row, managed for ten to a hundred dollars a month (AWS, GCP, Supabase, Neon). The specialization tax (grey): a hybrid stack of OLTP and OLAP databases, an ELT pipeline, and NoSQL stores as needed, plus managed services and custom engines, that scale eventually forces.

Figure 1. Basic Postgres plus a JSONB column supports typed columns and semi-structured fields in one row and keeps them queryable with SQL. A managed provider like AWS, GCP, Supabase, or Neon runs this setup for ten to a hundred dollars a month. Big Tech runs a hybrid stack: an OLTP database, an OLAP warehouse, an ELT pipeline, and NoSQL stores as needed, plus managed services and custom engines.


Trend 2: Load before you transform

ELT loads raw data into inexpensive object storage such as S3 or GCS, then transforms it with SQL. ETL transforms the data before loading it.

  1. Keeping raw data lets a team rerun transformations after fixing a bug.

  2. Storage and management costs have fallen by orders of magnitude over the past decade. In the 2020s, BigQuery storage costs under $10 per TB each month.

  3. Loading first also makes streaming data easier to handle and supports real-time processing with SQL.

Two pipelines: old ETL (Extract, Transform to clean, then Load) cleans before storing; new ELT (Extract, Load raw into S3/GCS, then Transform with SQL) stores raw first and cleans later; enabled by storage at about ten dollars per terabyte per month.

Figure 2. ETL runs Extract, Transform, then Load. ELT runs Extract, Load raw data into object storage, then Transform with SQL. Storage at about ten dollars per terabyte per month makes it feasible to keep every raw row and re-run transforms after a bug.


Trend 3: Separate storage from compute

A coupled architecture ties storage to an always-on compute cluster. Holding 100 TB therefore incurs CPU and RAM costs even when queries run only once a week.

A decoupled architecture keeps data in object storage such as S3 and starts compute only while queries run. Storage can grow almost without limit at low cost, while compute scales independently with query demand.

Raw data lands as columnar Parquet files in object storage and receives structure at query time, or schema-on-read. This is a data lake. A table format such as Apache Iceberg tracks schema, file membership, and snapshots across those files. It adds schema evolution, time travel, and ACID table semantics. Together, object storage and table semantics form a lakehouse.

Coupled architecture pays for an always-on 100 TB cluster billed 24/7; decoupled architecture keeps raw data in cheap object storage and spins up compute only per query.

Figure 3. A coupled cluster ties 100 TB to always-on CPU and RAM and bills 24/7, even with weekly queries. A decoupled system stores raw data in object storage and rents compute only for the minutes a query runs.

Trend 4: Know what the ORM hides

An ORM such as SQLAlchemy maps Python objects to database rows, which lets developers build features without writing SQL.

  • Startup: The ORM speeds development.

  • At scale: Hidden behavior can issue redundant queries or cause silent failures that corrupt data across distributed machines.

CS145 teaches raw SQL so you can decide which operations can stay behind an ORM and which require direct control.

An ORM saves time in the startup phase but at scale its hidden details cause silent failures that need raw SQL to fix.

Figure 4. An ORM maps Python objects to rows without SQL. In distributed systems, hidden ORM behavior can issue redundant queries and corrupt data without an obvious failure signal. Raw SQL knowledge supports a deliberate split between ORM code and handwritten queries.

Takeaway: Start with the simplest database that fits the workload. Add ELT, decoupled compute, specialized stores, and raw SQL control when scale makes their cost worthwhile.