Skip to content
  • Products
    • Portfolio overview >

      Flexsave™

      Automatically manage cloud compute for optimized costs and agility

      Cloud Analytics

      Make sense of spend and chargeback to align with your business

      google cloud msp

      BigQuery Lens

      Optimize BigQuery costs with actionable recommendations and usage insights

      Spot Scaling

      Maximize AWS Spot savings and minimize disruptions for optimized scaling

      Anomaly Detection

      Autonomously identify cost spikes early, with zero configuration

      Platform overview >

      Organize your billing data for better business decisions

  • Services
    • Services overview >

      How we work

      Learn how we’re redefining support with our customer reliability engineering

      Stats

      View our live support and customer satisfaction statistics in real-time

      Cloud solutions

      Proven solutions to cloud complexity

      FinOps

      Learn how DoiT enables critical FinOps capabilities

      Areas of expertise

      Cloud Architecture

      Ensure your cloud architecture is future-ready and built for success

      Cloud Cost Optimization

      Identify opportunities to optimize costs and target spend for added value

      Cloud Migration

      Realize greater efficiency and innovation with successful cloud migration

      Cloud Security

      Center security in your cloud strategy to ensure ongoing efficacy and growth

      Data and Analytics

      Harness the potential of big data and analytics to gain a competitive edge

      Data Management

      Build your data practice with expert guidance tailored to your business goals

      DevOps Jump Start

      Accelerate your AWS workloads & release pipelines while also increasing automation, monitoring & reliability

      Infrastructure

      Maximize the full suite capabilities from your cloud infrastructure

      Kubernetes

      Manage the complexity of Kubernetes to enable innovation and scalability

      Location-Based Services

      Transform geolocational data into real-world, real-time intelligence

      Machine Learning

      Level-up key data with ML capabilities that accelerate innovation

      Multicloud

      Create meaningful business value with a robust multicloud strategy

      Training

      Build skills and capability across teams with certified, expert-led training

  • Partners
    • Alliances

      Proud to be an award‒winning multicloud partner to top‒tier cloud providers

      doit-together

      DoiT Together

      Enabling cloud growth and unlocking revenue through expert partnership

      ISV Go-Global

      Accelerate new customer growth and Marketplace integration on AWS and GCP

  • Resources
    • Resources hub >

      Blog

      Read the latest insights, tips and perspectives from our team of cloud experts

      Case Studies

      See how we’ve helped thousands of public cloud customers achieve their goals

      Cloud Masters Podcast

      Listen to our experts and customers share tangible tips for navigating the cloud.

      Ebooks and Guides

      Discover foundational expertise and future-ready recommendations for the cloud

      Events and Webinars

      Tech talks and interactive expert sessions delivered both virtually and in person

      GCPInstances.info

      Google Cloud Compute Engine instance comparison

      Help center

      Read documentation, product updates, and more

      Newsroom

      See what's new from DoiT in our latest news and announcements

      Trust Center

      How we focus on security, compliance, and privacy

      Videos

      Watch product demos, interviews and more from our cloud experts

  • About
    • About DoiT >

      Careers

      Browse our open positions and learn more about what it takes to be a Do’er

      Leadership

      Meet the team leading DoiT and our customers on a journey of hypergrowth

      Newsroom

      See what's new from DoiT in our latest news and announcements

  • Pricing
  • Contact us
  • Sign In
  • Products
    • Flexsave ™
    • Cloud Analytics
    • Spot Scaling
    • BigQuery Lens
    • Anomaly Detection
    • DoiT Platform
  • Services
    • How We Work
    • Stats
    • Cloud Solutions
    • FinOps
    • Areas of expertise
      • Cloud Architecture
      • Cloud Cost Optimization
      • Cloud Migration Consulting Services
      • Cloud Security
      • Data and Analytics
      • Data Management
      • DevOps with AWS & DoiT
      • Infrastructure
      • Kubernetes
      • Location Based Services
      • Machine Learning
      • Multicloud
      • Training
  • Partners
    • ISV Go-Global
    • Award-winning public cloud partner
    • DoiT Together
  • Resources
    • Blog
    • Case Studies
    • Cloud Masters Podcast
    • Ebooks and Guides
    • Events and Webinars
    • GCPInstances.info
    • Help center
    • Newsroom
    • Trust Center
    • Videos
  • Pricing
  • About
    • Careers
    • Leadership
    • Newsroom
  • Contact us
  • Sign In
Contact us
Sign in

Blog

BigQuery: Migration to Standard Edition from On-Demand in 5 Steps

  • Nadav Weissman Nadav Weissman
  • Date: June 13, 2023

