0
0
Snowflakecloud~5 mins

Snowflake architecture (storage, compute, services layers) - Commands & Configuration

Choose your learning style9 modes available
Introduction
Snowflake is a cloud data platform that separates storage, compute, and services to make data easy to store, process, and manage. This separation helps users scale resources independently and pay only for what they use.
When you want to store large amounts of data without worrying about managing hardware.
When you need to run multiple data queries at the same time without slowing down other users.
When you want to easily add or remove computing power based on workload needs.
When you want a simple way to manage data security and user access.
When you want to connect your data platform to many cloud services without complex setup.
Commands
This command lists all compute warehouses available in your Snowflake account. Warehouses are the compute layer that process queries.
Terminal
SHOW WAREHOUSES;
Expected OutputExpected
name | state | size | type | auto_suspend | auto_resume MY_WH | RUNNING | XSMALL | STANDARD | 300 | TRUE
This command creates a new compute warehouse named 'my_wh' with automatic suspend after 5 minutes and auto resume enabled. This helps save costs by stopping compute when not in use.
Terminal
CREATE WAREHOUSE my_wh WITH WAREHOUSE_SIZE = 'XSMALL' AUTO_SUSPEND = 300 AUTO_RESUME = TRUE;
Expected OutputExpected
Warehouse MY_WH successfully created.
WAREHOUSE_SIZE - Sets the size of the compute warehouse.
AUTO_SUSPEND - Automatically suspends the warehouse after inactivity.
AUTO_RESUME - Automatically resumes the warehouse when a query runs.
This command sets the current compute warehouse to 'my_wh' so that queries run using its compute resources.
Terminal
USE WAREHOUSE my_wh;
Expected OutputExpected
Using warehouse MY_WH.
This command shows your Snowflake account name and cloud region, which are part of the services layer managing your environment.
Terminal
SELECT CURRENT_ACCOUNT(), CURRENT_REGION();
Expected OutputExpected
CURRENT_ACCOUNT() | CURRENT_REGION() MY_ACCOUNT | us-east-1
Key Concept

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

Common Mistakes
Trying to run queries without selecting a warehouse first.
Queries need compute resources from a warehouse to run; without selecting one, queries will fail.
Always run 'USE WAREHOUSE your_warehouse_name;' before running queries.
Not enabling AUTO_SUSPEND on warehouses.
This causes warehouses to keep running and incur costs even when idle.
Set AUTO_SUSPEND to a reasonable time like 300 seconds to save costs.
Summary
Snowflake architecture splits storage, compute, and services layers for flexibility.
Compute warehouses process queries and can be created, sized, and managed independently.
Services layer manages account, security, and metadata without user intervention.