Answer the question
In order to leave comments, you need to log in
Are DB triggers smearing business logic?
Let's take the task of counting likes. Each like creates an entry in the database. In order not to use count(*), it was decided to denormalize the database and make another table post-number of likes.
Obviously, after each like, you need to update the counter. This can be done in two ways.
1) Database triggers
2) In the business logic layer, directly write a query to the database.
Question - do I understand correctly that, from an architectural point of view, triggers will smear business logic with a database-access layer?
Can we say that database triggers are an antipattern?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question