Socket.IO vs Twisted

My idea is to create a simple chat application for iOS and Android. In any case, my question is related to the server side. The best option to make a chat application, from what I read, is to build a socket. When referring to a database, I intend to use MySQL, which may also be important to consider in order to choose one of the options.

My question is: in terms of scalability, speed and security, what is the best option: creating a socket with Python using Twisted or using NodeJS using Socket.IO ?

I suppose there may be other possibilities for creating an efficient socket, but now I'm considering these two. I would really appreciate it if you could give me some advice.

+6
source share
1 answer

Compare Twisted and Socket.io compares apples with a truck with apples. Twisted is a library that provides event-oriented programming functionality in Python. In javascript, it's just javascript itself (be it node.js or a web browser or even a rhino).

A more suitable comparison is comparing Socket.io on node.js with Socket.io in Python. While there is one basic socket.io server implementation on node for Python, there are several:

(taken from socket.io wiki: https://github.com/learnboost/socket.io/wiki )

You can even implement your own socket.io in Python using Twisted if you want. The socket.io protocol is described here: https://github.com/LearnBoost/socket.io-spec . But that will defeat the purpose of socket.io - it abstracts real-time low-level data about web communications and lets you focus on writing your business logic.

On the client side, you must deploy the same socket.io script in the browser, no matter what language you decide to record the server in.

As to which language to choose: my rule of thumb is to choose the language with which you are most comfortable. You will have enough trouble debugging your business logic. Do not obstruct it using an unfamiliar language.

Both languages ​​are held together by battle (yes, even node.js, which is surprising considering how young he is). For example, Python is used in high traffic services such as Dropbox. node is currently used for high traffic services like LinkedIn mobile.

+9
source

Source: https://habr.com/ru/post/957134/


All Articles