I have a python application. I wanted to know whether there is any functionality(i.e. event or trigger) in mysql which will allow me to notify my python application when data is inserted in the database. I would like to avoid the use of polling because it will cause a large overhead on my database.
1 Answer
It's not directly for Python,but Is there a way to watch a mysql database for changes using perl? gives two option how to do that:
1.Create an audit table in the database, and have the trigger write the relevant info there; and have your watching application poll the audit table for new entries. You're still polling, but in a controlled way which won't hit the server too hard.
2.Have the trigger call an external app through a UDF.