Snowflake Architecture: Multi-Cluster Shared Data & Virtual Warehouses

Free Lesson

Advertisement

Snowflake Architecture: Multi-Cluster Shared Data & Virtual Warehouses

Architecture Diagram 1: Complete Snowflake Architecture

Architecture Diagram
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        SNOWFLAKE CLOUD DATA PLATFORM                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                     CONSUMPTION LAYER                                β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚BI Tools  β”‚  β”‚  SQL     β”‚  β”‚  ODBC/   β”‚  β”‚   Snowflake      β”‚   β”‚   β”‚
β”‚  β”‚  β”‚Tableau   β”‚  β”‚  Client  β”‚  β”‚  JDBC    β”‚  β”‚   Connector      β”‚   β”‚   β”‚
β”‚  β”‚  β”‚Power BI  β”‚  β”‚  worksheetβ”‚ β”‚  Driver  β”‚  β”‚   (Python/Java)  β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                   CLOUD SERVICES LAYER                              β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚
β”‚  β”‚  β”‚  Authenticationβ”‚ β”‚  Infrastructureβ”‚ β”‚  Metadata  β”‚ β”‚ Security β”‚ β”‚   β”‚
β”‚  β”‚  β”‚  & Access     β”‚ β”‚  Management  β”‚ β”‚  Managementβ”‚ β”‚ Controls β”‚ β”‚   β”‚
β”‚  β”‚  β”‚  Management   β”‚ β”‚              β”‚ β”‚            β”‚ β”‚          β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚
β”‚  β”‚  β”‚  Query       β”‚ β”‚  Optimizer   β”‚ β”‚  Service Engineering      β”‚ β”‚   β”‚
β”‚  β”‚  β”‚  Processing  β”‚ β”‚  & Planning  β”‚ β”‚  (Global Service)         β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    QUERY PROCESSING LAYER                            β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚              VIRTUAL WAREHOUSE CLUSTER                        β”‚   β”‚   β”‚
β”‚  β”‚  β”‚                                                               β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚   Node 1   β”‚  β”‚   Node 2   β”‚  β”‚   Node 3   β”‚  β”‚  Node N  β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β” β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚ β”‚Cache  β”‚ β”‚  β”‚ β”‚Cache  β”‚ β”‚  β”‚ β”‚Cache  β”‚ β”‚  β”‚ β”‚Cache β”‚ β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚ β”‚Engine β”‚ β”‚  β”‚ β”‚Engine β”‚ β”‚  β”‚ β”‚Engine β”‚ β”‚  β”‚ β”‚Engineβ”‚ β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚                                                               β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚          RESULT CACHE / SERVICE RESULT CACHE         β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚  Warehouse 1    β”‚    β”‚  Warehouse 2    β”‚    β”‚  Warehouse N   β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  (XS-Small)     β”‚    β”‚  (Large)        β”‚    β”‚  (Multi-Cluster)β”‚ β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                     STORAGE LAYER                                    β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚              MICRO-PARTITION STORAGE                          β”‚   β”‚   β”‚
β”‚  β”‚  β”‚                                                               β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚Micro-   β”‚ β”‚Micro-   β”‚ β”‚Micro-   β”‚ β”‚Micro-   β”‚ β”‚Micro-β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚Partitionβ”‚ β”‚Partitionβ”‚ β”‚Partitionβ”‚ β”‚Partitionβ”‚ β”‚  ..  β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚  (001)  β”‚ β”‚  (002)  β”‚ β”‚  (003)  β”‚ β”‚  (004)  β”‚ β”‚      β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚ 50-500MBβ”‚ β”‚ 50-500MBβ”‚ β”‚ 50-500MBβ”‚ β”‚ 50-500MBβ”‚ β”‚      β”‚ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚   β”‚
β”‚  β”‚  β”‚                                                               β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚    Columnar Storage Format (Parquet-like)             β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚    β€’ Column groups    β€’ Run-length encoding           β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚    β€’ Dictionary encoding  β€’ Delta encoding            β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚    β€’ ZSTD compression    β€’ Metadata statistics        β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚   β”‚
β”‚  β”‚  β”‚           CLOUD BLOB STORAGE (S3/Azure/GCS)                  β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚  β€’ Automatic compression (typically 4-6x)            β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚  β€’ Encryption at rest (AES-256)                      β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β”‚  β€’ Pointers maintained in metadata                    β”‚    β”‚   β”‚   β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architecture Diagram 2: Micro-Partition & Pruning Strategy

