AdvancedLast updated: 2026-04-09 • 2 sections
Expert questions on database replication, replication groups, failover, disaster recovery, cross-region and cross-cloud patterns.
Q: How does Snowflake database replication work?
Replication copies databases (or replication groups of databases, shares, users, roles) from a primary account to one or more secondary accounts. Uses change-based replication: only modified micro-partitions are transferred. Cross-region and cross-cloud supported. Secondary databases are read-only until failover. Replication runs on a schedule (minimum 1 minute) or on-demand via ALTER DATABASE REFRESH.
Q: What are replication groups vs database replication?
Database replication: replicates a single database. Replication groups: replicate multiple databases, shares, users, roles, and warehouses as a unit with consistent point-in-time snapshots. Groups ensure referential integrity across objects. Use groups for DR (replicate everything needed to run the application). Use single DB replication for data sharing or analytics replication.
Q: Design a disaster recovery architecture with RPO < 5 min and RTO < 30 min.
Architecture: (1) Primary account in us-east-1, secondary in us-west-2. (2) Replication group containing all databases, roles, warehouses. (3) Replication schedule: every 1-2 minutes for RPO < 5 min. (4) Monitor replication lag via REPLICATION_GROUP_REFRESH_HISTORY. (5) Failover procedure: ALTER FAILOVER GROUP fg PRIMARY (promotes secondary). RTO depends on: DNS switching time, application reconnection, cache warming. (6) Test failover quarterly. (7) After failover: the old primary becomes secondary. Costs: replication transfer + storage in secondary region.
Q: What is the difference between failover and failback?
Failover: promoting a secondary account/database to primary when the original primary is unavailable. Failback: returning to the original primary after it recovers. In Snowflake: failover is ALTER FAILOVER GROUP ... PRIMARY on the secondary. Failback is the same command on the recovered original. Both are metadata operations (fast) but applications need to reconnect to the new primary. Critical: ensure DNS/connection strings are abstracted so switching is seamless to applications.
Q: How is replication billed?
Three cost components: (1) Data transfer: cross-region/cross-cloud egress charges per GB transferred. (2) Compute: serverless compute for the replication process. (3) Storage: full storage cost in the secondary region (data is duplicated). For a 10TB database replicated cross-region: expect significant monthly transfer and storage costs. Optimize: replicate only critical databases, use replication groups to avoid duplicating shared objects.
Yes. Snowflake supports cross-cloud replication (AWS to Azure, Azure to GCP, etc.). Data is transferred over Snowflake managed secure links. Cross-cloud transfer costs are higher than same-cloud cross-region.
Time Travel settings are replicated. The secondary database has its own Time Travel data (independent from primary). After failover, you can use Time Travel on the new primary normally.