Snowflake

Snowflake Data Retention & Recovery: Time Travel, Fail-safe & Retention Design

2026-03-26
更新: 2026-03-27
NicheeLab Editorial Team

Snowflake data retention and recovery rely on two mechanisms: Time Travel and Fail-safe. Time Travel lets users access past data directly, while Fail-safe is the final line of defense Snowflake holds internally after Time Travel expires.

This article walks through the timeline of both mechanisms, retention by edition, differences across table types, and the impact on storage cost. It is a frequently tested topic on the SnowPro Core exam under Domain 6 (Data Protection & Data Sharing / 10-15% of the exam).

Data Retention Timeline

Starting from the moment data is changed (UPDATE/DELETE/DROP), retention follows the timeline below.

データ変更発生
  │
  ├── Time Travel期間(0〜90日)──────┐
  │   ユーザーがAT/BEFORE句で        │
  │   過去データに直接アクセス可能     │
  │   UNDROP TABLE/SCHEMA/DATABASE   │
  │   で復元可能                     │
  │                                  │
  ├── Fail-safe期間(7日間)─────────┐
  │   Snowflakeサポートによる        │
  │   データ復旧のみ可能             │
  │   ユーザーは直接アクセス不可      │
  │                                  │
  └── データ完全消去                  │
      復旧不可能

On Enterprise Edition (90-day Time Travel), data is protected for up to 97 days (90 + 7) after a change. On Standard Edition (Time Travel capped at 1 day), the maximum window is 8 days (1 + 7).

Time Travel in Detail

Access Syntax

SyntaxPurposeExample
AT(TIMESTAMP => <ts>)Query data as of a specific timestampAT(TIMESTAMP => '2026-03-25 10:00:00'::TIMESTAMP)
AT(OFFSET => <sec>)Query data N seconds in the pastAT(OFFSET => -3600) for one hour ago
AT(STATEMENT => <id>)Data as of a specific query executionAT(STATEMENT => '8e5d0ca9-...')
BEFORE(STATEMENT => <id>)Data immediately before a specific queryBEFORE(STATEMENT => '8e5d0ca9-...')

Recovery via UNDROP

Within the Time Travel window, tables, schemas, and databases dropped with DROP TABLE can be restored with UNDROP.

-- テーブルの復元
UNDROP TABLE sales;

-- スキーマの復元
UNDROP SCHEMA analytics;

-- データベースの復元
UNDROP DATABASE production;

If an object with the same name already exists, UNDROP fails. You need to rename the existing object first with ALTER TABLE ... RENAME.

Retention by Edition

EditionMax Time TravelFail-safe PeriodTotal Max Protection
Standard0-1 days7 days8 days
Enterprise0-90 days7 days97 days
Business Critical0-90 days7 days97 days
VPS (Virtual Private Snowflake)0-90 days7 days97 days

On Standard Edition, DATA_RETENTION_TIME_IN_DAYS is capped at 1 day. You need to upgrade to Enterprise or above to use the 90-day Time Travel window.

Data Retention by Table Type

Snowflake has three table types (Permanent / Transient / Temporary), each with different retention behavior. The differences between these three are a frequent exam topic.

Table TypeTime TravelFail-safeUse CaseStorage Cost
Permanent (default)0-90 days (Enterprise+)7 daysProduction data, master tablesHighest
Transient0-1 daysNone (0 days)Staging and intermediate tablesLow
Temporary0-1 daysNone (0 days)Per-session temporary workLowest

How to Choose a Table Type

  • Permanent: business-critical data. Use for master tables and fact tables that must be recoverable after mistakes. Protected by both Time Travel and Fail-safe.
  • Transient: data that can be re-created. Use for ETL staging tables, intermediate aggregations, and other data you can regenerate from the source. Storage cost is lower because Fail-safe is not applied.
  • Temporary: session-scoped data. The table is automatically dropped when the session ends. Not visible to other users. Ideal for analytical scratch tables.

Impact on Storage Cost

Time Travel and Fail-safe retention directly affect storage cost. Retained data is stored as pre-change snapshots (delta data), so tables that change frequently accumulate more storage cost.

Table TypeTime Travel = 90 daysFail-safeStorage Cost Impact
Permanent (10 GB table, full daily refresh)Up to 10 GB × 90 days of deltas7 days of deltasVery large
Transient (10 GB table, full daily refresh)Up to 10 GB × 1 day of deltasNoneSmall
Permanent (10 GB table, no updates)0 (no changes means no deltas)0None

Setting 90-day Time Travel on a table with frequent UPDATEs and DELETEs can drive storage cost up sharply. Tune DATA_RETENTION_TIME_IN_DAYS based on each table's importance and update frequency.

Retention Design Guidelines

Hierarchical Configuration Strategy

DATA_RETENTION_TIME_IN_DAYS can be set at the account, database, schema, and table levels, with lower-level settings overriding higher-level ones.

-- アカウントレベル(デフォルト30日)
ALTER ACCOUNT SET DATA_RETENTION_TIME_IN_DAYS = 30;

-- ステージングスキーマ(0日 = Time Travel無効)
ALTER SCHEMA staging SET DATA_RETENTION_TIME_IN_DAYS = 0;

