Menu

Snowflake course · Lesson 1 of 14

Snowflake for Data Engineers

Snowflake for Data Engineers: architecture, virtual warehouses, loading data, ELT modelling, micro-partitions and pruning, governance, Time Travel and cost.

  • Intermediate
  • Pillar guide
  • 9 min read
  • Updated Oct 2026
On this page
  1. Where Snowflake fits in a data platform
  2. Core concepts
  3. A worked example: load, merge, protect
  4. Snowflake vs Databricks
  5. What this course covers
  6. Common beginner mistakes
  7. What interviewers ask
  8. Key takeaway

Snowflake is a cloud data warehouse that you use as a service. You do not install or patch anything, and you do not manage files or indexes: you create databases, load data, write SQL (or Python through Snowpark), and pay for the compute you use and the storage you keep. As a data engineer, your job on Snowflake is to load data reliably, model it into tables people can trust, keep queries fast by letting Snowflake skip data, and keep credit spending under control.

This page is the course map: what Snowflake is, the core concepts every lesson builds on, a small end-to-end example, how it compares with Databricks, the lessons in order, and what interviewers ask.

Where Snowflake fits in a data platform

Layer Typical tools Snowflake piece
Sources OLTP databases, SaaS apps, event streams, files Stages over S3, Azure Blob or GCS; Snowpipe and Snowpipe Streaming; connectors and partner ELT tools
Storage Warehouse or lakehouse tables Snowflake tables in compressed columnar micro-partitions; Apache Iceberg tables in your own storage
Transformation SQL, dbt, Python SQL and dbt on virtual warehouses; Streams and Tasks; Dynamic Tables; Snowpark
Orchestration Airflow, dbt Cloud, Tasks Tasks and task graphs for in-warehouse scheduling; external orchestrators for cross-system flows
Serving BI, data apps, partners Warehouses for BI tools; Secure Data Sharing and Marketplace listings

In an ELT design, Snowflake is both the landing zone and the transformation engine: raw data is loaded as is, then transformed inside Snowflake with SQL. That is why loading, modelling and cost control are the three skills interviews probe most.

Core concepts

  • Three layers. Storage keeps table data once, in compressed columnar micro-partitions in cloud object storage that Snowflake manages. Compute is any number of virtual warehouses, independent clusters that read the same storage. Cloud services handle authentication, metadata, query parsing and optimisation, and transactions. Because storage and compute are separate, a loading warehouse and a BI warehouse never compete for CPU.
  • Virtual warehouses. Sized from X-Small upwards, each size roughly doubling compute and credit rate. They bill per second while running (with a 60-second minimum each time they start), auto-suspend when idle and auto-resume on the next query. Multi-cluster warehouses (Enterprise edition and above) add clusters for concurrency.
  • Micro-partitions and pruning. Each micro-partition stores metadata such as min and max per column. A filter on a column whose values are well clustered lets Snowflake skip most partitions without reading them. Pruning, not indexes, is the main performance lever; clustering keys and the Search Optimization Service help specific large tables.
  • Loading. Files are staged (internal or external stages) and loaded with COPY INTO, which remembers which files it loaded, or continuously with Snowpipe (file-based) and Snowpipe Streaming (row-based).
  • Change processing. Streams track row changes on a table since the last consumption; Tasks run SQL on a schedule or when a stream has data; Dynamic Tables declare a query plus a target lag and Snowflake refreshes them.
  • Data protection. Time Travel lets you query or restore data as it was: 1 day by default, up to 90 days on Enterprise edition and above for permanent tables. Fail-safe is a further 7-day recovery period, run by Snowflake support, for permanent tables. Zero-copy cloning copies a table, schema or database instantly by sharing micro-partitions.
  • Access control. Role-based: privileges go to roles, roles go to users and to other roles. Masking policies, row access policies and tags protect sensitive data.

A worked example: load, merge, protect

A small but realistic daily flow: raw CSV files land in S3, a dedicated warehouse loads them, and a MERGE keeps a clean customers table current. The storage integration s3_int is assumed to exist (an administrator creates it once, because it references cloud IAM).

-- 1. Compute for loading only; stops billing after 60 idle seconds
CREATE WAREHOUSE IF NOT EXISTS load_wh
  WAREHOUSE_SIZE = 'XSMALL' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE INITIALLY_SUSPENDED = TRUE;

-- 2. Raw landing table and an external stage over the bucket
CREATE TABLE IF NOT EXISTS raw.crm.customers_raw (
  customer_id STRING, email STRING, country STRING, updated_at TIMESTAMP_NTZ,
  _file STRING, _loaded_at TIMESTAMP_LTZ DEFAULT CURRENT_TIMESTAMP());

CREATE STAGE IF NOT EXISTS raw.crm.crm_stage
  URL = 's3://acme-crm-exports/customers/'
  STORAGE_INTEGRATION = s3_int
  FILE_FORMAT = (TYPE = CSV SKIP_HEADER = 1 FIELD_OPTIONALLY_ENCLOSED_BY = '"');

-- 3. Load new files only; COPY skips files it already loaded (load metadata)
USE WAREHOUSE load_wh;
COPY INTO raw.crm.customers_raw (customer_id, email, country, updated_at, _file)
  FROM (SELECT $1, $2, $3, $4, METADATA$FILENAME FROM @raw.crm.crm_stage)
  PATTERN = '.*2026-10-15.*[.]csv'
  ON_ERROR = ABORT_STATEMENT;

