Postgres scaling

Two quick questions about Postgres on fly.io:

  1. is it possible to vertically scale the write node independently of read nodes? Having something like 20 read nodes of 1 vCPU and 2 GB ram and 1 read/write node with the same specs likely presents an issue even in read heavy apps.

  2. does the Postgres app support autoscaling or just flyctl scale count X

Thanks! Really excited to start using Fly :slight_smile:

1 Like
  1. is it possible to vertically scale the write node independently of read nodes?

Fly apps are homogenous, so all the read nodes will share the same config type as the write nodes as of now. If this is really important to you, there is a possible escape hatch — use the fly postgres option to run the main database with just 1 replica, and then create a new self-managed Postgres app that serves as read replicas with a different configuration. Not ideal, but still possible.

  1. does the Postgres app support autoscaling or just flyctl scale count X

The Postgres apps all require volumes attached, so I wouldn’t recommend autoscaling here. It may be possible to hack to do that anyway (by having more volumes lying around that can be autoscaled into) but let me double check that and get back to you. I definitely would not recommend this, though — each time a replica starts up it needs to sync up with the master, and I personally wouldn’t recommend the variability that comes with having replicas start in and out from different timelines.

1 Like