Parallel Database deployment

I’m not sure if this has been asked before, I can’t find anything that applies directly. We have a database deployment scenario where we deploy a dacpac to multiple databases on the same server. For example, we have a single nuget package, all_countries, which is deployed to multiple databases called: country_a, country_b, country_c etc. The steps are:

  1. deploy the nuget package to the server
  2. generate database script
    a) generate for country a
    b) generate for country b
    c) generate for country c
    … and so on.

Is it possible to do those generate steps in parallel? At the moment each step is waiting for the previous and this deployment is now running quite slow (we have 10 plus countries) and will get slower as we add more countries.

Hi @saltyleaf,

Thanks for getting in touch!

It depends on where those script tasks are getting run. What I suspect you need is a combination of two things, the first of which is setting your steps to be able to run in parallel. This is done on each step, by setting the below flag:

But that will only get you partway if all of these steps are running on the same target. The second piece of this puzzle is bypassing our deployment mutex that blocks multiple tasks running at once on the same target. This is done by setting a variable in the project, specifically OctopusBypassDeploymentMutex to True. We have a docs page that explains more about what is happening here.

Hopefully that helps, please let me know if I’ve misunderstood the problem or if you have any follow up questions!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.