The Hidden Cost of Postgres Constraints at Scale is a description of a bottleneck foreign keys can create in a write-heavy PostgreSQL table. It also has recommendations of what you can do to overcome that.
Now, I would say, it's a corner case for many people. The author works in a company that develops their own time series solution based on Postgres, so for them, it makes sense.
For the vast majority of people, I would argue, it makes more sense to offload the integrity checks to the database, rather than trying to implement those in-house. Of course, it may be different for you, but no one knows your system better than you do.
#db #postgres
Post #2962
1.27K