Architecture Diagram
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    MICRO-PARTITION PRUNING STRATEGY                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚  SQL Query: SELECT * FROM sales WHERE region = 'US' AND amount > 1000      β”‚
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    METADATA LAYER                                    β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  Micro-Partition Statistics:                                         β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚   β”‚
β”‚  β”‚  β”‚ Partition ID β”‚ Region β”‚  Amount β”‚  Date   β”‚   Rows      β”‚       β”‚   β”‚
β”‚  β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€       β”‚   β”‚
β”‚  β”‚  β”‚    MP_001    β”‚ US/EU  β”‚ 100-5K  β”‚ 2024-Q1 β”‚   45,000    β”‚       β”‚   β”‚
β”‚  β”‚  β”‚    MP_002    β”‚ US/ASIAβ”‚ 500-10K β”‚ 2024-Q2 β”‚   52,000    β”‚       β”‚   β”‚
β”‚  β”‚  β”‚    MP_003    β”‚ EU/APACβ”‚ 200-8K  β”‚ 2024-Q3 β”‚   38,000    β”‚       β”‚   β”‚
β”‚  β”‚  β”‚    MP_004    β”‚ US/EU  β”‚ 1K-15K  β”‚ 2024-Q4 β”‚   61,000    β”‚       β”‚   β”‚
β”‚  β”‚  β”‚    MP_005    β”‚ ASIA   β”‚ 50-2K   β”‚ 2024-Q1 β”‚   29,000    β”‚       β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    PRUNING PHASE 1: Partition Pruning                β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  Filter: region = 'US'                                               β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  MP_001 [US/EU] ──────────┐                                          β”‚   β”‚
β”‚  β”‚  MP_002 [US/ASIA] ────────┼──── PRUNED ──▢  Candidate Partitions    β”‚   β”‚
β”‚  β”‚  MP_003 [EU/APAC] ────X   β”‚         (3 of 5)                         β”‚   β”‚
β”‚  β”‚  MP_004 [US/EU] ───────────                                          β”‚   β”‚
β”‚  β”‚  MP_005 [ASIA] ───────X   β”‚                                          β”‚   β”‚
β”‚  β”‚                            β”‚                                          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    PRUNING PHASE 2: Column Pruning                   β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚   β”‚
β”‚  β”‚  β”‚  SELECT * FROM sales                                         β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  ─────────────────────                                       β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  Column Groups in Micro-Partition:                           β”‚    β”‚   β”‚
β”‚  β”‚  β”‚                                                               β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  CG1: [region, country, city]  ──────▢  READ (region needed) β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  CG2: [amount, currency]       ──────▢  READ (amount needed) β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  CG3: [date, timestamp]        ──────▢  SKIPPED (not needed)β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  CG4: [product_id, sku]        ──────▢  SKIPPED (not needed)β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  CG5: [customer_id, email]     ──────▢  SKIPPED (not needed)β”‚    β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                    β”‚                                        β”‚
β”‚                                    β–Ό                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    PRUNING PHASE 3: Row-Level Filtering              β”‚   β”‚
β”‚  β”‚                                                                      β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚   β”‚
β”‚  β”‚  β”‚  Amount Column Data in MP_001:                               β”‚    β”‚   β”‚
β”‚  β”‚  β”‚                                                               β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  Run-Length Encoded:                                          β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  [100, 150, 200, 250, 300, 350, 400, 450, 500, 550, ...]    β”‚    β”‚   β”‚
β”‚  β”‚  β”‚       β–²                                                      β”‚    β”‚   β”‚
β”‚  β”‚  β”‚       β”‚                                                      β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  Amount > 1000:  Skip values 100-999                         β”‚    β”‚   β”‚
β”‚  β”‚  β”‚  Scan from index ~20 only (1000/50 increment)                β”‚    β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                             β”‚
β”‚  RESULT: 3 micro-partitions scanned β†’ 2 columns read β†’ rows filtered       β”‚
β”‚  EFFICIENCY: ~85% data skipped through metadata-based pruning              β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architecture Diagram 3: Virtual Warehouse Scaling & Multi-Cluster

