LiteFS GET request containing writes + LiteFS with multiple processes

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 mount and backend and worker processes
  • Whenever a deployment happens, if the node is the primary node after litefs mount has 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 start backend but will only start worker if the node is the primary
  • Whenever a node gets elected as primary after a deployment, this is broadcasted as a primaryChange as per the LiteFS event stream, and the supervisor can act accordingly by killing/starting the worker on 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 :smiley:

1 Like