Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Flask alongside with node.js

Tags:

node.js

flask

I have a Python Flask application and I'm about to start implementing websockets and I wan't to have all this done in node.js of several reasons;

Node.js use less overhead and I like the idea of separating the more more heavy logic from the more traffic intensive parts.

node.js seem to have better support for websockets and being more mature.

And I might later on move the node.js to a separate server if needed for performance.

My question is what would the best practice, to build up the communication between my Flask application and Node.js? Is this a bad idea to set it up like this?

like image 812
StefanE Avatar asked Nov 14 '22 03:11

StefanE


1 Answers

Unless you have a really good reason to use both, and you've verified through some benchmarking that using both is necessary, I wouldn't do it. It adds a lot of complexity (code duplication, different libraries working differently in different languages, etc) for questionable benefit.

WebSocket is an issue in Flask, but you can use Juggernaut to handle it easily.

like image 60
dumbmatter Avatar answered Dec 29 '22 19:12

dumbmatter