What's good about Node?

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
Is using Node servers for web servers the most cost effective for scaling in the cloud, in term of being lightweight and making the max use of the server resources?

Why is there so much interest in Node in the past few years?
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Is using Node servers for web servers the most cost effective for scaling in the cloud, in term of being lightweight and making the max use of the server resources?

Why is there so much interest in Node in the past few years?

Event driven programming has been there before Node. One main attractiveness of Node is the usage of Javascript. Javascript is a rather expressive and flexible language. One advantage that one would argue is the consistency between frontend and backend programming language, but I personally don't find it compelling at all. Just server side alone, I can easily use at least 3 programming language to design. The single threaded design has proven to be non-scalable on its own, so now Node.JS uses multiple workers too. No matter how effective a language design can be, there are limitation to running single threaded. You eventually need to scale into multi threads, processes or nodes to accommodate large concurrency.

Node isn't that lightweight. V8 engine is not that light weight. Scalability in cloud has nothing to do with the choice of technologies, but rather how you use them. We can have scalability using .NET, Java, Python, C, Ruby and all sorts of programming languages with simple features set.

But i agree there is a large number of JS developers, that makes Node a viable platform for application design. However frontend JS is not backend JS. The way JS is used is different in thoughts and design.

Some interesting areas of JS is on transpiler and the use of JS in its subset form to execute transpiled applications using emscripten for example.

Apache HTTPd can be lightweight too if you know how to compile it to your needs, or at least unload modules that you don't use
 
Last edited:

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
Mostly agree with you David.

I could have written a long post. Node is probably OK for small single purpose projects, but I myself won't use it for bigger stuffs that need to scale, integrate with legacy or complex technologies, or grow over years.

On a related note, I wonder how Node's performance compares in term of processor and memory usage to other "lightweight" servers like Java-based Jetty and Undertow etc.

Common complaints about Java servers are its large install size (JRE) and memory usage. Not sure if the .NET world has lightweight production ready server alternatives apart from the heavy IIS.

At least for Java, we can avoid the heavyweight JavaEE app servers like JBoss and Weblogic.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Node is probably OK for small single purpose projects, but I myself won't use it for bigger stuffs that need to scale, integrate with legacy or complex technologies, or grow over years.

I'm not a frequent user of Node.JS myself, but I think many proficient Node.JS developers would beg to differ on what scale Node.JS can go into. From an architecture POV, there is no limit to how far Node.JS can go. It depends on your architecture choice. If you don't segregate your design properly, any programming languages will reach bottleneck. You can potentially start up like thousands of Node.JS processes across thousands of physical/virtual instances and get the perform you need. Each instance can host multiple Node.JS whether using the same NIC or multiple NICs within containers or just plain processes management by kernel. When you talk about large, the programming languages choice is not really the bottleneck. It's the way you program that will limit your scalability in any platforms, virtualise like VMWare, Physical box or cloudy platforms.

Suppose when you have 1000 servers all synchornising across each other for a distributed lock, even C will get deadlock. If you employ message queue or message pass techniques in your processing, even programming languages as slow as a shell script will scale. At the end of the day, scalability is not about how fast you can move, it's about how big you can coordinate.

On a related note, I wonder how Node's performance compares in term of processor and memory usage to other "lightweight" servers like Java-based Jetty and Undertow etc.

I don't have numbers of such things because I don't really benchmark them for fun, and most of the projects I do uses Java extensively instead of Node.JS since the former is more renown in the Enterprise arena that I mostly worked in.

Common complaints about Java servers are its large install size (JRE) and memory usage. Not sure if the .NET world has lightweight production ready server alternatives apart from the heavy IIS.

JRE install size is not an issue for a lot of Enterprising software since we are normally endowed with hundreds of gigabytes of diskspace. A few hundred MB is of no real concern. If you need, you can always compress it further down for distribution. But if you are talking about servers, then really JRE is not even the end of the story. The 3rd party libraries that we used are potentially larger than JDK itself.

Lightweight here don't normally refers to the diskspace unless you are on embedded platforms. It will normally refers to memory consumption and processing overhead. Java does have overhead when it comes to startup, but for server applications that will run for weeks or months before it get shutdown for maintenance, it is heavy enough to be robust and stable. With thousands of threads running in it, it has proven records for scalability and robustness. When you make comparison, you really need to take into consideration of size and duration.

At least for Java, we can avoid the heavyweight JavaEE app servers like JBoss and Weblogic.

Well, sometimes you want them to be there. When you are deploying large number of instances, it can be an advantage using farm deployment and other enterprise features, where these Enterprise servlet containers offer. I wouldn't suggest avoid them. I would suggest know what they are capable of, and decide if they are a good fit to your problem size and environment and costing.
 

ExtremeWays

Banned
Joined
Mar 17, 2017
Messages
7,399
Reaction score
1
Still got people using JEE? I thought most enterprises using Spring framework nowadays?
 

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
Still got people using JEE? I thought most enterprises using Spring framework nowadays?

Some companies can't get away from their legacy systems. If they aren't broken, nobody dares to touch them. :D

In case they collapse like a house of cards. Enterprise developers are forced to use old technologies.
 

Asphodeli

Arch-Supremacy Member
Joined
Jul 8, 2001
Messages
22,725
Reaction score
3,908
Node.JS is fine for small projects, but once it starts getting complex, the amount of time you spend configuring dependencies, updating to latest package versions, porting old JS code to new code, etc. makes it not worth the time and effort for use in most production environments (subjective experience here, people are welcomed to prove me wrong =:p)
 

KnightNiwrem

Senior Member
Joined
Jun 1, 2014
Messages
1,057
Reaction score
0
Node.JS is fine for small projects, but once it starts getting complex, the amount of time you spend configuring dependencies, updating to latest package versions, porting old JS code to new code, etc. makes it not worth the time and effort for use in most production environments (subjective experience here, people are welcomed to prove me wrong =:p)

Whichever the choice of language, if you have dependencies, then tasks like configuring dependencies, updating package versions, migrating code, will have to happen.

There are arguments for and against the use of node, but I don't think the ones you suggested are specific to node.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Whichever the choice of language, if you have dependencies, then tasks like configuring dependencies, updating package versions, migrating code, will have to happen.

There are arguments for and against the use of node, but I don't think the ones you suggested are specific to node.

Perhaps a more constructive comparison would be how is it that Node.JS dependencies compared to Java ones. Today Java is one of the popular Enterprise choice of technologies, and have many large scale deployments. It would be a suitable comparison to give a more objective view.

Despite I don't use Node.JS often, I kinda don't agree it is a matter of technologies to scale. When things get large, you need good process, deployment tools and sufficient automation to keep things in order and consistency.

For example, in one of my current Java project, we use Salt stack to deploy codes and for one of the testing, we need to deploy codes, stop and start systems, collect logs across 30 servers. We use Salt stack to make this happen suitably. I would envision any technologies to use the same technique That is how we consistently control 10 Jmeter nodes too. The same deployment technique can be use for any technologies.

Also because the project is in AWS, we use EC2 commandline tools to start stop multiple servers, manipulate the instance types and make configuration changes easily and consistently.
 
Last edited:
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top