How does Snowflake handle multi-statement transactions and ACID guarantees?

Quick Overview

Asks how Snowflake runs multi-statement transactions and how its storage design provides atomicity, consistency, isolation and durability. Tests knowledge of autocommit, the supported isolation level, write locking, and the practical caveats that can break an all-or-nothing data load.

How does Snowflake handle multi-statement transactions and ACID guarantees?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

You are writing a job that updates several Snowflake tables and must never leave them half-updated. How does Snowflake handle multi-statement transactions and ACID guarantees? ```hint Follow the files Think about where Snowflake keeps table data, whether those files are ever modified in place, and what a commit has to change for new rows to become visible. ``` ```hint Look at the edges Check what happens to an open transaction when one statement inside it fails, when a DDL statement runs in the middle of it, or when the client disconnects. ``` ### What a Strong Answer Covers - How explicit transactions and autocommit work, and what starts and ends a transaction. - How each ACID property maps onto Snowflake's storage and metadata design, including the isolation level it supports and what that level allows. - How concurrent writers interact (locks, waits, deadlocks) and what readers see while a write is in progress. - The practical caveats: DDL inside a transaction, failed statements, disconnected sessions, stored procedure scope, and constraints that are not enforced. ### Follow-up Questions - Two sessions run MERGE against the same table at the same time. What happens, and how would you design the pipeline to avoid long waits? - Inside one transaction you run the same SELECT twice and get different results. How is that possible under Snowflake's isolation level? - Snowflake does not enforce primary keys on standard tables. How would you keep a load from creating duplicate rows? - How would you find and clear a transaction left open by a crashed client?

Overview: Asks how Snowflake runs multi-statement transactions and how its storage design provides atomicity, consistency, isolation and durability. Tests knowledge of autocommit, the supported isolation level, write locking, and the practical caveats that can break an all-or-nothing data load.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

You are writing a job that updates several Snowflake tables and must never leave them half-updated. How does Snowflake handle multi-statement transactions and ACID guarantees?

What a Strong Answer Covers Guidance

  • How explicit transactions and autocommit work, and what starts and ends a transaction.
  • How each ACID property maps onto Snowflake's storage and metadata design, including the isolation level it supports and what that level allows.
  • How concurrent writers interact (locks, waits, deadlocks) and what readers see while a write is in progress.
  • The practical caveats: DDL inside a transaction, failed statements, disconnected sessions, stored procedure scope, and constraints that are not enforced.

Follow-up Questions Guidance

  • Two sessions run MERGE against the same table at the same time. What happens, and how would you design the pipeline to avoid long waits?
  • Inside one transaction you run the same SELECT twice and get different results. How is that possible under Snowflake's isolation level?
  • Snowflake does not enforce primary keys on standard tables. How would you keep a load from creating duplicate rows?
  • How would you find and clear a transaction left open by a crashed client?