Hi VO RICHARD,
Welcome to Microsoft Q&A forum and thanks for using Azure Services.
As I understand, you want to know if there any additional or indirect cost by enabling CDC on Azure SQL Database.
Azure SQL Database is billed by the amount of Storage and Compute.
You can utilize the concepts mentioned here: https://learn.microsoft.com/en-us/azure/azure-sql/database/cost-management?view=azuresql to plan and manage costs of your Database.
The effect on performance from enabling change data capture on Azure SQL Database is similar to the effect on performance of enabling CDC for SQL Server or Azure SQL Managed Instance. Some of the aspects that influence the effect of performance while enabling CDC are:
- The number of tracked CDC-enabled tables
- Frequency of changes in the tracked tables
- Space available in the source database, since CDC artifacts (for example, CT tables, cdc_jobs etc.) are stored in the same database
- Whether the database is single or pooled. For databases in elastic pools, in addition to considering the number of tables that have CDC enabled, pay attention to the number of databases those tables belong to. Databases in a pool share resource among them (such as disk space), so enabling CDC on multiple databases runs the risk of reaching the max size of the elastic pool disk size. Monitor resources such as CPU, memory and log throughput.
To provide more specific performance optimization guidance to customers, more details are needed on each customer's workload. However, here's some more general guidance based on performance tests conducted on the TPCC workload:
- Consider increasing the number of vCores or shift to a higher database tier (for example, Hyperscale) to ensure the same performance level as before CDC was enabled on your Azure SQL Database.
- Monitor space utilization closely and test your workload thoroughly before enabling CDC on databases in production.
- Monitor log generation rate. To learn more here.
- Scan/cleanup are part of user workload (user's resources are used). Performance degradation can be substantial since entire rows are added to change tables and for updates operations preimage is also included.
- Elastic Pools - Number of CDC-enabled databases shouldn't exceed the number of vCores of the pool, in order to avoid latency increase. Learn more about resource management in dense Elastic Pools here.
- Cleanup – based on the customer's workload, it may be advised to keep the retention period smaller than the default of three days, to ensure that the cleanup catches up with all changes in change table. In general, it's good to keep the retention low and track the database size.
- No Service Level Agreement (SLA) provided for when changes are populated to the change tables. Subsecond latency is also not supported.
Since Compute operations involve cost and during CDC you can tune according to your needs. Also use Administer and monitor CDC illustrated here: https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/administer-and-monitor-change-data-capture-sql-server?view=sql-server-ver16
Here is about Enable and Disable CDC: https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/enable-and-disable-change-data-capture-sql-server?view=sql-server-ver16
Hope this helps. Let us know if you have further queries.
Thank you.