I like to scale a web application horizontally, meaning having it run on multiple nodes and a load balancer distributing the load. In my case, it is a Laravel application, providing Laravel migrations for versioning database scheme changes. There is a single database instance attached to the nodes.
Now, if I wanted zero-downtime my usual approach would be to drain the nodes one after another and replace them by nodes running the new application version.
When and how do you apply the Laravel migrations or, more generally, updating the database for the new application version?
If the new database structure is backwards-compatible, my not-yet-drained nodes running the previous version should run just fine. But how do you go about it if your database migrations are not backwards-compatbiel (or you just do not know about it, because, after all, the point of solid automated processes is to not have to think about such things all the time).
There are articles around describing zero-downtime with multiple folders on one instance, but without horizontal scaling. E.g. https://laraveldaily.com/how-to-deploy-laravel-projects-to-live-server-the-ultimate-guide/
There are also plenty of articles around regarding horizontal scaling in general. But I do not seem to find any that explain how to handle the database migration.