Answer the question
In order to leave comments, you need to log in
How to "notify" a change in the database?
I wanted to know if MySQL or, in general, mainstream DBMS can somehow push notifications to other systems about data changes in their own?
Example: there is a user base. If a new user has been added or the phone number of one of them has been changed, then another base should find out about this as soon as possible. How is this done without periodically polling the parent database?
Answer the question
In order to leave comments, you need to log in
Postgres - pgnotify
Firebird - POST_EVENT
Both mechanisms work like this - you need to subscribe to a specific notification on the client, and then you can send it from a trigger or procedure.
Example: there is a user base. If a new user has been added or the phone number of one of them has been changed, then another base should find out about this as soon as possible. How is this done without periodically polling the parent database?
Set up replication. Almost all mainstream DBMSs can replicate.
If you need to notify third-party applications, then each DBMS has its own specifics. As mentioned above, PostgeSQL has a pgnotify notification mechanism. For MySQL, most likely, you will have to set up replication and install a special kind of proxy, which will notify other applications.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question