| if you rely on triggers for data integrity, then I guess this is one more case where MySQL is letting you down and allowing your data to get corrupted unless you're really careful. While it's not always good design to use triggers for this, sometimes, it's a valid reason to use them for integrity checking or enforcing. Having `on delete` triggers not run for some delete's is violating the principle of least surprise. When feature break this way, people start to distrust them and best practices get adopted that discourage using them, killing the features all together. Using a database that does not have this misfeature, both triggers and foreign keys are perfectly safe to use, but because the one database that is the most widely used has issues like the one described here, you often hear the recommendation to not use triggers or even foreign keys. Yes, you can potentially move the logic normally contained in either of them into the application, but as you deal with more concurrency and as you start accumulating bugs, sooner or later your data will be messy and you will need to add cleanup-scripts, or, heaven forbid, work around messy data in your application logic (don't. do. that. it's the path to the dark side of unmaintainability). Or, of course, use a database system whose features work correctly and the principle of least surprise is in effect. PostgreSQL is one of these, by the way. |
It makes apple's application simple stupid and efficient.
And they have triggers on foreign keys... with sqlite.
...
It is not postgres in one of it, it is much more mysql is not a correct rdbms. None of the other databases have this flaw.
Mysql is to RDBMS what mongo is to NoSQL, nowhere short of achieving anything that matters correctly.
EDIT: or better: Mysql is a realistic in the Hollywood way implementation of a RDBMS