3 ms·
Interesting, last I checked PlanetScale still doesn't have in place Postgres version updates.
by Onavo 2mo ago
Interesting, last I checked PlanetScale still doesn't have in place Postgres version updates.
- bddicken 2mo agoBroadly for Pg, minor version upgrades are straightforward as the data on disk is guaranteed to be compatible. All it takes is a restart or switchover to upgrade. Major versions are more challenging for "vanilla" Postgres because that's not the case. Storage/catalog formats may change. There needs to be an explicit upgrade process for the data (eg, a database created with v18 won't work out of the box with v19). The cool thing is, software like Neki (and Vitess for MySQL, which we maintain) have architectures that lend themselves to making this much more feasible. Because the actual database nodes sit behind a router + parser layer with Pg/MySQL compatibility, the upgrades can be done transparently to the user. We plan to write more about how this works in the future.
- Onavo 2mo agoYou can do live parallel routing and blue-green migrations transparently. In your docs you already describe how to do it but the user has to do it manually at the application level when you can do it just fine at the DB load balancer/router level.
- bddicken 2mo agoExactly. When you have a router + query parser in front of the db nodes, the burden of managing multiple versions simultaneously can be taken out of the app and into the database layer.
- CodesInChaos 2mo agoI believe most major versions of postgres only change metadata, so the downtime only scales with the size of the schema (usually small) and not the size of the data.
- pritambaral 2mo agoNote: this only applies if the `--link` flag is used with `pg_upgrade` (which, I recommend), but the default is to copy all data.
- CodesInChaos 2mo agoAssuming you're on a filesystem that supports reflinks (Btrfs, XFS), `--clone` is an interesting option as well. Though assuming you create a volume backup before starting migration, hardlinks don't really have downsides and will probably have better performance after the upgrade since the avoid copy-on-write.