Deploy to multiple databases concurrently
I want to be able to release database changes across several databases. Once confident that the targets are all ready to go, and that the deployment script is correct, I want the deployment to be concurrent (so that it takes less time).
While we haven’t implemented this exact feature, I want to share some information with similar patterns which may help some readers, or inspire comments or feedback in others.
One common approach is to manage multi-database deployments via an orchestrator, such as Azure DevOps, Octopus Deploy, or similar. This may be managed concurrently or in a simple loop depending on the needs. One example of this with Azure DevOps is demonstrated here: https://www.youtube.com/watch?v=-rZxLCRrgmI
When using a single release artifact to deploy to many databases, it’s important that you control for database drift on a regular basis outside of the deployment process. One way to do that is to set up monitoring that alerts you to schema changes that occur. An example of monitoring for this in SQL Monitor is in this custom metric: https://sqlmonitormetrics.red-gate.com/unauthorized-object-changes/
-
Doug Tucker commented
We already use SQL Multi Script for concurrent deployment - how about incorporating its functionality into DLM Automation? See suggestion "Expose SQL Multiscript functionality via DLM Automation cmdlet"
-
Doug Tucker commented
I need to execute Use-DlmDatabaseRelease against hundreds of databases per server (times a dozen or more servers). None of the Powershell multithreading approaches I've found matches the speed of SQL Multiscript. It would be a huge performance boost to be able to feed a Use-... statement or a generic script block to a Multiscript cmdlet for swift parallel handling.
-
AdminRichard Mitchell (Admin, Redgate) commented
If you don't want to do this via automation you could try our SQL Multi Script tool which can query and run queries against many many databases and servers at once.
-
Doug Tucker commented
I'd like to be able to release the same schema change to thousands of databases (hundreds per server across a dozen or more servers). Concurrency would be a must!