Architecture Diagram
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               VIRTUAL WAREHOUSE MULTI-CLUSTER SCALING                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚  MULTI-CLUSTER WAREHOUSE: Analytics_WH (Min: 1, Max: 5)                    β”‚
β”‚                                                                             β”‚
β”‚  CLUSTER 1 (Primary)           CLUSTER 2 (Auto-Started)                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚   Warehouse: WH_1       β”‚  β”‚   Warehouse: WH_2       β”‚                  β”‚
β”‚  β”‚   Size: X-Large          β”‚  β”‚   Size: X-Large          β”‚                  β”‚
β”‚  β”‚   Status: ACTIVE         β”‚  β”‚   Status: ACTIVE         β”‚                  β”‚
β”‚  β”‚                          β”‚  β”‚                          β”‚                  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚                  β”‚
β”‚  β”‚  β”‚  Node Pool: 8 nodesβ”‚ β”‚  β”‚  β”‚  Node Pool: 8 nodesβ”‚ β”‚                  β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β” β”‚ β”‚  β”‚  β”‚  β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β” β”‚ β”‚                  β”‚
β”‚  β”‚  β”‚  β”‚N1β”‚β”‚N2β”‚β”‚N3β”‚β”‚N4β”‚ β”‚ β”‚  β”‚  β”‚  β”‚N5β”‚β”‚N6β”‚β”‚N7β”‚β”‚N8β”‚ β”‚ β”‚                  β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜ β”‚ β”‚  β”‚  β”‚  β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜ β”‚ β”‚                  β”‚
β”‚  β”‚  β”‚  β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β” β”‚ β”‚  β”‚  β”‚  β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β”β”Œβ”€β”€β” β”‚ β”‚                  β”‚
β”‚  β”‚  β”‚  β”‚N9β”‚β”‚10β”‚β”‚11β”‚β”‚12β”‚ β”‚ β”‚  β”‚  β”‚  β”‚13β”‚β”‚14β”‚β”‚15β”‚β”‚16β”‚ β”‚ β”‚                  β”‚
β”‚  β”‚  β”‚  β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜ β”‚ β”‚  β”‚  β”‚  β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜β””β”€β”€β”˜ β”‚ β”‚                  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚                  β”‚
β”‚  β”‚                          β”‚  β”‚                          β”‚                  β”‚
β”‚  β”‚  Queue: 15 queries       β”‚  β”‚  Queue: 8 queries        β”‚                  β”‚
β”‚  β”‚  Running: 8 queries      β”‚  β”‚  Running: 8 queries      β”‚                  β”‚
β”‚  β”‚  Avg Wait: 2.3s          β”‚  β”‚  Avg Wait: 1.1s          β”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚   Warehouse: WH_3       β”‚  β”‚   Warehouse: WH_4       β”‚  (Standby)      β”‚
β”‚  β”‚   Status: STANDBY        β”‚  β”‚   Status: STANDBY        β”‚                  β”‚
β”‚  β”‚                          β”‚  β”‚                          β”‚                  β”‚
β”‚  β”‚  Not yet started         β”‚  β”‚  Not yet started         β”‚                  β”‚
β”‚  β”‚  (Will start if queue    β”‚  β”‚  (Will start if queue    β”‚                  β”‚
β”‚  β”‚   > 10 for > 3 min)      β”‚  β”‚   > 10 for > 3 min)      β”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                                                                             β”‚
β”‚  SCALING POLICY:                                                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Scale UP (Larger nodes):     Scale OUT (More clusters):           β”‚   β”‚
β”‚  β”‚  ───────────────────────      ────────────────────────────          β”‚   β”‚
β”‚  β”‚  β€’ Query uses 1 cluster       β€’ Queue depth > 10                    β”‚   β”‚
β”‚  β”‚  β€’ More CPU/Memory per node   β€’ Sustained for > 3 minutes           β”‚   β”‚
β”‚  β”‚  β€’ Better for single queries  β€’ Better for concurrent queries       β”‚   β”‚
β”‚  β”‚  β€’ XS β†’ S β†’ M β†’ L β†’ XL       β€’ Auto-scale to Max clusters         β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                             β”‚
β”‚  AUTO-SUSPEND BEHAVIOR:                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Time          β”‚ Cluster 1 β”‚ Cluster 2 β”‚ Cluster 3 β”‚ Cluster 4    β”‚   β”‚
β”‚  β”‚  ──────────────┼───────────┼───────────┼───────────┼──────────    β”‚   β”‚
β”‚  β”‚  0:00 (start)  β”‚  ACTIVE   β”‚    ---    β”‚    ---    β”‚    ---       β”‚   β”‚
β”‚  β”‚  0:05 (heavy)  β”‚  ACTIVE   β”‚  ACTIVE   β”‚    ---    β”‚    ---       β”‚   β”‚
β”‚  β”‚  0:10 (peak)   β”‚  ACTIVE   β”‚  ACTIVE   β”‚  ACTIVE   β”‚    ---       β”‚   β”‚
β”‚  β”‚  0:15 (drop)   β”‚  ACTIVE   β”‚  ACTIVE   β”‚    ---    β”‚    ---       β”‚   β”‚
β”‚  β”‚  0:20 (idle)   β”‚  ACTIVE   β”‚    ---    β”‚    ---    β”‚    ---       β”‚   β”‚
β”‚  β”‚  0:25 (idle)   β”‚ SUSPENDED β”‚    ---    β”‚    ---    β”‚    ---       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

