Compare / BigQuery vs Cloud SQL

BigQuery vs Cloud SQL

Cloud SQL is a managed transactional database for applications. BigQuery is a serverless warehouse for analytics over very large datasets. One serves the app, the other answers questions about the data.

In 80 practice questions across 11 practice banks

Professional Data Engineer Storage

You want to process payment transactions in a point-of-sale application that will run on Google Cloud Platform. Your user base could grow exponentially, but you do not want to manage infrastructure scaling. Which Google database service should you use?

  1. Cloud SQL supports transactions but requires you to manage instance sizing and scaling.

  2. BigQuery is an analytical warehouse, not an OLTP store for payment transactions.

  3. Bigtable lacks multi-row transactions and requires node management.

  4. Datastore is serverless, auto-scaling and supports ACID transactions.

Pick an answer to see why each option is right or wrong.

Try 20 questions free

At a glance

BigQueryCloud SQL
WorkloadOLAP: large scans and aggregationsOLTP: many small reads and writes
ScalePetabyte scale, no instances to sizeLimited by a single primary instance
LatencySeconds for large queries; not built for row-level updatesMilliseconds for indexed lookups
OperationsServerless; pay per query or reserve slotsChoose engine, tier, storage and backups
Typical useReporting, dashboards, data science, ML in SQLApplication backends, CMS, line-of-business systems

Choose BigQuery when

  • Analysts run ad-hoc SQL over terabytes or more.
  • Data from many sources must be combined for reporting.
  • You want to avoid sizing or tuning database servers.

Choose Cloud SQL when

  • An application needs transactions and fast, frequent single-row reads and writes.
  • You are migrating an existing MySQL, PostgreSQL or SQL Server database.
  • The data fits comfortably on one managed database server.

Exam tip

Reports and dashboards slowing down the production database is a classic hint: move the analytics to BigQuery and keep Cloud SQL for transactions. Federated queries can read Cloud SQL from BigQuery without copying data.