How do you improve DB performance in countries across the world

We have plumbing for this! It’s a little ragged, but you can get it to work with read replicas. Check this out, it’s using a Postgres cluster in Santiago Chile with read replicas elsewhere in the world. Try posting something and you’ll see the region change: https://rails-on-fly.fly.dev

This works by catching readonly errors and telling our proxy to replay those requests to Chile: rails-on-fly/application_controller.rb at main · fly-apps/rails-on-fly · GitHub

It should be possible to do this with prisma as well, assuming you can put a little express middleware in there. The Rails app is using the readonly replicas as its only database connection string in the other regions: rails-on-fly/fly.rb at main · fly-apps/rails-on-fly · GitHub

If you want to try this out, we can help you get a Postgres configured properly. It’s currently a little more difficult than it should be to setup a bunch of read regions but we really want this to be slick. Especially with Prisma!