Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are ways to prevent invalid states in a database without foreign keys, for example enforcing "all or nothing" operations via transactions.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: