Answer the question
In order to leave comments, you need to log in
How to correctly implement a response to a record change in a database table?
Good afternoon!
There is a need to respond to changes in the content of the fields of some records in the database.
For example, a user logged into the site and changed their e-mail settings.
I need to send a notification to the administrator.
The wrapper variant comes to mind immediately around the methods through which the data is changed.
Probably, database triggers can also be used for this. However it would not be desirable to be anchored to a specific DB.
Please advise how to properly implement such a response?
Answer the question
In order to leave comments, you need to log in
The most "final" point - triggers. That is, for example, at the time of a really finalized transaction. But from the "drive up" trigger, this event is highly dependent on the interaction architecture. If there is a certain table in the database that implements the notification queue, then you can add this very change event to it with a trigger ... well, then someday this notification will be taken out of the queue and sent.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question