We currently have a django app serving our frontend website to the users over Apache. The frontend queries our backend, which is a separate Python app (Flask) served a different server. So far, the frontend has been required to query the backend for data but not the other way around.
We are now introducing data alerts that users can choose to receive regarding data changes in the system. The process for checking whether an alert has happened has to occur on the backend, as it is closely coupled with the data model. Hence, the frontend sends a request to add an alert in the backend, which will then poll and check if the triggers have occurred.
The issue is that once alerts are triggered in the backend, the frontend needs to get notified so that users can be notified as well. The backend cannot directly alert the users since it is unaware of user data like emails etc. (this user data might change, hence sending it to the backend alongside the request to add the alert is too simplistic).
Hence, we are looking for the optimal way to push alert notifications from the backend to the frontend. What is our best approach at doing this? We can set up a view on the django app that the backend can query, but I don't like the idea of the frontend querying the backend as well as the other way around. What is our best bet at achieving this?