Photo by Rob Wicks on Unsplash

Preface

The BigQuery editions exposed customers to new pricing models and relatively significant updates to existing models.

At DoiT, we work with many customers to build well-architected systems, efficiently use cloud services, and optimize costs. Due to the BigQuery changes, customers were reaching out to reduce computing costs and considering the transition from 'On demand' to a new pricing model, the 'Standard Edition'.

The following will guide you through steps to determine whether it’s cost-beneficial to do a transition and how to perform and monitor it.

The SQL code referenced in the post requires access to these

INFORMATION_SCHEMA views: JOBS_BY_PROJECT, JOBS_TIMELINE_BY_PROJECT, RESERVATION_CHANGES_BY_PROJECT.

Prerequisites for table access:  roles/bigquery.resourceViewer   (project level)

The core of the Standard Edition reservation

The Standard Edition, a compute-based (Slot hours) offering, stands out among other compute-based pricing options because it’s project-based (similar to On-Demand) instead of organization-wide.
Its primary benefit is access to the autoscaling feature at a low cost and without any commitment: “BigQuery dynamically adjusts your slots based on the increase or decrease in your workload.” (Introduction to slots autoscaling)

The key contrasts between On-Demand and Standard Edition include:

  1. Pricing units: On-Demand charges according to data scanned, whereas the Standard Edition uses a slot/hour model.
  2. Slot availability: With On-Demand, slots are considered “hot” and instantly accessible, while in the Standard Edition, the AutoScaler identifies the necessary slot capacity for query jobs before assigning slots (10~ seconds delay), which affects query latency.
  3. Maximum available slots: For On-Demand, there are 2000 slots, and for the Standard Edition, 1600 slots.

Five steps of migration

[1] Checklist of standard features and limitations

The first step involves verifying your project compatibility with the Standard edition. Take a close look at the noted features list, and make sure you grasp the abilities and restrictions:

“bigquery-standard-edition”

A complete detailed comparison exists here: BigQuery editions features.

[2] Analyze workload usage.

Once you’ve examined the features and constraints, the subsequent step involves estimating expenses based on whether your project is I/O-focused or CPU-focused (Slot). In the  INFORMATION_SCHEMA.JOBS view, you can obtain this data from  total_bytes_billed (I/O) and  total_slot_ms (CPU) .

Our objective is to contrast the expenditure for scanned data with the approximated expenditure for slot usage. Calculating the I/O-based spend is relatively simple, as it’s the sum of all query costs. However, the slot-based expense estimation is a bit low since it doesn’t consider autoscaler behavior (100 slot bucket size and downscaling after a one-minute minimum). We’ll apply a 1.5 multiplier to the slot-based evaluation to address this discrepancy.

The table below compares the monthly costs with the ratio of Slot cost to On-demand, indicating the estimated cost change when transitioning from On-demand to Standard edition.
A ratio value below 100 suggests a potential cost reduction, while a value above 100 signifies a possible increase in cost.

For Example:

“bigquery-standard”

Customer monthly spend — On-demand is more expensive

“bigquery

customer monthly spend — On-demand is cheaper

Code to create the above table: BigQuery OnDemand vs. SE.sql

Considering that the Standard Edition has fewer features than the On-demand edition, it’s recommended to stick with the On-demand option if the ratio is generally over 75%. This is because the anticipated savings will likely be minimal while sacrificing some functionality.

[3] Max slots configuration

The Standard edition needs a single configuration, the maximum slot configuration, which acts as the upper limit for AutoScaling.

How can the appropriate configuration be determined?
Unfortunately, there isn’t a one-size-fits-all solution, as the parameter will likely need some adjustment after the initial setup, depending on your workload pattern and how you want to balance cost and performance.

One way to calculate an initial value is by using this formula:
Determine the 90th percentile hour during the selected period when the slot usage exceeded 100 (basic setup), and round it up to the nearest multiple of 100.

“bigquery-enterprise-plus”

Max configuration based on the P90 hour in the selected period

Example code snippet for determining the initial maximum configuration: BQ SE max configuration.sql

Create reservation

A step-by-step guide for creating a reservation is well documented here: Get started with reservations.

Choose Standard Edition, set ‘max Slots’ and choose the appropriate region or multi-region, as the reservation will not function properly.

[4] Monitoring Performance and cost evaluation

Performance impact

To track your app's performance, gather metrics like job processing times and ad-hoc query response times before migration and compare them with the post-migration results. It’s a good idea to inform BigQuery users about anticipated changes and collect their opinion.

You can evaluate the performance from a system standpoint by referring to the Administrative resource charts discussed in the following section.

