big-data4 min read

Snowflake Tutorial: Learn Cloud Data from Scratch (2026)

Snowflake Tutorial: Learn Cloud Data from Scratch (2026)

Published:  |  Category: Big Data  |  Reading time: ~15 min
Snowflake Tutorial: Learn Cloud Data from Scratch (2026)

Snowflake is the cloud data warehouse that broke the mold. Unlike traditional warehouses that tightly couple storage and compute, Snowflake separates them completely — you pay for storage independently from compute, and you can scale compute up or down with zero downtime. I have migrated on-premise Teradata and Netezza systems to Snowflake, and the operational simplicity is the single biggest improvement. No indexes to tune, no partitions to manage, no distribution keys to design.

This tutorial covers what makes Snowflake unique: its hybrid architecture, virtual warehouses, micro-partitions, zero-copy cloning, and data sharing.

Architecture: Storage, Compute, and Services

Snowflake has three layers. Storage compresses data into micro-partitions in cloud blob storage. Compute consists of virtual warehouses — independent clusters of VMs. The services layer handles authentication, query optimization, and metadata management. This separation means you can run multiple warehouses on the same data with no contention.

Creating a new warehouse takes seconds. Warehouses can be suspended during idle periods to eliminate compute costs.

CREATE WAREHOUSE analytics_wh
  WITH WAREHOUSE_SIZE = 'SMALL'
  AUTO_SUSPEND = 300
  AUTO_RESUME = TRUE
  INITIALLY_SUSPENDED = TRUE;
ALTER WAREHOUSE analytics_wh SET WAREHOUSE_SIZE = 'LARGE';

Micro-Partitions and Automatic Clustering

Snowflake automatically divides table data into micro-partitions of 50-500 MB each. Each partition stores columns individually and maintains metadata: min/max values, null count, distinct count. This enables automatic pruning — queries with WHERE clauses skip irrelevant partitions.

Automatic clustering reorders partitions on specified columns. I set clustering keys on tables over 1 TB with frequently filtered columns.

SELECT * FROM TABLE(INFORMATION_SCHEMA.TABLE_STORAGE_METRICS)
  WHERE TABLE_NAME = 'ORDERS';
ALTER TABLE orders CLUSTER BY (order_date, customer_id);
ALTER TABLE orders RESUME RECLUSTER;

Time Travel and Zero-Copy Cloning

Time Travel allows querying historical data up to 90 days in the past using AT or BEFORE clause. Only changes consume additional storage, not full copies.

Zero-copy cloning creates a writable snapshot without duplicating storage. Changes create new micro-partitions only for modified data. I use cloning for development snapshots.

-- Query data as of 1 hour ago:
SELECT * FROM orders AT (TIMESTAMP => CURRENT_TIMESTAMP - INTERVAL '1 hour');
-- Clone a table:
CREATE TABLE orders_dev CLONE orders;
-- Undo a DROP TABLE:
UNDROP TABLE orders;

Data Sharing and the Marketplace

Snowflake data sharing lets you share live data with other accounts without copying or moving it. The provider creates a share with read-only access; the consumer imports the share as a database. This works cross-region and cross-cloud.

The Snowflake Marketplace extends sharing to third-party data providers like weather and financial data.

-- Provider creates a share:
CREATE SHARE sales_share;
GRANT USAGE ON DATABASE sales_db TO SHARE sales_share;
GRANT SELECT ON ALL TABLES IN SCHEMA sales_db.public TO SHARE sales_share;
ALTER SHARE sales_share SET ACCOUNTS = [CONSUMER_ACCOUNT];
-- Consumer imports:
CREATE DATABASE sales_data FROM SHARE PROVIDER_ACCOUNT.sales_share;

Stages and Data Loading

Stages are named locations for data files. Internal stages are stored within Snowflake; external stages reference cloud storage. COPY INTO loads data with transformation options: column reordering, type casting, and error skipping.

Snowpipe automates loading by continuously scanning staged files. I set up Snowpipe for near-real-time ingestion from Kafka.

CREATE STAGE s3_stage URL = 's3://my-bucket/sales/'
  CREDENTIALS = (AWS_KEY_ID = '...' AWS_SECRET_KEY = '...');
CREATE FILE FORMAT csv_format TYPE = CSV SKIP_HEADER = 1;
COPY INTO orders FROM @s3_stage FILE_FORMAT = (FORMAT_NAME = csv_format) ON_ERROR = 'CONTINUE';

Query Optimization and Profiling

The Query Profile in Snowsight shows every operator in the plan — where time was spent, how much data was scanned, and where pruning failed. The most common issue is full scans on large tables without partition pruning.

I use QUERY_HISTORY to identify expensive queries. Materialized views pre-compute aggregations for frequently accessed dashboards.

SELECT query_id, query_text, total_elapsed_time, bytes_scanned
FROM TABLE(INFORMATION_SCHEMA.QUERY_HISTORY())
ORDER BY total_elapsed_time DESC;

CREATE MATERIALIZED VIEW daily_sales AS
  SELECT order_date, SUM(amount) AS total FROM orders GROUP BY order_date;

Frequently Asked Questions

How does Snowflake differ from Redshift?

Snowflake separates compute from storage; Redshift couples them. Snowflake requires zero tuning (no sort keys or distribution keys). Redshift is cheaper at very large scales.

What are Snowflake credits?

Credits are the unit of compute consumption. Virtual warehouses use credits per second while running. Storage is billed separately per terabyte-month.

Can Snowflake handle semi-structured data?

Yes. Snowflake has native VARIANT, OBJECT, and ARRAY types for JSON, Avro, Parquet, ORC, and XML.

How do I control costs in Snowflake?

Set AUTO_SUSPEND on warehouses. Use resource monitors to cap credit consumption. Separate ETL and BI workloads into different warehouses.

Originally published on Ayodhyyya. Last updated June 1, 2026.