0
0
Snowflakecloud~5 mins

Why Snowflake separates compute from storage - Why It Works

Choose your learning style9 modes available
Introduction
Snowflake separates compute from storage to let you use each one independently. This means you can store lots of data without paying for compute power all the time. And you can run many queries at once without slowing down.
When you want to store large amounts of data but only run queries sometimes.
When multiple teams need to run queries on the same data without waiting for each other.
When you want to save money by scaling compute power up or down separately from storage.
When you want to keep your data safe and accessible even if compute resources change.
When you want fast query performance without copying or moving data.
Commands
This command creates a compute warehouse in Snowflake. The warehouse handles query processing separately from storage. Auto suspend and resume save costs by stopping compute when idle.
Terminal
CREATE WAREHOUSE my_warehouse WITH WAREHOUSE_SIZE = 'SMALL' WAREHOUSE_TYPE = 'STANDARD' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;
Expected OutputExpected
Statement executed successfully.
WAREHOUSE_SIZE - Sets the size of the compute warehouse to control processing power.
AUTO_SUSPEND - Automatically suspends the warehouse after 60 seconds of inactivity to save costs.
AUTO_RESUME - Automatically resumes the warehouse when a query is submitted.
This command tells Snowflake to use the created warehouse for running queries. It connects compute resources to your session.
Terminal
USE WAREHOUSE my_warehouse;
Expected OutputExpected
Statement executed successfully.
This command checks which warehouse is currently active for your session, confirming compute is separate and in use.
Terminal
SELECT CURRENT_WAREHOUSE();
Expected OutputExpected
CURRENT_WAREHOUSE() ------------------ MY_WAREHOUSE
This command lists all warehouses and their status, showing compute resources separately from storage.
Terminal
SHOW WAREHOUSES;
Expected OutputExpected
name | state | size | type | auto_suspend | auto_resume MY_WAREHOUSE | RUNNING | SMALL | STANDARD | 60 | TRUE
Key Concept

If you remember nothing else from this pattern, remember: Snowflake separates compute and storage so you can scale and pay for each independently.

Common Mistakes
Trying to run queries without selecting a warehouse first.
Queries need compute resources to run, and without selecting a warehouse, Snowflake cannot process them.
Always run 'USE WAREHOUSE your_warehouse;' before running queries.
Creating a warehouse without auto suspend enabled.
This causes compute to run continuously, increasing costs unnecessarily.
Set AUTO_SUSPEND to a reasonable time like 60 seconds to save costs.
Summary
Create a warehouse to provide compute power separately from storage.
Use the warehouse to run queries without affecting stored data.
Auto suspend and resume help save costs by managing compute usage automatically.