Preview: persistent disks for Fly apps

We’re releasing persistent disks soon, you can try them out now if you’re curious. flyctl 0.0.145-beta-3 introduces a volumes command you can use to provision permanent disks for your applications.

Volumes are persistent, maintain their data between deploys, and even stick around if your app is suspended.

Creating a volume is simple, this creates a 25GB volume in ewr: flyctl volumes create <name> --region ewr --size 25

To mount this volume at /data, add this to your app config:

[[mounts]]
  source = "data"
  destination = "/data"

You can create multiple volumes with the same name, if you want to run an app in 3 regions, run these commands (and keep [[mounts]] in your config the same):

flyctl volumes create data --region ewr --size 25
flyctl volumes create data --region cdg --size 25
flyctl volumes create data --region syd --size 25

Some limitations:

  • You can only mount one volume in a VM (we’re curious if you need more)
  • We don’t have snapshots/backups available yet
  • Your app can only scale to as many VMs as you have volumes. If you’ve created 3 volumes named “data”, your app can scale to 3 VMs.

Other things to know:

  • The price is $0.15 per GB per month
  • Performance will be better than general purpose EBS in most cases
6 Likes

So exciting!

If there are multiple VM’s in a region due to auto scaling, do they access the same volume?

  • Your app can only scale to as many VMs as you have volumes. If you’ve created 3 volumes named “data”, your app can scale to 3 VMs.

This means “no” right? You would need to vertically scale an app, right?

You can either scale vertically or add more volumes to scale horizontally.

1 Like