Avoiding deployment downtime when using volumes

Hello!

My single instance application uses a volume to persist some state. When I deploy there is a small period of downtime as the instance is restarted to update to the new version due only being able to use the rolling or immediate deployment strategies.

Is there a way to avoid this downtime window when using volumes?

Perhaps I ought to scale up to 2 instances prior to deployment, deploy with the rolling strategy, and then scale back down again? It was unclear to me from the docs how having a single volume with multiple instances would work, is this a sensible approach?

Thanks,
Louis

1 Like

Hi @lpil

The only real way to have consistent zero downtime deployments is to separate your state storage from your application and to have multiple application servers. This is usually done by having a database separate to the application.

Another way is for your application to be clustered so that each server talks to each other and they all have a synchronized state, though this is much harder to implement yourself.

Hello! Yes Iā€™m familiar with these techniques :slight_smile:

I think my question is more around the mechanisms of volumes on Fly, sorry I should have been more precise. Can multiple instances of an application in the same region share a volume on Fly? This would enable me to use the scaling deployment technique I outlined above.

No, volumes cannot be used by multiple VMs at the same time. Each VM needs its own volume.

1 Like