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?
  • You have mentioned some pros and cons, but you didn't introduce any real need or requirement. If you are not attending any special need just keep it simple – Laiv Nov 8 '18 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.