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 about data transfer billing, see Understanding Data Transfer Cost.
- Compute resources
Replication operations use Snowflake-provided compute resources to copy data between accounts across regions.
Note
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.
If the initial replication or a subsequent refresh operation fails, the next attempt (if performed within 14 days) can reuse the data that was already copied; that is, the data is not copied again during the next attempt. For this reason, replication charges are applied even if the initial replication or a subsequent refresh operation fails.
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 replication data transferred (in bytes) for your Snowflake account within a specified date range.
To view the data transfer amounts for your account:
- SQL
Query either of the following:
REPLICATION_GROUP_USAGE_HISTORY table function (in the Snowflake Information Schema). This function returns replication usage activity within the last 14 days.
REPLICATION_GROUP_USAGE_HISTORY View (in Account Usage). This view returns replication usage activity within the last 365 days (1 year).
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:
- Snowsight
Select Admin » Usage
- Classic Console
Click on Account
» Billing & Usage.
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.
- SQL
Query either of the following:
DATABASE_REPLICATION_USAGE_HISTORY table function (in the Snowflake Information Schema). This function returns database replication usage activity within the last 14 days.
DATABASE_REPLICATION_USAGE_HISTORY View view (in Account Usage). This view returns database replication usage activity within the last 365 days (1 year).
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;