Skip to content
TeachTrails
Data EngineeringSnowflake

Snowflake Architecture Explained: Storage, Warehouses and Cloud Services

Snowflake's three layers made simple: micro-partitions, virtual warehouses, credits, the three caches and pruning, shown with real query timings.

Sukanya Saha, Technology Consultant

11 min read

Beginner friendly

The three layers

📊 Snowflake architecture

Cloud services

Always on, run by Snowflake

Login & security

Users, roles, MFA, keys

Metadata

Tables, micro-partition stats, history

Query optimizer

Plans each query, decides what to skip

Transactions

Keeps every read and write consistent

Query processing: virtual warehouses

You create, size, start and stop these

SHOPKART_WH

X-Small, loads and reports

BI_WH

Small, multi-cluster for dashboards

DS_WH

Large, for data science, run now and then

Database storage

Your data, kept once in cloud storage

Micro-partitions

Compressed, columnar, immutable files

LayerWhat it doesHow you pay
StorageHolds every table, compressed and split into micro-partitionsPer TB per month (after compression)
Compute (warehouses)Runs queries, loads and transformationsCredits per second while running, 60-second minimum per start
Cloud servicesLogins, metadata, query planning, security, transactionsFree up to 10% of the day's warehouse credits

This is sometimes called a hybrid design. Like a shared-disk system, all warehouses see the same data. Like a shared-nothing system, each warehouse has its own machines, memory and local SSD cache, so it never fights another warehouse for power.

Storage: micro-partitions

