Skip to main content
๐Ÿ“˜ Complete PDF

Snowflake Certification Practice Test 07

Practice Test 07

Question 1 of 20
๐Ÿ“‹ Multiple Choice
Question 101
A newly joined Data Engineer at a global retail company reviews the following nightly batch design: - Customer table contains 500 million records - Only ~10,000 records change or insert each day - Current pipeline reloads the entire 500 million record table from scratch every night Management demands a solution that slashes pipeline runtime and virtual warehouse credit consumption. What is the BEST architectural recommendation?
A. Scale up the virtual warehouse to 4X-Large permanently
โœ“
B. Implement Incremental Loading using Change Data Capture (CDC)
C. Create multiple redundant databases across cloud regions
D. Increase Time Travel retention from 1 day to 90 days
Answer
โœ… B. Implement Incremental Loading using Change Data Capture (CDC)
Explanation

1. Concept Overview / Core Concept / Direct Confirmation Incremental loading with Change Data Capture (CDC) processes only newly inserted, updated, or deleted rows since the last execution, rather than reprocessing the entire historical dataset.

2. Why This Answer Is Correct / Detailed Breakdown Re-scanning and rewriting 500 million records to apply 10,000 modifications is an extreme anti-pattern that burns compute credits and locks resources. By implementing CDC (via Snowflake Streams and `MERGE`), the pipeline processes only the 10,000 modified rows, reducing compute runtime from hours to seconds and dropping credit spend by over 95%.

3. Why Other Options Are Incorrect / Distractor Analysis - **A. Scale up to 4X-Large:** Oversizing compute accelerates the full reload slightly but multiplies cloud credit consumption, treating the symptom rather than fixing the inefficient architectural design. - **C. Multiple Redundant Databases:** Duplicating databases across regions multiplies storage costs and does nothing to solve the nightly reload bottleneck. - **D. Increase Time Travel to 90 Days:** Time Travel preserves historical micro-partitions for recovery; it does not optimize or accelerate nightly ETL loading.

4. Architectural & Execution Context / Physical Execution Snowflake enables native CDC by tracking transactional offsets in micro-partitions. Streams create an immutable change log (`METADATA$ACTION`, `METADATA$ISUPDATE`, `METADATA$ROW_ID`) that can be consumed in a single atomic transaction.

5. Practical Code Example

-- Implementing CDC incremental merge using Snowflake Streams
-- 1. Create stream on source landing table
CREATE OR REPLACE STREAM customer_landing_stream ON TABLE raw_customers;

-- 2. Incrementally merge only changed records into the 500M target table
MERGE INTO target_customers t
USING customer_landing_stream s
ON t.customer_id = s.customer_id
WHEN MATCHED AND s.METADATA$ACTION = 'DELETE' THEN DELETE
WHEN MATCHED AND s.METADATA$ACTION = 'INSERT' AND s.METADATA$ISUPDATE = TRUE THEN
    UPDATE SET t.customer_name = s.customer_name, t.email = s.email, t.updated_at = CURRENT_TIMESTAMP()
WHEN NOT MATCHED AND s.METADATA$ACTION = 'INSERT' AND s.METADATA$ISUPDATE = FALSE THEN
    INSERT (customer_id, customer_name, email, updated_at)
    VALUES (s.customer_id, s.customer_name, s.email, CURRENT_TIMESTAMP());

6. Key Takeaway Incremental loading via CDC processes only delta records, slashing compute runtimes and credit consumption on large datasets.

7. Best Practice & Production Recommendation Always pair Snowflake Streams with `MERGE` statements inside scheduled Tasks to automate incremental ELT pipelines.

8. Real-World Engineering Scenario A retail company took 3.5 hours nightly on an X-Large warehouse to reload 500M customer rows. Transitioning to Streams and an incremental MERGE cut runtime to 45 seconds on an X-Small warehouse, saving $40,000 annually.

9. Common Exam Trap / Anti-Pattern / Misconception Avoid full table truncations and reloads in production data warehouses once tables grow past a few gigabytes; incremental CDC is the industry standard.

10. Related InsightfulSaga Tutorial Master these concepts in [Snowflake ETL and Architecture](/tutorials/snowflake/snowflake-incremental-loading-cdc).

Answered: 0 / 20
Question Navigator (Test 07)0% Answered