E
E
erastov2017-06-08 14:03:53
Python
erastov, 2017-06-08 14:03:53

What is the correct way to listen to the database?

There is a MSSQL database, there is a flask controller that communicates with the database and gives values ​​to the script on the site. At the moment, I pull the ajax controller periodically and display data, but I need to make the script output data only when something has changed in the database. How to implement it correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
n-fom, 2017-06-08
@n-fom

For MS SQL via ServiceBroker - SqlDependency. There is actually a ready implementation, but for C#
https://github.com/dyatchenko/ServiceBrokerListener

A
Anton, 2017-06-08
Reytarovsky @Antonchik

As an option, contact the controller using Ajax, collect data, and then check in js if the data has changed and display them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question