I think the main downside compared to having the migrator in your supervision tree is that it doesn’t let you control where the migration happens relative to other items in your supervision tree. For example, we have basically:
... other children
This is important because it allows the
Ingestion.Super process to be sure that any database changes it relies on have definitely have happened by that point because the Migrator has run.
You’ll also note that I start the
Endpoint pretty early. The way that works is that the
/alive path returns true, but the
/ready path returns false. This lets Kubernetes know that the pod is alive and running, but is not yet ready to receive traffic. It can take its time to run migrations, get the process tree up and running, and then the
DeploymentNotifier child sets an application environment value such that
/ready returns true.