Understanding replication cost¶
Charges based on replication are divided into two categories: data transfer and compute resources. Both categories are billed on the target account (i.e. the account that stores the secondary database or secondary replication/failover group that is refreshed).
- Data transfer:
The initial replication and subsequent synchronization operations transfer data between regions. Cloud providers charge for data transferred from one region to another within their own network.
The data transfer rate is determined by the location of the source account (i.e. the account that stores the primary replication or failover group). For data transfer pricing, see the pricing guide (on the Snowflake website).
For more information, see Understanding data transfer cost.
- Compute resources:
Replication operations use Snowflake-provided compute resources to copy data between accounts across regions. The service type for compute costs for replication in the account usage and organization usage views is REPLICATION.
For more information, see Understanding compute cost.
The target account also incurs standard storage costs for the data in each secondary database in the account.
The target account also incurs costs for the automatic background processes that service materialized views and search optimization. The maintenance costs for secondary objects is lower than for primary objects. For details, refer to the “Serverless Feature Credit Table” in the Snowflake service consumption table for the costs per compute hour.
Replication charges are applied even if the initial replication or a refresh operation doesn’t succeed. Any data that is copied before the initial replication or refresh operation fails can be reused by a subsequent refresh operation (if performed within 14 days) and doesn’t need to be copied again.
Estimating and controlling costs¶
In general, monthly billing for replication is proportional to:
Amount of table data in the primary database, or databases in a replication/failover group, that changes as a result of data loading or DML operations.
Frequency of secondary database, or replication/failover group, refreshes from the primary database or replication/failover group.
You can control the cost of replication by carefully choosing which databases or objects to replicate and their refresh frequency. You can stop incurring replication costs by ceasing refresh operations.
Viewing actual costs¶
Users with the ACCOUNTADMIN role can use SQL to view the amount of data transferred (in bytes) and the credit usage for replication for your Snowflake account within a specified date range.
To view the data transfer amounts and credit usage for replication for your account:
Query either of the following:
For examples, refer to Monitor replication costs.
Database replication costs¶
For individual databases replicated using database replication, users with the ACCOUNTADMIN role can use Snowsight, the Classic Console, or SQL to view the amount of replication data transferred (in bytes) for your Snowflake account within a specified date range.
To view the data transfer amounts for your account:
Select Admin » Cost Management
- Classic Console:
Replication utilization is shown as a special Snowflake-provided warehouse named REPLICATION. Click the Data Transfer button to view the data transfer costs. Note that the web interface does not break down data transfer costs for replication.
Query either of the following:
The following queries can be executed against the DATABASE_REPLICATION_USAGE_HISTORY view:
Query: Replication cost history (by day, by object)
This query provides a full list of replicated databases and the volume of credits consumed via the replication service over the last 30 days, broken out by day. Any irregularities in the credit consumption or consistently high consumption are flags for additional investigation.SELECT TO_DATE(start_time) AS date, database_name, SUM(credits_used) AS credits_used FROM snowflake.account_usage.database_replication_usage_history WHERE start_time >= DATEADD(month,-1,CURRENT_TIMESTAMP()) GROUP BY 1,2 ORDER BY 3 DESC;
Query: Replication History & m-day average
This query shows the average daily credits consumed by Replication grouped by week over the last year. This helps identify any anomalies in the daily average so you can investigate any spikes or changes in consumption.WITH credits_by_day AS ( SELECT TO_DATE(start_time) AS date, SUM(credits_used) AS credits_used FROM snowflake.account_usage.database_replication_usage_history WHERE start_time >= DATEADD(year,-1,CURRENT_TIMESTAMP()) GROUP BY 1 ORDER BY 2 DESC ) SELECT DATE_TRUNC('week',date), AVG(credits_used) AS avg_daily_credits FROM credits_by_day GROUP BY 1 ORDER BY 1;