14

We are having many projects running on many servers looking up into one database, we"re thinking to setup Flyway to every project for control our database structure.

But we are worrying about concurrent migration problem, if some projects re-deploy in sametime.( Off-coures, we always take care the "If exist" things in sql syntax )

How Flyway work when concurrent change on same data table or other struture things ?

Nam Vu
  • 161
  • 1
  • 4

1 Answers1

16

It works as expected. See the answer in the FAQ: https://flywaydb.org/documentation/learnmore/faq.html#parallel

Can multiple nodes migrate in parallel?

Yes! Flyway uses the locking technology of your database to coordinate multiple nodes. This ensures that even if multiple instances of your application attempt to migrate the database at the same time, it still works. Cluster configurations are fully supported.

Klesun
  • 12,280
  • 5
  • 59
  • 52
Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137
  • Though it's not very clear what specifically do they mean by _"locking technology of your database"_ =/. I would expect that they do something like insert a record in `flyway_schema_history` on start with `success=false` and use this insert for optimistic locking, though that's just a guess. – Klesun Oct 01 '21 at 19:57