by jitl · 5y ago · 0 comments
Even though it’s a well documented issue with Postgres and you have an experienced team keeping an eye on it, a new write pattern could accelerate things into the danger zone quite quickly. At Notion we had a scary close call with this about a year ago that lead to us splitting a production DB over the weekend to avoid hard downtime.
Whatever the issue is, I’m wishing the engineers working on it all the best.
Speculation is a useful intellectual exercise, and the sign of a healthy, intelligent and curious mind!
Speculation is also fun!
Quite surprising a seemingly battle-tested database can choke in such a manner.
Most postgres databases wrap around with no issues.
The problem with increasing the size is a pair of xids are needed for every row, so you're doubling that if you go to 64 bits.
in theory nowadays it wouldn't be too hard to change if you use logical replication to upgrade the database but it'd be a huge undertaking for a lot of companies.
Even if we assume your premise that vacuum is at least as bad as the GIL is correct, this would easily explain it.
Add in the sheer difference in expectations between a programming language and a database... and well, I don't think there's any mystery here at all. There's easily multiple great explanations, even if your premise is correct.
Because it's better than the alternatives? What would you suggest?
CockroachDB is an example of what a modern database should be like.
I think throwing together a static page better than "we're making the game more awesome" would be simple. It kinda makes me wonder if it's an internal auth/secret issue as has been speculated. That could theoretically make it harder to update the website, especially if it's deployed by CI/CD.
I don't know how MySQL or MariaDB handles this; AFAIK it doesn't have this issue.