avatarChristianlauer

Summary

Google BigQuery has introduced Query Queues to optimize query concurrency, allowing for dynamic adjustment of query processing based on available resources, with customizable settings for flat-rate customers.

Abstract

Google has announced the availability of Query Queues in BigQuery for both on-demand and flat-rate customers. This feature enables BigQuery to automatically manage query concurrency, utilizing available compute resources efficiently. Flat-rate customers have the option to set a custom concurrency target. This enhancement is particularly significant for modern SaaS-based Data Warehouses, where the ability to handle numerous concurrent queries is crucial for large-scale data analysis. Previously, BigQuery capped interactive query concurrency at 100, with excess queries resulting in quota errors. The introduction of Query Queues means that queries exceeding the concurrency limit will be queued rather than rejected, ensuring users can work with real-time data without disruption. This change is seen as a valuable improvement, currently in preview, with the expectation that it will soon be widely available to all users.

Opinions

  • The author views the ability to handle high concurrency in data warehouses as essential for providing real-time data analysis to many users.
  • Scaling to accommodate thousands of simultaneous users is considered very challenging, and the new Query Queues feature is seen as a solution to manage this complexity without causing quota errors.
  • The author considers the Query Queues feature a useful extension, as it prioritizes user experience by preventing errors, even if it means users might have to wait slightly longer for their queries to execute.
  • There is an expectation that the feature, currently in preview, will soon be generally available, as is typical with Google's release process.

BigQuery now supporting Query Queues

Using Query Queues for Concurrency in Google BigQuery

Photo by Austris Augusts on Unsplash

Google just announced that Query queues are now available in preview for on-demand and flat-rate customers. After you enable query Google BigQuery automatically determines the query concurrency rather than setting a fixed limit. Flat rate customers have the possibility to override this setting with a custom concurrency target. Additional queries beyond the concurrency target are queued until processing resources become available [1].

When building up and using a modern SaaS-based Data Warehouses the ability to provide a lot of data to many users and enable concurrent queries is one of the most important factors. The newer often cloud-based Data Warehouse technologies solve the problem of high simultaneity through good scalability and enable companies to perform data analysis on a large scale. Normally BigQuery limits the number of concurrently running interactive queries to 100. Queries that exceed this will return a quota error.

Before Query Queues — Image Source: Google[2]

With the new feature query queues are enabled, BigQuery dynamically determines the query concurrency based on available compute resources. Optionally, you can specify the target concurrency for a reservation to ensure that each query is allocated some minimum number of slots. Additional queries wait in a queue until there is enough capacity available to begin execution [2]:

After Query Queues — Image Source: Google[2]

An important criteria for Data Warehouses is that many users are able to work simultaneously. While managing a few users is easy to manage, scaling to thousands is very hard to manage. Everyone must be able to work with the same real-time data without negatively impacting other users and no users like to get an quota error. And this is exactly where Google now starts by enabling query queues for BigQuery. Users may have to wait a little longer, but they won’t get any errors. In my opinion, this is a very useful function extension. Remember that it is, as I said. in the Preiew, but usually the features then also come promptly for all and generally available.

If your are a Google BigQuery user, fan or whatever the following lately updates may be also interesting for you:

Sources and Furhter Readings

[1] Google, BigQuery Release Notes (2022)

[2] Google, Use query queues (2022)

Data Science
Google
Bigquery
Technology
Programming
Recommended from ReadMedium