Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the use cases of Node.js vs Twisted?

Assuming a team of developers are equally comfortable with writing Javascript on the server side as they are with Python & Twisted, when is Node.js going to be more appropriate than Twisted (and vice versa)?

like image 432
pmn Avatar asked Aug 11 '10 18:08

pmn


People also ask

What is Node JS mostly used for?

It is used for server-side programming, and primarily deployed for non-blocking, event-driven servers, such as traditional web sites and back-end API services, but was originally designed with real-time, push-based architectures in mind. Every browser has its own version of a JS engine, and node.

What are the use cases for node JS and when it should be avoided?

NodeJS has become the number one choice among developers as well as companies for building modern web applications. However, you should not use NodeJS if you're developing a CPU-intensive web application as it may cause unresponsiveness due to its single-threaded nature.

What is the biggest advantage in using node JS?

Node. js has been regarded as a full-stack JavaScript for serving both the client and the server-side applications. Therefore, the advantage is that you don't have to hire separate developers for backend as well as the front-end development. It saves both your valuable money and time.

In which types of applications is node js most frequently used?

Location-Based Applications The asynchronous nature of Node. js and its ability to provide real-time updates make it a top choice for building location-based applications. In 2020, there was an increase in the number of location-based applications. Most of these applications use Node.


1 Answers

Twisted is more mature -- it's been around for a long, long time, and has so many bells and whistles as to make your head spin (implementations of the fanciest protocols, integration of the reactor with a large variety of other event loops, and so forth).

Node.js is said to be faster (I have not measured it myself) and might perhaps be simpler to use (if you need none of the extra bells and whistles) exactly because those extras aren't there (kind of like Tornado in the Python world -- again, I have never measured relative performance).

So, I'd absolutely use Twisted if I needed any of its extra features or wanted to feel on a more solid ground by using a more mature package. If these considerations don't apply, but top performance is a key goal of the project, then I'd write a simple benchmark (but still representative of at least one or two key performance-need situations for my actual project) in Twisted, Node.js, and Tornado, and do a lot of careful measurement before I decide which way to go overall. "Extra features" (third party extensions and standard library) for Python vs server-side Javascript are also much more abundant, and that might be a key factor if any such extras are needed for the project.

Finally, if none of these issues matter to a specific application scenario, have the development team vote on relative simplicity of the three candidates (Twisted, Node.js, Tornado) in terms of simplicity and familiarity -- any of them will probably be just fine, might as well pick whatever most of the team is most comfortable with!

like image 53
Alex Martelli Avatar answered Sep 21 '22 00:09

Alex Martelli