How do you improve DB performance in countries across the world

Thanks! I’m actually having some issues with my self hosted PG server so let me give fly a shot now that I can expose it. Volume snapshots would be good, or honestly just a prebuilt Cron job that I can set s3 tokens to. Since you can now expose pg I’ll probably set up some software to back up until you guys release something. A dashboard where you can see the queries that take the longest is probably the most important thing (digital ocean) has this. Also maybe it’s just me but I really have a hard time understanding the x and y axis on some of the current graphs in the admin console. Maybe more user friendly graphs could be useful too

What should the services section look like? http or tls?

PostgreSQL has its own application-level protocol negotiation that comes before TLS. So you can’t use the tls handler here.

You’d want to leave handlers blank entirely. The http handler is designed for servers that can handle the HTTP protocol, but Postgres does not handle it.

You definitely want TLS though (but not the handler)! So this would have to be implemented at the Postgres level. This means changing some of the code involved in configuring Stolon and Postgres.

I’ll have a talk with the team about making that easier.

Anyone considering using Fauna for this?

It’s a distributed and serverless database.

Fauna + Go on Fly could be really cool. I’m mostly a fan of OSS DBs I can run on my laptop, though, so I haven’t spent as much time with Fauna as I should have.

Planetscale also seems interesting.

I’ve used it with Node on Fly and it’s really cool.

It’s not OSS but you can run it on your laptop from a Docker image.

Planetscale is cool, but they do not have an on-prem version at the moment. I contacted them and they said they only support AWS and GCP right now, and only in a handful of regions. Cockroachdb is also cool, but also suffers from some licensing issues preventing making it easy to do a free global setup. :man_shrugging:

Oh? I’ve recently discounted it for a current PostgreSQL project due to incompatibility (syntax error, custom type, .etc.), but would be interested to hear why licensing would be an issue.

It’s not super clear on their site, but while ‘multi-region’ deployment is listed as a core feature, it’s also marked as enterprise-only here. An additional note: while it seems like you can use most core features for your own app, you cannot run it as a hosted service for other businesses. Perhaps that’s not a problem for most businesses.

Back when we were working with Cockroach, multi region deployments were open source, but advanced geo features (like pinning a specific row to a region) were enterprise only. We ended up switching to vanilla postgres because:

  1. Multi region write modeling is more complicated than just using read replicas
  2. Cockroach wasn’t quite compatible enough with PostgreSQL, things like Rails migrations and Django schema updates didn’t work

In about a month when we’re big enough to be relevant, we’re going to approach Cockroach et all about getting proper offerings on Fly. :slight_smile:

3 Likes

This would be great!

We currently use CockroachDB core and find that we have managed to get by without the enterprise features, especially since they introduced BACKUP and RESTORE as part of the core feature-set. Our restores using their old sql dump method used to take hours and required manual changes, now it takes minutes and is essentially full automated.

When you approach Cockroach, one aspect I’d request you discuss is whether you’re able to offer a somewhat managed CockroachDB setup using the core feature-set so that we don’t have to pay for enterprise licensing (which is quite expensive).