Engineering

What Are BigQuery, PostgreSQL and MySQL?

Two transactional databases and one analytical warehouse, which are built for different shapes of question.

Definition

PostgreSQL and MySQL are relational database management systems designed for transactional workloads, where many small reads and writes happen concurrently. BigQuery is a serverless, column oriented analytical warehouse from Google Cloud, designed to scan very large tables for aggregate queries.

Row stores and column stores

PostgreSQL and MySQL store rows together, which is efficient when you need whole records, as an application does. BigQuery stores each column separately, so a query that touches three columns of a hundred column table reads only those three. That is why analytical queries over billions of rows are practical there and painful in a row store.

Choosing between them

  • Application state, user accounts, orders: PostgreSQL or MySQL
  • Historical crawl data, ranking snapshots, log analysis: BigQuery
  • PostgreSQL when you want richer types, JSONB, window functions and extensions
  • MySQL when the surrounding ecosystem already assumes it

The cost model is the trap

BigQuery's on demand pricing bills by bytes scanned, not by time taken. A SELECT star over a wide table costs far more than selecting the four columns you need, and partitioning and clustering exist mainly to keep that number down. Traditional databases bill for the server whether you query it or not.

BigQuery is a fully managed, AI-ready data analytics platform that helps you maximize value from your data.

Google Cloud, BigQuery documentation

References