-- 4. Upsert the latest version of each customer into the clean table
MERGE INTO analytics.core.customers AS t
USING (
  SELECT customer_id, lower(email) AS email, country, updated_at
  FROM raw.crm.customers_raw
  QUALIFY ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY updated_at DESC) = 1
) AS s
ON t.customer_id = s.customer_id
WHEN MATCHED AND s.updated_at > t.updated_at THEN
  UPDATE SET email = s.email, country = s.country, updated_at = s.updated_at
WHEN NOT MATCHED THEN
  INSERT (customer_id, email, country, updated_at) VALUES (s.customer_id, s.email, s.country, s.updated_at);

-- 5. Safety net: compare with the table as it was an hour ago
SELECT COUNT(*) FROM analytics.core.customers AT (OFFSET => -3600);

The design choices are the lesson. Why each piece is there:

  • A separate, small, auto-suspending warehouse isolates load cost.
  • COPY INTO’s load metadata makes re-running step 3 safe.
  • QUALIFY removes duplicate keys, so the MERGE is deterministic. (Snowflake raises an error when several source rows match one target row and would update it differently, unless you change a session parameter.)
  • The updated_at guard stops replays overwriting newer data.
  • Time Travel lets you check or undo a bad run. In production, steps 3 and 4 would run from a Task, a dbt model or an orchestrator, and step 5 would be a data-quality check.

Snowflake vs Databricks

Snowflake Databricks
Starting point Managed SQL warehouse Spark and a lakehouse on open files
Default storage Snowflake-managed micro-partitions (Iceberg tables in your storage optional) Delta Lake in your object storage (Iceberg supported)
Strongest at SQL-first ELT and BI, low administration, data sharing Large Spark and Python pipelines, streaming, ML on the same data
Compute Virtual warehouses and serverless features, billed in credits Clusters, serverless and SQL warehouses, billed in DBUs
Python Snowpark (DataFrame API pushed down to SQL), Python UDFs and procedures Native PySpark and Python on clusters

Both run SQL warehouses, Python and governed open tables now, so decide by workload, team skills and existing platform, not by benchmarks. See Snowflake vs Databricks for the full comparison.

What this course covers

  1. Snowflake for Data Engineers (this page): the map and core vocabulary.
  2. Snowflake Architecture: Storage, Compute and Cloud Services: the three layers, warehouses, caching and editions.
  3. Loading Data into Snowflake: Stages, COPY INTO and Snowpipe: stages, file formats, load metadata, Snowpipe and Snowpipe Streaming.
  4. Snowflake Virtual Warehouses: Sizing, Scaling and Concurrency: scale up versus out, multi-cluster policies, queueing.
  5. Micro-Partitions, Clustering and Search Optimization: pruning, clustering depth, when a clustering key pays.
  6. Time Travel, Fail-safe and Zero-Copy Cloning: recovery, retention costs, clones for testing and backfills.
  7. Table Types and Semi-Structured Data: permanent, transient and temporary tables, VARIANT and FLATTEN, Dynamic and Iceberg tables.
  8. Streams and Tasks: change data capture inside Snowflake and scheduled task graphs.
  9. Snowflake Security: RBAC design, masking and row access policies, network policies.
  10. Snowflake Cost Optimization: credits, right-sizing, storage costs and spend monitoring.
  11. Data Sharing, Reader Accounts and the Marketplace: sharing data without copying it.
  12. Snowflake vs Databricks: a workload-based comparison.

Supporting material: ETL vs ELT, star schema, the cloud data warehouse case study and the Snowflake cheat sheet.

Common beginner mistakes

  1. One big shared warehouse for everything. Loads, dbt runs and dashboards then queue behind each other and cost cannot be attributed. Use a warehouse per workload.
  2. Scaling up to fix a slow query. If the query scans most micro-partitions, a bigger warehouse just scans them faster at a higher rate. Check pruning and the Query Profile first; scale out (multi-cluster) for concurrency, up for genuinely heavy single queries.
  3. Long or disabled auto-suspend. An idle warehouse still bills. Short auto-suspend values suit most ad hoc and batch warehouses.
  4. Wrapping filter columns in functions. WHERE TO_DATE(event_ts) = '2026-10-15' can prune worse than a range on the raw column (event_ts >= '2026-10-15' AND event_ts < '2026-10-16').
  5. Adding clustering keys to small or rarely filtered tables. Automatic Clustering costs credits; it pays only on large tables with selective, repeated filters.
  6. Full reloads with TRUNCATE and INSERT when an incremental MERGE, stream or Dynamic Table would do, and the reverse: building streams and tasks for a table small enough to rebuild in seconds.
  7. Granting privileges to users directly or using ACCOUNTADMIN for daily work. Grant to functional roles and keep admin roles for administration.
  8. Making every table permanent with long Time Travel. Staging and scratch tables can be transient to avoid Time Travel and Fail-safe storage.

What interviewers ask

All of them are in Top 50 Snowflake Interview Questions and Answers. Good answers connect the feature to cost: credits per second of warehouse time, storage for Time Travel and clones, and serverless features that bill separately.

Key takeaway

Snowflake stores data once in micro-partitions and lets many independent warehouses query it. Load with stages and COPY INTO or Snowpipe, transform with SQL in layers, make queries prune, give each workload its own auto-suspending warehouse, and use Time Travel, cloning and roles as your safety nets.

By , Data Engineer and Founder of DataDank · Last reviewed Oct 2026 · Describes Snowflake as documented in October 2026. Snowflake SQL needs a Snowflake account, so the worked example was checked against the documentation, not executed. Feature availability can depend on edition and cloud region.

Progress is saved in this browser only. No account needed.

Search
Filter by type