K
K
Koal Koalich2018-02-15 07:40:18
MySQL
Koal Koalich, 2018-02-15 07:40:18

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

4 answer(s)
E
Eugene, 2018-02-15
@klim76

triggers?

A
Armenian Radio, 2018-02-15
@gbg

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.

P
Papa, 2018-02-15
Stifflera @PapaStifflera

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.

R
RidgeA, 2018-02-15
@RidgeA

mysql - https://code.google.com/archive/p/mysql-udf-http/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question