When you load a table, Snowflake automatically splits it into micro-partitions: files of about 50–500 MB of raw data (much smaller once compressed). You never create them yourself. Three things to know:

  • Columnar: each column is stored separately, so a query that needs 3 of 20 columns reads only those 3.
  • Immutable: files are never changed. An UPDATE writes new micro-partitions and retires the old ones (that's what makes Time Travel possible in lesson 6).
  • Self-describing: for every micro-partition, Snowflake records each column's min and max value, the number of distinct values and more.

That last point powers pruning. If a query asks for o_orderdate = '1995-06-17' and a micro-partition's dates run from 1992-01-01 to 1992-03-10, Snowflake doesn't even open it. Here it is on the sample data's 150-million-row orders table:

Snowsight · SQL
ALTER SESSION SET USE_CACHED_RESULT = FALSE;   -- force real work for this test

-- 150 million orders. How many were placed on one day?
SELECT COUNT(*) AS orders_that_day
FROM snowflake_sample_data.tpch_sf100.orders
WHERE o_orderdate = '1995-06-17';

-- How much of the table did Snowflake actually open?
SELECT operator_statistics:pruning:partitions_scanned AS partitions_scanned,
       operator_statistics:pruning:partitions_total   AS partitions_total
FROM TABLE(GET_QUERY_OPERATOR_STATS(LAST_QUERY_ID()))
WHERE operator_type = 'TableScan';
ORDERS_THAT_DAY
62365
PARTITIONS_SCANNEDPARTITIONS_TOTAL
16291

Snowflake opened 16 of 291 micro-partitions, about 5% of the table, because that table's data arrived in date order. No index, no setup. GET_QUERY_OPERATOR_STATS shows the same numbers you'd see in the Query Profile tab in Snowsight. In lesson 10 you'll learn what to do when data isn't naturally sorted (clustering keys).

Compute: virtual warehouses

A warehouse is created with one SQL statement. Here's the one we use for this whole course:

Snowsight · SQL (admin)
-- Run once by an admin (ACCOUNTADMIN or a role with CREATE WAREHOUSE)
CREATE WAREHOUSE IF NOT EXISTS shopkart_wh
  WAREHOUSE_SIZE      = XSMALL   -- smallest size: 1 credit per hour while running
  AUTO_SUSPEND        = 60       -- pause after 60 seconds of no queries
  AUTO_RESUME         = TRUE     -- wake up automatically when a query arrives
  INITIALLY_SUSPENDED = TRUE;    -- don't start (or bill) until first used
SizeCredits per hourTypical use
X-Small1Learning, small loads, light dashboards
Small2Daily ELT for a small company
Medium4Bigger transformations
Large8Heavy joins over hundreds of GB
X-Large → 6X-Large16 → 512Very large one-off jobs (each size doubles)

Resizing is one line, and it applies to the next queries (running ones finish on the old size):

Snowflake CLI · SQL
-- Need more power for a big job? Resize in one line (takes effect for new queries)
ALTER WAREHOUSE shopkart_wh SET WAREHOUSE_SIZE = SMALL;
SHOW WAREHOUSES LIKE 'SHOPKART_WH';

-- Back to the smallest size, and pause it now
ALTER WAREHOUSE shopkart_wh SET WAREHOUSE_SIZE = XSMALL;
ALTER WAREHOUSE shopkart_wh SUSPEND;
namestatesizeauto_suspendauto_resumemin_cluster_countmax_cluster_count
SHOPKART_WHSTARTEDSmall60true11

Scale up or scale out?

ProblemFixHow
One big query is slowScale up: a bigger sizeALTER WAREHOUSE ... SET WAREHOUSE_SIZE = LARGE
Many users, queries are queuingScale out: more clusters (Enterprise)MIN_CLUSTER_COUNT = 1, MAX_CLUSTER_COUNT = 4

A multi-cluster warehouse adds identical clusters automatically when queries start to queue and removes them when the rush is over. The SCALING_POLICY decides how eager it is: STANDARD adds clusters quickly (best for users waiting on dashboards), ECONOMY waits until there's enough work to keep a new cluster busy (saves credits).

The three caches

Snowflake avoids repeating work at three levels. Here's the most dramatic one, tested on our account:

Snowsight · SQL
-- Revenue per shipping mode in 1995 (6 million rows to scan)
SELECT l_shipmode, ROUND(SUM(l_extendedprice * (1 - l_discount))) AS revenue
FROM snowflake_sample_data.tpch_sf1.lineitem
WHERE l_shipdate BETWEEN '1995-01-01' AND '1995-12-31'
GROUP BY l_shipmode
ORDER BY revenue DESC;

-- ...then run exactly the same query a second time.
L_SHIPMODEREVENUE
REG AIR4766200040
SHIP4760054445
TRUCK4758514762
AIR4750920070
FOB4748878883
RAIL4746064357
MAIL4730601164
Snowsight · SQL
-- How long did each run take, and how much data did it read?
SELECT LEFT(query_text, 50) AS query, total_elapsed_time AS ms, bytes_scanned
FROM TABLE(information_schema.query_history_by_user(RESULT_LIMIT => 30))
WHERE query_text ILIKE 'SELECT l_shipmode%'
ORDER BY start_time;
QUERYMSBYTES_SCANNED
SELECT l_shipmode, ROUND(SUM(l_extendedprice * (1536165208128
SELECT l_shipmode, ROUND(SUM(l_extendedprice * (1670

The first run read 165 MB in 536 ms. The second read 0 bytes in 67 ms: the answer came straight from the result cache, without using the warehouse at all.

CacheWhere it livesWhat it holdsLasts
Result cacheCloud servicesFinal results of queries24 h after last use (max 31 days); cleared when the data changes
Local disk (warehouse) cacheEach warehouse's SSDMicro-partitions it has read recentlyUntil the warehouse suspends
MetadataCloud servicesRow counts, min/max per columnAlways; answers COUNT(*), MIN, MAX with no warehouse

What happens when you run a query

📊 Life of a Snowflake query

1. Cloud services

Checks your role, checks the result cache, plans the query

2. Prune

Uses min/max metadata to pick only the micro-partitions needed

3. Warehouse

Resumes if needed, reads columns (from SSD cache or storage), computes

4. Result

Returned to you and saved in the result cache

🎯 Interview questions on this topic

Try to answer out loud first, then tap to check.

Q1Explain Snowflake's architecture.Fresher
Three independent layers. Database storage keeps all data as compressed, columnar, immutable micro-partitions in cloud object storage. Query processing is done by virtual warehouses: independent compute clusters that read from that shared storage. Cloud services coordinate everything: authentication, access control, metadata, query parsing and optimization, and transactions. Because storage and compute are separate, each scales independently.
Q2What is a micro-partition and why is it useful?Fresher
Snowflake automatically divides tables into micro-partitions of roughly 50–500 MB uncompressed, stored by column. It keeps metadata for each one, like min/max values per column. The optimizer uses that metadata to prune: skip micro-partitions that can't contain matching rows, so queries read far less data without indexes.
Q3Scale up vs scale out: when do you use each?1–3 yrs
Scale up (a bigger size) when individual queries are slow because they process a lot of data; each size up roughly doubles resources and cost per hour. Scale out (a multi-cluster warehouse, Enterprise edition) when many concurrent queries queue; Snowflake adds clusters between MIN and MAX cluster count based on load and the scaling policy.
Q4Describe Snowflake's caching layers.1–3 yrs
Result cache in the cloud services layer: stores query results for 24 hours after last use; reused for an identical query if the data hasn't changed and no volatile functions are used; costs no warehouse credits. Warehouse local disk cache: SSD on the warehouse holds recently read micro-partitions, cleared when the warehouse suspends. Metadata cache: lets simple queries like COUNT(*), MIN or MAX be answered from metadata without a running warehouse.
Q5How does warehouse billing work?1–3 yrs
Credits per second while running, with a 60-second minimum each time it starts or resumes. Credits per hour double with each size: X-Small 1, Small 2, Medium 4 and so on. Auto-suspend stops billing when idle; auto-resume restarts on the next query.
Q6A team wants AUTO_SUSPEND = 1 second to save money. Good idea?3+ yrs
Usually not. Every resume is billed at least 60 seconds, so a warehouse with frequent queries that keeps suspending and resuming can cost more. It also throws away the local SSD cache, making the next queries slower. 60 seconds is a common default; for BI warehouses with steady traffic, a few minutes can be cheaper overall. Measure with WAREHOUSE_METERING_HISTORY.

Key takeaways

  • Data is stored once; warehouses come and go and never copy it.
  • Snowflake is fast without indexes because it skips micro-partitions it doesn't need.
  • Bigger size for big queries, more clusters for more users.
  • Caches make repeat work free, so turn the result cache off when you benchmark.

Frequently asked questions

What is a virtual warehouse in Snowflake?

A named group of computers (a compute cluster) that runs your queries. It holds no data of its own: it reads tables from shared storage. You choose its size, and it costs credits only while it is running.

What is a micro-partition?

The small file Snowflake splits every table into automatically: about 50–500 MB of data before compression, stored by column. Snowflake records the min and max value of each column in every micro-partition, so queries can skip the ones that can't match.

Does a bigger warehouse always make queries faster?

Usually for big queries that scan a lot of data, roughly halving the time each size up, at double the credits per hour, so the cost stays about the same. Small queries don't get faster, they just cost more. For many users at once, add clusters (scale out) instead of size.

How long does the result cache last?

24 hours from the last time the result was used, up to 31 days in total. It's reused only if the query text is the same, the underlying data hasn't changed, and the query has no functions like CURRENT_TIMESTAMP() that change on every run.

Do I pay for the cloud services layer?

Only if it uses more than 10% of your warehouse compute for that day. For normal use that never happens, so it's effectively free.

🧠 Quick check: Snowflake architecture

  1. 1. Which layer stores your table data?

  2. 2. An X-Small warehouse costs 1 credit/hour. What does a Medium cost?

  3. 3. You run the same query twice and the data didn't change. The second run...

  4. 4. 100 analysts open a dashboard at 9 a.m. and queries start queuing. Best fix?

  5. 5. Pruning means...

Snowflake for Beginners

Part 2 of 12: Snowflake Architecture Explained