100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Data Warehouse & Analytics Engineering
30 minadvanced

Loading Data with COPY INTO and Snowpipe

Loading data into Snowflake efficiently requires choosing between two complementary loading mechanisms: COPY INTO for batch loading and Snowpipe for continuous micro-batch loading. COPY INTO is a SQL command that reads one or more files from a Stage and inserts them into a Snowflake table in a single batch operation, leveraging the full Virtual Warehouse compute for maximum throughput. Snowpipe is a serverless, event-driven data ingestion service that automatically loads files as soon as they arrive in a Stage, with sub-minute latency and without requiring a running Virtual Warehouse.

The choice between COPY INTO and Snowpipe follows the same batch-vs-streaming decision made for all data loading patterns. COPY INTO is appropriate when data arrives in scheduled batches (hourly, daily), high throughput is more important than low latency, and the loading workflow is orchestrated by Airflow or dbt. Snowpipe is appropriate when data must be available in Snowflake within minutes of landing in S3 or Azure Blob, ingestion volume is unpredictable, and the overhead of maintaining a Virtual Warehouse for occasional small loads is cost-prohibitive.

Analogy🏏Cricket
🏏 Think of it like cricket: OLTP is the IPL's live ticketing counter — it handles thousands of simultaneous seat reservations, each requiring a precise single-seat record update with immediate confirmation. Speed per transaction and data consistency under concurrent updates are everything. OLAP is the IPL's season statistics department — it runs complex analytical queries across every ball bowled in every match of every season to produce the published rankings, economy rates, and historical comparisons. No one books a seat through the statistics department, and no broadcaster calls the ticketing counter for Bumrah's career economy rate. The two workloads demand completely different systems. Just as the ticketing counter is built for speed and correctness on one seat at a time and would buckle if asked to tally a decade of attendance mid-sale, an OLTP row-store excels at single-record writes but chokes on full-table aggregation; and just as the statistics department pores over millions of past deliveries but would be hopeless at booking a live seat under contention, the OLAP columnar engine sweeps billions of rows yet is the wrong tool for a fast single-row update. The physical design of each — row-oriented for the counter, columnar for the stats desk — is what makes it superb at its own job and unfit for the other's.
Lesson 8 of 35
0% complete