Bird
Raised Fist0
SnowflakeConceptBeginner · 3 min read

Compute Layer in Snowflake: What It Is and How It Works

The compute layer in Snowflake is the part that processes your queries and runs your data workloads. It consists of virtual warehouses that can scale independently to handle different tasks without affecting storage.
⚙️

How It Works

Think of the compute layer in Snowflake as the engine of a car. It does the actual work of processing data, running queries, and performing calculations. This layer is made up of virtual warehouses, which are like separate engines you can turn on or off depending on how much power you need.

Each virtual warehouse works independently, so if one is busy running a report, another can still handle loading data without slowing down. This separation means you can scale your compute power up or down easily, just like adding more engines to a car when you need more speed.

💻

Example

This example shows how to create and use a virtual warehouse in Snowflake, which is part of the compute layer.

sql
CREATE WAREHOUSE my_warehouse WITH WAREHOUSE_SIZE = 'SMALL' WAREHOUSE_TYPE = 'STANDARD' AUTO_SUSPEND = 300 AUTO_RESUME = TRUE;

USE WAREHOUSE my_warehouse;

SELECT CURRENT_WAREHOUSE();
Output
CURRENT_WAREHOUSE() ------------------ MY_WAREHOUSE
🎯

When to Use

Use the compute layer when you need to run queries, load data, or perform transformations in Snowflake. Because compute resources are separate from storage, you can scale them independently to match your workload.

For example, if you have many users running reports at the same time, you can increase the size or number of virtual warehouses to keep performance fast. Or, if you only need to run small queries occasionally, you can use a smaller warehouse to save costs.

✅

Key Points

  • The compute layer runs all data processing and queries in Snowflake.
  • It uses virtual warehouses that can be started, stopped, and resized independently.
  • This separation from storage allows flexible scaling and cost control.
  • Virtual warehouses can run in parallel without affecting each other.
✅

Key Takeaways

The compute layer processes queries using virtual warehouses in Snowflake.
Virtual warehouses can scale independently to match workload needs.
Separating compute from storage allows flexible performance and cost management.
You can create, resize, and suspend warehouses to optimize resources.