A micro-partition is a compressed, columnar data chunk (50–500 MB uncompressed) that serves as Snowflake's fundamental storage unit. Each micro-partition stores metadata including min/max values per column, distinct counts, and null counts, enabling partition pruning β€” skipping irrelevant micro-partitions during query execution.

A virtual warehouse is an independent compute cluster of 1–128 nodes, each containing CPU cores, RAM, and local SSD cache. Warehouses execute SQL queries and DML operations, scaling independently of storage. Multiple warehouses can access the same data simultaneously without contention.

Snowflake's compute-storage separation means warehouses are ephemeral β€” they can be started, stopped, or resized independently of persistent cloud storage (S3/Azure/GCS). This enables true multi-tenancy where different workloads use isolated compute resources.

  • Three-layer design: Cloud Services (metadata/optimization), Query Processing (warehouses), Storage (micro-partitions)
  • Micro-partition pruning eliminates 80–95% of data before scanning via metadata
  • Multi-cluster warehouses auto-scale from 1 to N clusters based on queue depth
  • Result cache accelerates repeated identical queries with zero compute
  • Compression ratio of 4–6Γ— across all data types reduces storage costs

Detailed Explanation

Snowflake's architecture represents a paradigm shift in cloud data warehousing, fundamentally rethinking how compute and storage interact in a distributed system. At its core, Snowflake implements a multi-cluster shared data architecture that completely separates compute resources from persistent cloud storage, enabling independent scaling of each layer without the traditional trade-offs that plagued earlier data warehouse systems.

The Three-Layer Architecture

Snowflake's architecture consists of three distinct but interconnected layers, each serving a specific purpose in the overall system design. The cloud services layer handles all metadata operations, query parsing, optimization, and security enforcement. This layer is fully managed by Snowflake and operates across all availability zones within a region, ensuring high availability and fault tolerance. The services layer maintains a centralized metadata store that tracks all objects, access control policies, and transaction states without requiring users to manage any infrastructure.

The query processing layer contains virtual warehouses that execute SQL queries and DML operations. Each virtual warehouse is an independent compute cluster consisting of multiple nodes, each with its own CPU, memory, and local SSD cache. Virtual warehouses can be scaled up (increasing node size) or scaled out (adding more clusters) independently of each other and the storage layer. This separation enables true multi-tenancy where different departments or workloads can use dedicated warehouses without resource contention.

The storage layer utilizes a revolutionary micro-partitioning scheme that automatically organizes data into compressed, columnar micro-partitions ranging from 50MB to 500MB in size. Unlike traditional partitioning, micro-partitions are automatically managed and do not require explicit definition by users. Each micro-partition maintains rich metadata including column-level min/max values, distinct counts, and null counts, enabling sophisticated partition pruning during query execution.

Micro-Partitioning and Automatic Clustering

Snowflake's micro-partitioning system operates transparently, automatically organizing data as it's ingested. When data is loaded, Snowflake divides it into micro-partitions and applies columnar compression using a combination of run-length encoding, dictionary encoding, delta encoding, and ZSTD compression. This typically achieves 4-6x compression ratios compared to raw data sizes.

