Monday, October 22, 2012

Demerits of Triggers


Demerits of Triggers

• It is easy to view table relationships , constraints, indexes, stored procedure in database but triggers are difficult to view.
• Triggers execute invisible to client-application application. They are not visible or can be traced in debugging code.
• It is hard to follow their logic as it they can be fired before or after the database insert/update happens.
• It is easy to forget about triggers and if there is no documentation it will be difficult to figure out for new developers for their existence.
• Triggers run every time when the database fields are updated and it is overhead on system. It makes system run slower.

I do not use triggers. In my whole career I am able to get my work done using Stored Procedures instead of Triggers. (Implementation and Architecture changes are required if either of is to be used to support business logic).

No comments:

Post a Comment