Database / Snowflake Interview Questions
What is Snowpipe and how does it enable continuous / serverless data ingestion?
Snowpipe is Snowflake's serverless, event-driven data ingestion service. Unlike COPY INTO which requires a running Virtual Warehouse and an explicit trigger, Snowpipe uses Snowflake-managed serverless compute and fires automatically when new files arrive in a stage. Typical latency is under one minute from file arrival to data being queryable.
Snowpipe supports two trigger modes. Auto-ingest (preferred): you configure the cloud storage bucket to emit event notifications — Amazon SQS for S3, Azure Event Grid for Blob Storage, Google Pub/Sub for GCS — to Snowflake. When files land, the notification triggers the pipe automatically with no polling needed. REST API mode: call Snowpipe's REST endpoint programmatically with a list of file paths; useful when you control the producer and need deterministic triggering.
Billing is based on compute seconds consumed for loading, not warehouse credits. This makes Snowpipe cost-effective for small, frequent file arrivals that would otherwise require a warehouse to run continuously.
-- Create a pipe that auto-triggers on new S3 files
CREATE PIPE orders_pipe
AUTO_INGEST = TRUE
AS
COPY INTO orders
FROM @my_s3_stage/orders/
FILE_FORMAT = (TYPE = 'JSON');
-- After creation, retrieve the SQS ARN and configure S3 event notification
SHOW PIPES LIKE 'orders_pipe';
More Related questions...