Introduction to continuous queries (original) (raw)

This document describes BigQuery continuous queries.

BigQuery continuous queries are SQL statements that run continuously. Continuous queries let you analyze incoming data in BigQuery in real time. You can insert the output rows produced by a continuous query into a BigQuery table or export them to Pub/Sub or Bigtable. Continuous queries can process data that has been written tostandard BigQuery tablesby using one of the following methods:

You can use continuous queries to perform time sensitive tasks, such as creating and immediately acting on insights, applying real time machine learning (ML) inference, and replicating data into other platforms. This lets you use BigQuery as an event-driven data processing engine for your application's decision logic.

The following diagram shows common continuous query workflows:

Diagram illustrating common BigQuery continuous query workflows, including data ingestion, processing, and export to destinations like Bigtable and Pub/Sub.

Use cases

Common use cases where you might want to use continuous queries are as follows:

Supported operations

The following operations are supported in continuous queries:

The Google Cloud access tokensthat are used when running continuous query jobs have a time to live (TTL) of two days when they are generated by a user account. Therefore, such jobs stop running after two days. The access tokens that are generated by service accounts can run longer, but must still adhere to the maximum query runtime. For more information, seeRun a continuous query by using a service account.

Locations

Continuous queries are supported in the following locations:

Region description Region name Details
Americas
Iowa us-central1 leaf icon Low CO2
Montréal northamerica-northeast1 leaf icon Low CO2
Northern Virginia us-east4
Oregon us-west1 leaf icon Low CO2
South Carolina us-east1
US multi-region us
Asia Pacific
Delhi asia-south2
Hong Kong asia-east2
Jakarta asia-southeast2
Mumbai asia-south1
Seoul asia-northeast3
Singapore asia-southeast1
Sydney australia-southeast1
Taiwan asia-east1
Tokyo asia-northeast1
Europe
Belgium europe-west1 leaf icon Low CO2
EU multi-region eu
Frankfurt europe-west3 leaf icon Low CO2
London europe-west2 leaf icon Low CO2
Netherlands europe-west4 leaf icon Low CO2

Limitations

Continuous queries are subject to the following limitations:

Reservation limitations

Slots autoscaling

Continuous queries can useslot autoscaling to dynamically scale allocated capacity to accommodate your workload. As your continuous queries workload increases or decreases, BigQuery dynamically adjusts your slots.

After a continuous query starts running, it actively listens for incoming data, which consumes slot resources. While a reservation with a running continuous query does not scale down to zero slots, an idle continuous query that is primarily listening for incoming data is expected to consume a minimal amount of slots, typically around 1 slot.

Pricing

Continuous queries useBigQuery capacity compute pricing, which is measured in slots. To run continuous queries, you must have areservation that uses theEnterprise or Enterprise Plus edition, and a reservation assignmentthat uses the CONTINUOUS job type.

Usage of other BigQuery resources, such as data ingestion and storage, are charged at the rates shown inBigQuery pricing.

Usage of other services that receive continuous query results or that are called during continuous query processing are charged at the rates published for those services. For the pricing of other Google Cloud services used by continuous queries, see the following topics:

What's next

Try creating a continuous query.