Querying inserts in the database in real time [duplicate]

2

There is a table in Mysql that suffers many insertions. The application needs to show these changes to the client. Currently the existing application queries the table every 10 seconds and displays the contents of the table. Is there any way that the bank itself informs when there are changes in the table? Or is there a way to improve this kind of scenario?

The problem is the infinite loop that jquery gets, sending every 10 seconds a post to capture the information in the database.

    
asked by anonymous 14.08.2018 / 15:47

1 answer

1

I also have this problem, so during some research I found a feature called Triggers ) no MySql .

My idea is to create another table with a Trigger that registers the change (updatetable), where it has its field (update type int) changed whenever there is any UPDATE , DELETE or INSERT . < br> So bring the information only when this int field is different and not every time you send $.post .

I know you have better techniques but I'm just leaving one option;)

    
14.08.2018 / 16:01