Explain Time Travel and Zero-Copy Cloning in Snowflake
Instruction: Discuss the concepts of Time Travel and Zero-Copy Cloning in Snowflake and how they can be used in data management.
Updated
Official answer
Time Travel lets you query historical data, clone supported objects at a prior point, or restore supported dropped objects within their effective retention window. It can help investigate a bad load or recover from an accidental deletion.
Retention depends on object type and edition. Standard retention is one day; eligible permanent objects on Enterprise Edition or higher can retain up to 90 days. Temporary and transient tables have shorter limits. A zero-day setting can disable historical recovery, subject to applicable minimum-retention settings. Verify the actual object configuration before promising recovery.
Zero-copy cloning of standard tables creates a new object that initially references existing micro-partitions. Source and clone then evolve independently. New or retained partitions create storage costs, so “zero copy” does not mean permanently free storage or a live synchronized replica. Hybrid-table cloning has different storage behavior.
For a test environment, clone the required data, restrict access, apply appropriate masking and set an expiry. Production-sensitive data remains sensitive in a clone. Validate dependencies and object-specific cloning limitations.
Time Travel and cloning are useful recovery tools, but they do not by themselves establish an independent disaster-recovery plan or complete audit trail. Fail-safe is a separate Snowflake-managed recovery mechanism, not an extension of ordinary user Time Travel. Test the actual recovery procedure and business invariants.