Ask Slashdot: Node.js vs. JEE/C/C++/.NET In the Enterprise? 304
theshowmecanuck writes "I'm working at a small- to medium-sized company that creates software for mobile devices, but came from a 'large enterprise' world before. I see node.js being used increasingly in smaller companies (including ours) or in web/mobile related software. Meanwhile we see languages like Java/JEE, C/C++, and .NET continue to be used for medium-to-large enterprise corporate software. Compared to the status quo in the enterprise (JEE/C/C++/.NET ... and yes, maybe even COBOL) maybe Slashdotters can chime in on how they see Node.js in this role. I'm thinking of things like complexity of business logic (dependencies, workflows, linear processes, etc), transaction support (for processes in general and database support), messaging services, etc. Also, what is the state of Node.js in terms of paradigms like application containers, where much of the 'plumbing' is already set up for you (one of the main benefits of JEE application containers)? But there is also the question of maintainability, deployment, and ongoing operations. What say you, Slashdot?"
Who you gonna call? (Score:5, Insightful)
Re:Who you gonna call? (Score:3, Insightful)
And when your Java application goes to shit you're going to call Oracle? Reality is that for enterprise code it's more about longetivity than anything else (no "ancient VB6 app nobody knows how to touch anymore") and by the looks of it Javascript is here to stay. Sure sounds a lot better than many of the other fads out there.
node.js has a very serious issue (Score:5, Insightful)
Re:node.js has a very serious issue (Score:2, Insightful)
IBM HTTP Server comes bundled with all versions of IBM WebSphere, and really, it's just Apache. So yeah, in our world free software is indeed used in the Enterprise (or: 'commercial http servers'). In OS-space you've got RHEL and Suse Linux Enterprise, at the very least.
In some cases, even in Enterprise solutions, it does make sense to use free software rather than roll everything in-house, especially when http-serving is not really your core business model.
Re:Who you gonna call? (Score:4, Insightful)
And when the Oracle .net driver goes to shit, who you gonna call?
Hint: Microsoft and Oracle will blame each other and it'll take six months to get a fix. My day job is dealing with both of them, and it does happen sometimes. I don't care for node.js much at all, but the idea that it's somehow inherently more dangerous than stuff from big companies is just nonsense.
It depends on what you have and what you need (Score:5, Insightful)
The short answer is: it depends. The longer answer is slightly more complex. It depends on the problem you have, the knowledge of your programmers, and the server environment you'll deploy.
If most of the developers in your house are web developers, and have extensive knowledge on JavaScript, then node seems to be a more organic solution. However as others pointed, JavaScript has been abused to code everything from databases to ray tracers, but you should keep real world performance in mind. For most tasks node (backed by Google's V8 engine) will be 2x to 10x slower than an optimized C/C++ program in the real world. You're basically trading developer performance for runtime performance.
Additionally using a dynamic language, especially modern JavaScript requires discipline. If you do not have a proper packaging or testing systems you'll run into problems. Fortunately node community already prefers doing things the modern way, so this should not be a concern for most (sane) people.
On the other hand, one should never discount the performance benefits of C++. For our latest project we converted one of the smaller, but very CPU intensive services from PHP into C++. This offered an order of magnitude performance increase (going from a minute to a few seconds). So use your common sense, and all available tools on hand depending on situation.
As for Java, and C#, you'll have a performance similar to C++ (same to 2x slow), as long as you have sufficient amount of RAM (a recent paper I read cited 6x RAM requirement for a GC to function properly). The only concern is that for C#, you'll most likely want to stick to Microsoft ecosystem (Visual Studio is a great development environment, but you'll have to deploy to Asure, whereas you have more choices with Java, including Amazon and Google Linux clouds).
The bottom line is: look at the task at hand, and the people you have to choose the tools. And do not be afraid to experiment -- especially early on in the project.
Re:I think... (Score:1, Insightful)
If you want something done ASAP, don't use C++.
Neither C#. You'r better go with Python.
If you want the result to be easily portable to other platforms, don't use C++.
LMFAO. Don't use C#. DO use Python, C, C++ or Java, but not C#.
If you want the code to be safe (against hacking) without much effort, don't use C++.
If you want your code to be safe, write it carefully. Learn what makes code unsafe, and don't be an ignorant.
If you want the code to be easy to maintain, don't use C++.
If you want your code to be easy to maintain, write it following sound engineering principles:
* don't optimize until you need to.
* use established patterns when they make sense.
* don't make it more complex than it needs to be.
* write as little code as possible, and as simple as possible.
So, to sum up: Don't be an ignorant, and don't use C# for portable code.
Re:Who you gonna call? (Score:5, Insightful)
WTF are you talking about? Oracle .net driver? You mean you're using .net with an oracle database instead of mssql? Well there's your problem. M$ doesn't like other databases except theirs.
Re:node.js has a very serious issue (Score:5, Insightful)
I'm not really a fan of node.js (because it's redundant) but I think you misunderstand the point of node.js. If you're reimplementing a full fledged HTTP server with it then you're really using it wrong because it's not meant for tasks that heavyweight and really uses a different request processing model than that.
But I take issue with it because even in that role you can configure technologies like IIS, various JAS' and WCF to work in pretty much the exact same manner but with the benefit of being able to use languages and tools more well designed for large scale development on top whilst also having the benefit that these technologies automatically scale better than node.js and perform better to boot. WCF for example can be run in single threaded mode but such that it automatically uses a thread per core or processor, whilst with node you have to set up clustering to make it do this. Most of node's advocates make inflated claims of it being better than these sorts of server products for no other reason than they are inexperienced with these products and don't understand them and their flexibility.
Effectively node.js allows inexperienced developers to do something that people who understand IIS, many Java Application Servers, WCF, or even raw sockets programming have already been doing for many years already.
So to answer the OP's question I think as I say that in the enterprise node.js is really quite redundant. It doesn't do anything that can't already be done with better performing, more tried and tested, more scalable more enterprise friendly technologies already.
Effectively it's become popular because Javascript developers have had to start working on the server side and it's an easy jump for them, but what server side developers already have is much more secure, much better performing, and much better for development.
About the only valid argument I've heard for node.js is it means you can share code between server and client and write once as a result, but I'm not sure how useful this is in practice given that you'll normally be doing different things server side to client side and hence having different data structures and processing needs anyway. Technologies like Java and .NET make serialisation/deserialisation to/from JSON happen automagically anyway so it's not as if getting data structures between the two is any kind of chore.
If you already have server side developers who know their stuff then use them and don't waste your time with node. If you only have Javascript developers then use node.js until you can't. I say can't because Javascript's language design and node.js' limitations do make it increasingly more difficult to write anything of any real complexity after a point whereas C, C++, Java, C# all allow a much greater degree of scalability. It all depends on what developers you have currently and how far your needs are going to scale as to whether the deficiencies of node.js and Javascript will become a problem.
Re:Who you gonna call? (Score:5, Insightful)
Yes, because there's never been a bug that manifested in some weird situation after everything had been live and working for months. Nope!
Re:Who you gonna call? (Score:5, Insightful)
So, meantime node.js is no longer maintained. WHO CARES?
You stick to your old version, and you are good. If you need new features that belong into node.js and not into your software you hire one for it. Or you write it yourself.
And then you get hit by a vulnerability.
http://blog.nodejs.org/2012/05/07/http-server-security-vulnerability-please-upgrade-to-0-6-17/ [nodejs.org]
Re:Who you gonna call? (Score:5, Insightful)
First you chose the right tool for the job at hand. node.js is not intended for serious number crunching, but neither is Java or .Net. If you need multi-threading in node.js you are doing it wrong; node.js efficiently handles many thousand parallel executions, in one thread. Node.js is very efficient at waiting and reacting to input. One node.js instance can get up to 99% on one CPU core, something that is really hard with a Java or .Net application that happens to do I/O. If your needs extend one core you can always use cluster and thus spawn multiple node.js processes working the same program. node.js is awesome, since in almost all applications this approach results in a very easy solution to scaling out.
So far with npm, I have found everything I can possible want under the sun and all with permissive licenses, such as MIT. I don't see the issue here.
Finally if you really need the raw power, use C or Fortran, seriously. Java and .Net are the last places to look for performance.
Re:Who you gonna call? (Score:4, Insightful)
Finally if you really need the raw power, use C or Fortran, seriously. Java and .Net are the last places to look for performance.
actually the > 1.6 incarnations of Java are fast and only getting faster, and there are real time implementations of the JRE if you really need them. As far as "power" (however that is defined), folks are doing some really interesting (especially in the news lately) things with large data set analysis and manipulation with products like Hadoop.