The automatic clustering feature continuously optimizes data placement based on query patterns. When users define clustering keys, Snowflake automatically reorganizes micro-partitions to maximize data locality for those key columns. This background process runs asynchronously without impacting query performance and continuously adapts as data volumes grow and query patterns evolve.

Virtual Warehouse Architecture

Virtual warehouses in Snowflake are not traditional fixed-size compute clusters. Instead, they are elastic compute resources that can dynamically scale based on workload demands. Each warehouse consists of a pool of nodes, where each node contains CPU cores, RAM, and local SSD cache. The cache stores frequently accessed data and intermediate query results, reducing the need to fetch data from remote storage.

Multi-cluster warehouses extend this concept by automatically managing multiple independent clusters under a single logical warehouse. When the primary cluster becomes overloaded (typically measured by queue depth exceeding a threshold), Snowflake automatically starts additional clusters to handle the load. When the load decreases, clusters are automatically suspended to reduce costs. This automatic scaling happens transparently without any user intervention.

Data Flow and Query Execution

When a query arrives, the cloud services layer parses the SQL, generates an optimized query plan, and determines which virtual warehouse should execute it. The optimizer uses micro-partition metadata to perform sophisticated partition pruning, eliminating entire micro-partitions that cannot contain qualifying rows. This pruning can often eliminate 80-95% of data before any actual data scanning occurs.

During execution, the virtual warehouse fetches only the required micro-partitions from cloud storage, caches them locally, and processes them in parallel across all available nodes. Results are cached at multiple levels (node-level cache, warehouse-level cache, and global result cache) to accelerate subsequent identical or similar queries.

Key Concepts Table

ComponentDescriptionScaling BehaviorCost Model
Cloud ServicesMetadata, security, query optimizationAutomatic, serverlessIncluded in compute cost
Virtual WarehouseQuery execution, DML processingManual or auto-scalePer-second billing (60s minimum)
Micro-Partition50-500MB compressed columnar chunksAutomatic creationStorage cost only
Result CacheQuery result cachingAutomatic invalidationNo additional cost
StoragePersistent cloud blob storageAutomatic expansionPer TB per month
Warehouse SizevCPUMemoryMax Concurrent Queries
X-Small12 GB1
Small24 GB2
Medium48 GB4
Large816 GB8
X-Large1632 GB16
2X-Large3264 GB32
3X-Large64128 GB64
4X-Large128256 GB128
MetricValueDescription
Compression Ratio4-6xAverage compression across all data types
Micro-Partition Size50-500 MBTarget size after compression
Partition Pruning80-95%Average data skipped during queries
Result Cache Hit Rate30-70%Depends on query repetition patterns
Fail-Safe Retention7 daysAdditional protection beyond Time Travel

Code Examples

-- Example 1: Create a multi-cluster warehouse with specific configuration
CREATE WAREHOUSE analytics_wh
    WAREHOUSE_SIZE = 'xlarge'
    MIN_CLUSTER_COUNT = 1
    MAX_CLUSTER_COUNT = 5
    SCALING_POLICY = 'ECONOMY'
    AUTO_SUSPEND = 300
    AUTO_RESUME = TRUE
    INITIALLY_SUSPENDED = FALSE
    RESOURCE_MONITOR = 'analytics_monitor'
    COMMENT = 'Multi-cluster warehouse for analytics workloads';

-- Example 2: Configure warehouse with advanced settings
CREATE WAREHOUSE etl_wh
    WAREHOUSE_SIZE = '2xlarge'
    MIN_CLUSTER_COUNT = 2
    MAX_CLUSTER_COUNT = 4
    SCALING_POLICY = 'STANDARD'
    AUTO_SUSPEND = 60
    AUTO_RESUME = TRUE
    STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = 3600
    STATEMENT_TIMEOUT_IN_SECONDS = 86400
    COMMENT = 'ETL warehouse with aggressive scaling';

-- Example 3: Query micro-partition metadata
SELECT 
    partition_id,
    row_count,
    uncompressed_bytes,
    compressed_bytes,
    (uncompressed_bytes / compressed_bytes) as compression_ratio,
    created_time,
    last_modified_time
