how can i know if a table of a database have a new registre?

80 Views Asked by At

My goal is to be able to know in real time or close to real time if a new record has been entered in a database or not.

Is it possible to do this or is the only way to poll the table every X seconds to see if anything has changed?

Would polling a table too often to see if a table insert has occurred be bad practice?

1

There are 1 best solutions below

1
On BEST ANSWER

I think you can try to use triggers

In mysql for example

https://dev.mysql.com/doc/refman/8.0/en/trigger-syntax.html