-- 重要テーブル(90日 = 最大保持)
ALTER TABLE master_customers SET DATA_RETENTION_TIME_IN_DAYS = 90;

Recommended Configuration Patterns

Table CategoryRecommended Time TravelTable TypeRationale
Master tables (customers, products)30-90 daysPermanentGuarantee long recovery window after mistakes
Fact tables (sales, logs)7-30 daysPermanentCover recent operational mistakes
Staging tables0-1 daysTransientRecoverable via reload; optimize cost
Intermediate aggregation tables0-1 daysTransientRecoverable by re-running the calculation
Analytical scratch tables0 daysTemporarySession-scoped; no retention needed

Operational Notes on Fail-safe

  • Fail-safe recovery requires opening a ticket with Snowflake Support and takes hours to days. It is not an instant recovery path.
  • Fail-safe applies only to Permanent tables — not to Transient or Temporary tables.
  • Storage during the Fail-safe period is billed to you. To cut cost, consider using Transient tables.
  • The Fail-safe period (7 days) is fixed and cannot be changed by users.
  • Fail-safe is a last-resort insurance policy — normal operations should resolve recoveries through Time Travel and UNDROP.

Check Your Understanding

SnowPro Core - Data Protection

問題 1

On an Enterprise Edition Snowflake account, which statement about data retention for Transient tables is correct?

  1. Transient tables get up to 90 days of Time Travel and 7 days of Fail-safe.
  2. Transient tables are capped at 1 day of Time Travel and have no Fail-safe period.
  3. Transient tables can only be set to 0 days of Time Travel and never retain any change history.
  4. Transient and Permanent tables have identical data retention windows.

正解: B

Even on Enterprise Edition, Transient tables are capped at 1 day of Time Travel (you cannot set 90 days like Permanent tables). Transient tables also have no Fail-safe period (0 days). This is the defining trait of Transient tables and is why they cost dramatically less to store than Permanent tables. Option A describes Permanent tables. Option C is wrong because Time Travel can be set anywhere from 0 to 1 day (1 day is allowed). Option D is wrong because Transient and Permanent tables have very different retention behavior.

Frequently Asked Questions

What is the difference between Time Travel and Fail-safe?

Time Travel is a feature that lets users directly access and restore past data themselves using AT/BEFORE clauses. Enterprise edition and above allow up to 90 days of retention, and UNDROP TABLE/SCHEMA/DATABASE recoveries also operate within the Time Travel window. Fail-safe, on the other hand, is an internal Snowflake safety zone that protects data after Time Travel expires. During the 7-day Fail-safe period, you can recover data only by opening a ticket with Snowflake Support — users cannot access it directly. Fail-safe recovery can take hours to days and is positioned as a last resort.

Do Transient tables have Fail-safe?

No — Transient tables have no Fail-safe period (0 days). This is the defining trait of Transient tables and is what makes them dramatically cheaper to store than Permanent tables (which have 7 days of Fail-safe). Time Travel retention for Transient tables is 0-1 days on Standard Edition and 0-1 days on Enterprise and above (capped at 1 day). Permanent tables can have up to 90 days of Time Travel, but Transient tables are limited to 1 day even for Time Travel. Use Transient tables for ETL staging tables, intermediate tables, and other transient data that does not need recovery to optimize storage cost.

What are the default and maximum values of DATA_RETENTION_TIME_IN_DAYS?

DATA_RETENTION_TIME_IN_DAYS defaults to 1 day, which is the same across all editions. The maximum value depends on the edition: Standard Edition is fixed at 1 day (cannot be changed), while Enterprise and above support up to 90 days. The parameter can be set at the account, database, schema, and table levels, with lower-level settings overriding higher-level ones. For example, even if you set the account-level value to 30 days, you can disable retention on a specific staging table by setting it to 0. Longer retention increases storage cost, so choose a value that matches each table's importance.

Practice more Data Protection questions

Sharpen your understanding with questions from the Data Protection & Data Sharing domain

Try free questions

Related Snowflake Data Protection Articles

Time Travel: Complete Guide

AT/BEFORE clause syntax and how to use UNDROP

Fail-safe: Complete Guide

How Fail-safe works and its storage cost

80 Essential Snowflake Terms

Key exam terms organized by category

Snowflake Certifications Overview

All 11 exams: overview, fees, and prerequisites

Check what you learned with practice questions

Practice with certification-focused question sets

無料で問題を解いてみる
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Snowflake

Snowflake Certifications: All 11 Exams Explained (2026)

Every SnowPro certification — Associate, Core, Specialty, Ad...

Snowflake

Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)

All 11 SnowPro exams ranked by difficulty with study-time es...

Snowflake

Snowflake Study Guide: Fastest Pass Route by Exam (2026)

How to pass SnowPro certifications efficiently — official ma...

Snowflake

SnowPro Core (COF-C03): Complete Exam Guide (2026)

Pass the SnowPro Core exam — six domains, scope, sample ques...

Snowflake

SnowPro Associate Platform (SOL-C01): Complete Guide (2026)

The entry-level SnowPro Associate exam — scope, weighting, s...

Browse all Snowflake articles (103)
© 2026 NicheeLab All rights reserved.