FROM TABLE(INFORMATION_SCHEMA.PARTITION_HISTORY(
    TABLE_NAME => 'sales_data',
    START_TIME => DATEADD(day, -7, CURRENT_TIMESTAMP())
))
ORDER BY created_time DESC;

-- Example 4: Analyze warehouse performance metrics
SELECT 
    warehouse_name,
    warehouse_size,
    cluster_number,
    AVG(queries_completed) as avg_queries,
    AVG(queued_overload_queries) as avg_queued,
    AVG(execution_time_ms) / 1000 as avg_exec_seconds,
    SUM(credits_used) as total_credits,
    AVG(bytes_scanned) / 1024 / 1024 / 1024 as avg_gb_scanned
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE start_time >= DATEADD(day, -30, CURRENT_TIMESTAMP())
GROUP BY 1, 2, 3
ORDER BY total_credits DESC;

-- Example 5: Monitor auto-scaling events
SELECT 
    warehouse_name,
    event_name,
    event_timestamp,
    event_reason,
    cluster_number
FROM TABLE(INFORMATION_SCHEMA.WAREHOUSE_LOAD_HISTORY(
    START_TIME => DATEADD(hour, -24, CURRENT_TIMESTAMP())
))
WHERE event_name IN ('RESUME', 'SUSPEND', 'ADD_CLUSTER', 'REMOVE_CLUSTER')
ORDER BY event_timestamp DESC;

-- Example 6: Analyze partition pruning effectiveness
SELECT 
    query_id,
    query_text,
    partitions_scanned,
    partitions_total,
    (partitions_scanned / partitions_total) * 100 as scan_percentage,
    bytes_scanned / 1024 / 1024 as mb_scanned,
    compilation_time_ms,
    execution_time_ms
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE start_time >= DATEADD(day, -1, CURRENT_TIMESTAMP())
  AND partitions_total > 0
ORDER BY scan_percentage DESC
LIMIT 100;

Performance Metrics

MetricTargetWarningCriticalDescription
Query Queue Depth< 55-10> 10Number of queries waiting to execute
Cluster Scaling Time< 30s30-60s> 60sTime to start additional cluster
Warehouse Utilization60-80%80-95%> 95%CPU/Memory utilization
Partition Pruning> 80%60-80%< 60%Percentage of partitions eliminated
Cache Hit Rate> 50%30-50%< 30%Result cache effectiveness
Auto-Suspend Delay60-300s300-600s> 600sTime before warehouse suspends

Best Practices

  1. Right-size warehouses: Start with Medium for ad-hoc queries, scale up for batch ETL. Monitor queue depth to identify under-provisioned warehouses.

  2. Use multi-cluster warehouses: Set MIN_CLUSTER_COUNT=1 and MAX_CLUSTER_COUNT=3-5 for concurrent workloads. Use SCALING_POLICY=ECONOMY for cost optimization.

  3. Implement warehouse isolation: Create separate warehouses for different workloads (ETL, reporting, ad-hoc) to prevent resource contention and enable independent scaling.

  4. Configure appropriate timeouts: Set STATEMENT_QUEUED_TIMEOUT for queries that shouldn't run indefinitely and STATEMENT_TIMEOUT to kill long-running queries.

  5. Leverage result cache: Ensure identical queries can hit the cache by avoiding non-deterministic functions. Use QUERY_TAG to group similar queries.

  6. Monitor partition pruning: Use QUERY_HISTORY to identify queries with poor pruning (< 60% data elimination). Consider adding clustering keys for frequently filtered columns.

  7. Implement resource monitors: Set up alerts for credit consumption to prevent unexpected costs. Use MAX_CREDIT_QUOTA per warehouse for budget control.

  8. Use automatic clustering: Define clustering keys on large tables (100GB+) that are frequently filtered. Start with low cardinality columns used in WHERE/JOIN clauses.

  9. Optimize data placement: Distribute data across micro-partitions based on query patterns. Regularly review CLUSTERING_INFORMATION() for clustering depth and overlap metrics.

  10. Cache management: Understand result cache invalidation rules (data modifications, DDL changes). Use PERSISTENT_RESULT_CACHE_VARCHAR for long-lived result sets.


See Also

Advertisement

Need Expert Snowflake Help?

Get personalized warehouse optimization, data modeling, or Snowflake platform consulting.

Advertisement