Get the latest tech news
'Make invalid states unrepresentable' considered harmful
One of the most controversial things I believe about good software design is that your code should be more flexible than your domain model. This is in direct…
However, many large tech companies - including the two I’ve worked for, GitHub and Zendesk - deliberately choose not to use foreign key constraints. The tradeoff is that you won’t have the data until both you and the producer are upgraded to the new schema, so you’ll need to handle that case in your application code. Something baked into a database schema is a harder constraint, because it requires a migration to change, which (depending on the amount of data and the read volume) can be operationally very difficult.
Or read this on Hacker News