Zero downtime deployments with LiteFS

Hello there! I’ve followed this documentation on getting started with LiteFS on Fly.

I was surprised to find that running fly deploy resulted in a period of downtime as it followed (I believe) these steps:

  1. The running VM is shutdown
  2. Mount the volume to a new VM
  3. Start LiteFS
  4. LiteFS starts the application

I was expecting no downtime, with a process like this:

  1. A new VM is brought online
  2. LiteFS is started on the new VM
  3. LiteFS replicates the database from the old to the new VM
  4. LiteFS starts the application on the new VM
  5. The old VM is shutdown
  6. The new VM is promoted to be the LiteFS primary

Are my expectations off the mark here, or is this something that can be achieved?

Thanks,
Louis

Are you running a single machine on your app? We don’t scale up additional VMs during deployment so it won’t have a node to handoff to if you’re only running a single machine.

1 Like

I’m not sure! I’m not super familiar with Fly config, but I believe I’m using the defaults as specified by the getting started guides for Fly and LiteFS.

Normally the application runs a single node in the London region. I was expecting a second one to be brought online before that one was terminated.

edit:

OK so it sounds like I need to set deploy.strategy to canary, however it isn’t supported when using volumes, and the LiteFS quick start guide told me to add a volume. I’m not sure how to proceed as while I don’t think I need the volume to be persisted between instances (LiteFS will replicate the data to a new instance, right?), but I think I do may need a volume to increase the amount of disc space available for the VM.

I have 2 volumes with the given name so I am able to scale up to 2 VMs, but only manually, using canary is rejected by fly deploy.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.