Hacker News new | ask | show | jobs
by Mahn 2409 days ago
There are ways to prevent invalid states in a database without foreign keys, for example enforcing "all or nothing" operations via transactions.
1 comments

Until a programmer forgets to wrap the new feature in a transaction, or just has a bug in their logic that breaks the integrity. Or a db admin working directly in the database breaks it. Or a schema migration. It's not impossible, sure, but it requires you and everyone working with the data two be very, very disciplined, and is only as effective as the weakest link.