Cost Benefits

To evaluate the cost-effectiveness, review your expenses using the daily billing dashboard. Choose the Analysis and Standard Edition SKU from there in the billing section.

“daily-billing-dashboard”

The table below sums in a one-hour interval the total slots allocation abs the estimated costs. Using this information, you can roughly calculate the actual cost based on the autoscaler’s actions.

Example code snippet: Standard Edition cost estimation.sql

“autoscalers-actions”

Estimated cost distribution per hour

[5] Tunning on

Adjusting the settings of the Standard Edition involves modifying the maximum slot configuration to either enhance performance (by increasing slots) or lower expenses (by decreasing slots). The goal is a well-balanced system, ensuring resources aren’t underused or over-allocated.

Monitoring your workload’s efficiency will demonstrate whether the system is balanced, underutilized, or over-provisioned. You can achieve this by observing the Administrative resource charts or by direct query the  INFORMATION_SCHMEA views.

Administrative resource charts:

BigQuery admins monitor their organization’s usage of Slots and the performance of BigQuery jobs over time. You can find these charts in the ‘Monitoring’ section of the BigQuery sidebar, which offers various views to address different inquiries. To get acquainted with these functionalities, refer to the guide on administrative resource charts.

  • Slot usage analysis: Utilize the P90 or P99 metric to examine the relationship between slot usage and allocation (which includes “baseline + Autoscaled slots”) and the duration required for scaling up or down.

“slot

Slot Usage

The above graph utilizes data from the  RESERVATION_CHANGES_BY_PROJECT view , which contains information about reservation modifications.
The table below displays the slot allocation and the duration until the next change (scaling up or down) occurs. The metric  'allocated_slots' represents the quantity of slots assigned at a particular moment until a new  'UPDATE' occurs, while the  'Estimated total slots' represents the overall allocation throughout the period.

Example code snippet:  Monitor BQ edition autoscaling.sql

“estimated-total-slots”

Actual slot allocations with duration

  • Job concurrency: To understand system bottlenecks, look at the ‘pending jobs’ metric.

“pending

Pending Jobs

Job performance: Monitor jobs experiencing high latency by utilizing the 90th percentile (P90) measure

“job-latency”

Jobs latency

Summary and Recommendation

In cases with bursts or spikes, there may be more suitable approaches than this, necessitating further scrutiny. Nonetheless, the tools can provide valuable insights throughout the analysis.

The transition primarily hinges on the type of usage by users in the specific projects, such as I/O-focused (making ‘On-demand’ more expensive) or CPU-focused (resulting in a higher cost for ‘Standard Edition’).
Google primarily recommends the Standard Edition for research and development projects, stating, “For instance, the Standard Edition is ideal for ad-hoc, development, and testing workloads.”

Since the term ‘production workload’ can vary among customers, some customers may consider using the Standard Edition even for ETL/ELT production workloads. This would be acceptable if the edition’s limitations are met (especially the 99.9 SLA), the load remains stable over time, and no end-users are worried about query latency.

Now that you’re familiar with this process try it and let us know how it goes.

Subscribe to updates, news and more.

Subscribe

Subscribe to updates, news and more.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related blogs

Using predefined IAM roles for enhanced Google Maps Platform governance

Examining using predefined Google Cloud IAM roles dedicated to Google Maps usage to enhance the governance of these activities.

Keep reading 
Ramp Plans Resource Hub Header1

Monitor your cloud commit attainment with DoiT Ramp Plans

DoiT Ramp Plans help you visualize, manage, and track your commit attainment so you can make sure you spend what you committed to, and act proactively.

Keep reading 
DoiT-Google-Kubernetes-Engine-Troubleshooting-Made-Simple-with-Interactive-Playbooks

Google Kubernetes Engine Troubleshooting Made Simple with Interactive Playbooks

In modern application management, Kubernetes is the foundation of container orchestration. It automates software deployment, scaling, and management, revolutionising delivery. However, growing complexity and scale pose challenges in troubleshooting and maintaining dynamic ecosystems.

Keep reading 
View all blogs
Let’s do it

From cost optimization to cloud migration, machine learning and CloudOps, we’re here to make the public cloud easy — without the costs.

Ready to get started?

Get in touch

Company

  • About us
  • Blog
  • Careers
  • MS-HT statement
  • Newsroom
  • Privacy policy
  • Terms

Offering

  • Compliance
  • Products
  • Services
  • Solutions
  • Resources

Support

  • Sign in
  • Help center
  • Open ticket
  • Contact us

Never miss an update.

Subscribe to our newsletter

Subscribe to updates, news and more.