π§ Time Travel & Recovery
Snowflake provides powerful, architecture-driven capabilities for data protection, cloning, and collaboration.
These features are possible because of Snowflakeβs immutable micro-partition storage, metadata services, and separation of compute and storage.
In this section, we explore four core architectural capabilities:
- β±οΈ Time Travel
- π‘οΈ Fail-Safe
- 𧬠Zero-Copy Cloning
- π Data Sharing
β±οΈ Time Travel β Rewind Your Dataβ
Architecture Mapping β Storage Layer + Cloud Services Layer
Time Travel allows accessing historical versions of data for a defined retention period.
It is essential for recovering accidentally deleted objects, comparing current vs past states, and performing historical analysis.
β How It Works (Architecturally)β
- Storage Layer β Maintains immutable micro-partition versions
- Cloud Services Layer β Tracks metadata, timestamps, transactions
π Key Features:β
- Restore dropped tables, schemas, databases
- Query data βas ofβ a timestamp or offset
- Recover overwritten or deleted data
π Retention Periods:β
- Standard Edition β 1 day
- Enterprise+ Editions β Up to 90 days (configurable)
π‘ Example:β
-- View table data as it existed 1 day ago
SELECT * FROM orders AT (OFFSET => -1);
-- Restore a dropped table
UNDROP TABLE orders;
π‘οΈ Fail-Safe β Emergency Recovery Mechanism
Architecture Mapping β Storage Layer (Deep Recovery) + Cloud Services
Fail-Safe is Snowflakeβs final layer of protection when Time Travel retention has expired. It is used only during severe data-loss scenarios.
π§© How It Works:β
- Storage Layer β Retains encrypted historical snapshots
- Cloud Services β Controls internal-only recovery workflow
π Key Highlights:β
- Provides an additional 7-day recovery window
- Managed only by Snowflake Support
- Not directly user accessible
- Designed for disaster recovery, not routine restores
π« Limitations:β
- β Cannot query data in Fail-Safe
- β Cannot restore specific objects manually
- β Requires Snowflake Support intervention
π¬ βFail-Safe is not for convenience β itβs for catastrophe.β
𧬠Zero-Copy Cloning β Instant, Storage-Efficient Clones
Architecture Mapping β Storage Layer + Metadata Services
Zero-Copy Cloning enables instant creation of full clones of databases, schemas, or tables without duplicating physical data.
π Why It Works:β
- Storage Layer β Uses immutable micro-partition versions
- Metadata Layer β Clones only reference existing partitions
Only when data in either object changes does Snowflake create new partitions.
β Highlights:β
- β‘ Instant clone creation
- πΈ No additional storage cost initially
- π§ͺ Ideal for Dev/Test or what-if analysis
- π Safe experimentation without touching production
π‘ Example:β
CREATE TABLE orders_clone CLONE orders;
CREATE SCHEMA dev_sales CLONE prod_sales;
π Data Sharing β Seamless, Secure Collaboration
π What is Data Sharing in Snowflake?β
Data Sharing in Snowflake is a feature that allows organizations to share live, real-time data with other Snowflake accounts without copying, moving, or transferring the data.
Instead of sending files, exports, or ETL pipelines, Snowflake shares secure metadata pointers to the data stored in your account.
π Types of Data Sharing & How They Work Architecturallyβ
1οΈβ£ Direct Data Sharing (Account-to-Account Sharing)β
Share live data with another Snowflake account without copying.
ποΈ How It Works Architecturallyβ
-
Storage Layer
- Data stays in the providerβs storage; no duplication.
-
Cloud Services Layer
- Manages metadata sharing via βsharesβ.
- Controls access (GRANT, REVOKE, privileges).
-
Compute Layer
- Consumer uses their own Virtual Warehouse to query shared data.
π Key Conceptβ
β‘οΈ Provider shares only metadata pointers, not data.
2οΈβ£ Private Sharing (Private Listings)β
Share curated datasets privately with selected customers or partners using Marketplace infrastructure.
ποΈ How It Works Architecturallyβ
-
Storage Layer
- Providerβs data remains in their account.
-
Cloud Services Layer
- Creates a private listing linked to a share object.
- Controls visibility of the listing to selected accounts.
-
Compute Layer
- Consumer runs queries with their warehouse.
π Key Conceptβ
β‘οΈ A listing is just a controlled metadata wrapper around a share.
3οΈβ£ Public Sharing (Snowflake Marketplace / Public Listings)β
Publish datasets that any Snowflake customer can discover and subscribe to.
ποΈ How It Works Architecturallyβ
-
Storage Layer
- Data remains stored once; Marketplace does not duplicate it.
-
Cloud Services Layer
- Handles marketplace catalog, entitlement, and subscription logic.
- Maps subscriptions to underlying share objects.
-
Compute Layer
- Each subscriber queries data using their own compute.
π Key Conceptβ
β‘οΈ Marketplace uses the same sharing architecture with an added discovery/catalog layer.
4οΈβ£ Cross-Region Data Sharing (with Replication)β
Share data from one Snowflake region to another (e.g., AWS us-east-1 β eu-west-2).
ποΈ How It Works Architecturallyβ
-
Storage Layer
- Database replication creates physical copies of micro-partitions in another region.
- Replication happens automatically & incrementally.
-
Cloud Services Layer
- Manages replication schedules, versioning, metadata sync.
- Ensures consistent state across regions.
-
Compute Layer
- Consumers still use their own warehouse.
π Key Conceptβ
β‘οΈ Replication enables live data sharing even when regions are isolated.
5οΈβ£ Cross-Cloud Sharing (AWS β Azure β GCP)β
Share data across different cloud platforms.
ποΈ How It Works Architecturallyβ
-
Storage Layer
- Database replication copies micro-partitions to the target cloud.
- Snowflake abstracts underlying cloud differences.
-
Cloud Services Layer
- Manages encryption, metadata sync, cross-cloud identity mapping.
-
Compute Layer
- Consumers compute on their cloudβs Snowflake region.
π Key Conceptβ
β‘οΈ Cross-cloud sharing = replication + metadata-based access control.
6οΈβ£ Reader Accounts (For Users Without Snowflake)β
Provide live shared data to partners who do not have a Snowflake account.
ποΈ How It Works Architecturallyβ
-
Storage Layer
- Data remains in the providerβs storage.
-
Cloud Services Layer
- Provider creates a βReader Accountβ (fully managed by provider).
- Controls all metadata, security, and access.
-
Compute Layer
- Providers pay for compute used by the reader account (because it belongs to the provider).
π Key Conceptβ
β‘οΈ Provider controls compute + storage for the consumer.
π― Final Summary Table β Data Sharing Architecture
| Sharing Type | Storage Layer | Cloud Services Layer | Compute Layer | Notes |
|---|---|---|---|---|
| Direct Sharing | Data stays with provider | Manages metadata shares | Consumer uses own compute | No data movement |
| Private Sharing | Same as Direct | Listing + entitlement | Consumer compute | Private visibility |
| Public Marketplace | Same | Listing catalog + subscription | Consumer compute | Public listing |
| Cross-Region | Replication required | Metadata + sync | Consumer compute | Multi-region |
| Cross-Cloud | Replication across clouds | Security + sync | Consumer compute | Multi-cloud |
| Reader Accounts | Provider storage | Provider manages reader account | Provider compute | For non-Snowflake users |
π― Final Summary
| Feature | Purpose | User Access? | Duration | Key Benefit |
|---|---|---|---|---|
| β±οΈ Time Travel | Restore/query historical data | Yes | 1β90 days | Flexible recovery |
| π‘οΈ Fail-Safe | Emergency deep recovery | No | 7 days | Disaster protection |
| 𧬠Zero-Copy Cloning | Instant environment copies | Yes | Permanent | Cost-efficient, fast |
| π Data Sharing | Seamless external collaboration | Yes | Permanent | Share without copying |
β Frequently Asked Questions (FAQ)
Below are Few FAQs covered in this module.
- Time Travel
- Fail-Safe
- Zero-Copy Cloning
- Data Sharing
1. What is the difference between Time Travel and Fail-Safe?
2. Does Zero-Copy Cloning create a full physical copy?
No. Zero-Copy Cloning uses metadata pointers to reference existing micro-partitions. Data is copied only when modified after cloning.
3. Is Data Sharing secure, and how is access controlled?
Yes β Data Sharing is highly secure.
- No data copies or movement
- Consumers use read-only access
- Providers control access using shares + GRANT privileges
- Access can be revoked immediately
4. Does Time Travel increase storage usage and cost?
Yes. The longer the retention period, the more historical micro-partitions Snowflake keeps. Workloads with frequent updates generate more retained history β more cost.
5. Can Fail-Safe be disabled or customized?
No. Fail-Safe is:
- Mandatory
- Fully managed by Snowflake
- Always 7 days
- Not configurable
It is part of Snowflakeβs internal disaster-recovery design.
6. Does a cloned object inherit Time Travel history?
Yes. A Zero-Copy Clone inherits the full Time Travel history of the source at the time of cloning. After that, both objects maintain their history separately.
7. Are permissions copied when I create a clone?
No. Cloning copies:
- Data
- Structure
But does NOT copy:
- Privileges
- GRANT roles
- Access rights
You must reassign permissions to the clone.
8. Is Data Sharing read-only for consumers?
Yes. Consumers can only:
- Query data
- Create their own views on top of shared data
They cannot:
- Insert
- Update
- Delete
- Alter the providerβs data
Data Sharing is always read-only.
9. Can I clone objects across databases or environments?
Yes. Zero-Copy Cloning works across:
- Schemas
- Databases
- Environments (e.g., DEV β QA β PROD)
Example:
CREATE TABLE qa.sales.orders_clone CLONE prod.sales.orders;
10. Can Data Sharing be used across different clouds or regions?
Yes. Snowflake supports cross-cloud and cross-region sharing between:
- AWS
- Azure
- GCP
This requires replication but still provides live, real-time shared data.