Shopify reduced BigQuery costs by ~$1,000,000/month with a simple...

@ryanlpeterman
Ryan Peterman@ryanlpeterman
11 views Jan 22, 2024 ~1 min read
Advertisement
1
Shopify reduced BigQuery costs by ~$1,000,000/month with a simple change, here's how:
2
In 2022, Shopify built a new marketing tool using Apache Flink and launched an early release of it to a select group of merchants.

When they tried to scale up for more merchants, they realized their BigQuery based implementation cost ~$1,000,000/month (60 queries per minute)!
3
When they dug deeper they realized it was so expensive because one step in their pipeline naively loaded the whole dataset each time.

To reduce this cost, the team leveraged clustering. This feature in BigQuery allows you to sort your data based on values in certain columns:
Media image
4
If you have queries that commonly filter on particular columns, your queries will be much more efficient since you only need to scan the blocks that match your filter.

After clustering their table, the team was able to reduce their monthly cost from ~$1,000,000 to ~$1000.
5
We can have a lot of impact by being conscious of the cost of what we build. Efficiency is a feature.

If you'd like to learn more here's the full article: shopify.engineering/reducing-bigqu…
6
If you liked this, join The Developing Dev (read.developing.dev) - my newsletter with 40k+ engineers about software engineering career growth
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement