mardi 4 février 2020

Achitecture problem with communication between Php and Python script

My problem is a design problem with my code. And my goal is to rework the architecture of this project.

First of all, I have a website whose backend is in Php. Via the interface of my website some buttons change data in a Mysql database.

On the other hand I have a python script which is in fact a deamon that runs and in an infinite loop will see in the database if one or more data have changed to perform an action.

Now, with a little more experience I noticed that it's not great to do pooling like this knowing that in my case it involves a number of SQL queries in addition to performance problems.

I think this kind of problem could be solved with a kind of design pattern Observer for example.

Where I'm stuck: how is it from my Php notifying my python script of a data change? Is there a possible bridge between my Php and my python to emulate the Observer design pattern? Or another solution I wouldn't have thought of?

I hope I made myself clear... Thanks in advance for your answers !

Aucun commentaire:

Enregistrer un commentaire