I currently have a Flask application which acts as the backend for my website. I intend to add live private chat functionality to my website using Flask-SocketIO.
I was wondering, is it better to integrate this into the current Flask app, or create a separate app/server that handles all web-socket connections for the chat?
Bearing in mind that I will have to authenticate users as well...
Reasons as to why it might be a good idea to separate:
- can use eventlet easily
- separation means that a lot of load is lifted off the main website server; if the chat server fails, the rest of the website is still online
- (correct me if I am wrong but) with the two separated, I avoid having to do any complex threading or request context pushing for various functionality
Reasons with it might be a bad idea:
- a separate app to maintain complicates CI/CD cycle
- might complicate user authentication?