0
0
Snowflakecloud~10 mins

Snowflake architecture (storage, compute, services layers) - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Snowflake architecture (storage, compute, services layers)
User Query
Services Layer
Compute Layer
Storage Layer
Return Data to User
User requests go through the Services layer, which manages tasks and security, then to Compute for processing, and Storage for data. Results flow back the same way.
Execution Sample
Snowflake
-- User runs a query
SELECT * FROM sales_data WHERE region = 'West';
This query is processed by Snowflake's architecture layers to return filtered sales data.
Process Table
StepLayerActionDetailsResult
1Services LayerReceive queryParse and validate user queryQuery accepted
2Services LayerCheck permissionsVerify user access rightsAccess granted
3Compute LayerAllocate warehouseAssign virtual warehouse for queryWarehouse ready
4Compute LayerProcess queryTranslate query to execution planExecution plan created
5Storage LayerFetch dataRetrieve sales_data from cloud storageData retrieved
6Compute LayerFilter dataApply WHERE region = 'West'Filtered data ready
7Compute LayerReturn resultsSend data back to Services layerResults ready
8Services LayerDeliver resultsSend data to userUser receives data
9-EndQuery completeExecution finished
💡 Query completes after results are delivered to the user
Status Tracker
VariableStartAfter Step 3After Step 5After Step 6Final
QueryUser inputAssigned to warehouseData fetched from storageData filtered by regionResults sent to user
WarehouseNoneActiveActiveActiveReleased after query
Key Moments - 3 Insights
Why does the Services layer check permissions before processing?
The Services layer ensures security by verifying user rights before any compute or storage access, as shown in step 2 of the execution_table.
How does Compute layer handle the query without storing data?
Compute processes the query using data fetched from Storage but does not store data itself, demonstrated in steps 4, 6, and 7.
What happens if multiple users run queries at the same time?
Compute layer can allocate multiple virtual warehouses independently, allowing parallel processing without affecting Storage or Services layers.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does the Compute layer filter data?
AStep 4
BStep 2
CStep 6
DStep 8
💡 Hint
Check the 'Layer' and 'Action' columns in execution_table rows
According to variable_tracker, what is the state of the Warehouse after Step 3?
AInactive
BActive
CReleased
DNot assigned
💡 Hint
Look at the 'Warehouse' row under 'After Step 3' column
If the Services layer denies access at Step 2, what happens next?
AQuery is rejected and stops
BQuery proceeds to Compute layer
CData is fetched from Storage anyway
DResults are sent to user immediately
💡 Hint
Refer to the purpose of Step 2 in execution_table about permission checks
Concept Snapshot
Snowflake architecture has three layers:
1. Services Layer: Manages security, metadata, and query parsing.
2. Compute Layer: Runs queries using virtual warehouses.
3. Storage Layer: Stores all data centrally in cloud storage.
Layers work independently for scalability and performance.
Full Transcript
Snowflake architecture separates tasks into three layers. The Services layer receives and validates user queries, checking permissions to keep data secure. Then the Compute layer allocates virtual warehouses to process queries without storing data itself. The Storage layer holds all data in cloud storage, accessed by Compute when needed. This separation allows Snowflake to scale efficiently and handle many users at once. The execution flow starts with the user query entering Services, moving to Compute for processing, fetching data from Storage, and returning results back through Services to the user.