5

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?

2
  • Did you ever move forward with this? I recently had a similar idea and was wondering how much of a pain it would be. Personally I just feel like node.js/(flask/bottle/pesto) would be a near ideal dev environment. Commented Aug 15, 2013 at 15:19
  • There seem to be little support for this and I have not pursued it any further yet. Commented Sep 10, 2013 at 12:54

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I want to ping several external wss urls such as the ones offered by GDAX and binance straight from my python flask application, i am a newbie in python and have searched high and low and havent found a decent socket IO client that lets me fetch stream data from multiple urls at the same time in an asychronous manner, i have heard about tornado but seems like connecting with flask is a frowned upon idea, not sure about asyncio integration with flask, i am using celery currently, all i want to do is run my socket client inside celery tasks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.