Reputation: 1513
I am setting up a dev/test/staging/production web app slots and for reasons I need to replicate data from one slot to the others.
The data is pretty small (10-100's of rows). However, it's important for this to be (relatively) automatic and error-free. After a lot of googling it appears SQL Data Sync fits the requirements.
However, my requirements include the curve ball I need to modify some of the data in between the different slots. For example, I would like to modify all entries in a row so that "product{tag}.website.com" was automatically translated to "product-staging.website.com" in the staging DB, "product.website.com" in release, and "localhost/product-dev" in development environment.
Is there any way to change data during sync'ing in any way?
Is using Data Sync like this like whacking a mouse with a sledgehammer? Is there a better way? Or should I just bite the bullet and write custom SQL for this?
Upvotes: 0
Views: 273
Reputation: 16431
SQL Data Sync is a service built on Azure SQL Database that lets you synchronize the data you select bi-directionally across multiple SQL databases and SQL Server instances.
In Azure Data Sync, you can sync the data manual or automatic, from Hub to Member, or Member to Hub, or both.
But the Hub Database must be an Azure SQL Database.
For your questions:
Is there any way to change data during sync'ing in any way?
Yes, you can. For example, you set product Azure SQL database as Hub DB. You can change data and sync to your member development database. If everything test ok in your member database, you can sync to the Hub database.
Is using Data Sync like this like whacking a mouse with a sledgehammer? Is there a better way? Or should I just bite the bullet and write custom SQL for this?
Yes, it is. If you have set the Data Sync correctly. You don't need to write custom SQL for this, Data Sync will help you do all the job.
Reference:Tutorial: Set up SQL Data Sync between Azure SQL Database and SQL Server on-premises.
Hope this helps.
Upvotes: 1