I think this makes sense. So, to summarise all of this:
- Add a supervisor process such as hivemind/overmind
- This supervisor is the glue between
litefs mountandbackendandworkerprocesses - Whenever a deployment happens, if the node is the primary node after
litefs mounthas run (as known by the litefs exec), then we run the migrations, after which we run a script which starts the supervisor. This script will always startbackendbut will only startworkerif the node is the primary - Whenever a node gets elected as primary after a deployment, this is broadcasted as a
primaryChangeas per the LiteFS event stream, and the supervisor can act accordingly by killing/starting theworkeron that node. This is done by a script, which is also run by the supervisor? Or where does this fit?
Thoughts?
I feel like I’m quite far away from my comfortable frontend devving at this point ![]()