I'm pretty much with you on stored procedures.
I'm pretty much with you on stored procedures.
By centralizing data integrity logic in the database, you know where to look and that all apps using the database will abide by it.
I think part of the problem is that there is still this huge chasm between good coding skills and good database skills. It’s hard to have both.
I like the author's point about this:
> The trigger function itself was also written in the “schema.sql” file which meant that everything was clear and documented along with the other relevant schema information, thus easier to track and manage.
In my experience, in most cases the application doing the insert/update/delete is the best place to handle most side effects. That may be an on-demand API, a scheduled/queued job, etc. I've found triggers to be helpful and simple for audit and history tracking. There are definitely plenty of cases where triggers are useful and it probably depends a lot on your architecture.
I'm not as anti-trigger as I am SP. Though I stay away from triggers in any case as the rest of the world is fairly negative on them.