Forum Discussion
Replicate Azure SQL database with a lag
Hello,
I am new to Azure SQL database. I am being asked by my manager to replicate our Azure SQL databases to an Azure SQL VM with a lag of 3 hours.
Does anyone know what solutions are available?
Thank you.
2 Replies
- MageeeBrass Contributor
If you specifically need a 3-hour lag, the built-in replication options like Active Geo-Replication or Auto-Failover Groups won’t help, since they’re designed for near real-time sync.
For your use case, you could:
Use Azure Data Factory (ADF) or Synapse pipelines to copy data from the Azure SQL Database to the SQL Server on the VM. You can schedule the pipeline to run every 3 hours, which effectively gives you the lag you need.
Another option is transactional replication, but note that it requires Azure SQL Database as the publisher and a SQL Server instance as the subscriber. However, this will be closer to real-time, not with a fixed lag.
If your manager wants the lag for reporting or recovery purposes, ADF scheduled copies are usually the simplest way to control timing.
So in short: ADF with a 3-hour trigger is the easiest solution to achieve controlled lag replication.
- Martin-Apps4RentIron Contributor
Azure SQL Database does not have a built-in option to replicate with a time lag, but you can achieve it by setting up transactional replication, log shipping, or custom ETL with Azure Data Factory to copy data to an Azure SQL VM on a scheduled delay (like every 3 hours). Log shipping is the most common method for creating a delayed secondary copy since you can control how often logs are restored.