There is a trend this past year and a bit more for developers to go towards NodeJS, and now it has an active community with many libraries being added. This is not a new idea, Aptana Jaxer created some buzz when it first came out but that diminished quickly. The general idea of Javascript on the server is exciting but Jaxer was a top down effort and did not form such a large community following as NodeJS has. The main difference for NodeJS is that it is creating buzz from the bottom up from the developers themselves who add code to Github and do social coding, sharing their NodeJS libraries to interface with MongoDB or perform other functions.
The idea was always good, as one developer said about Jaxer “I think this would be great. I can write my jQuery validation code once and run it both on the client and server side.”. However the idea is also bad, Javascript is not designed to perform computations quickly, where it is going to shine is in getting data from the database, transforming it slightly and sending it to the user. Where it is not going to do well is when computations are needed, where it is necessary to generate images on the server side or perform many calculations on data, it is going to fall over and not succeed. The javascript on the server as a tool is only suitable for the average use case of being a gatekeeper between the user html page and the database. Well, that’s mostly all we need as web developers anyway.
The main problem I have is that it is easy to get started, that’s why people are excited, but when you get into the details of the larger project, the important issues come up such as the security of the server, how to read and write to the database, caching, what libraries to use. In terms of security, protecting it from hackers, client data security, spam attacks, hackers performing denial of service, its a cold hard world out there, NodeJS will not have any protection against this sort of thing and since its Javascript, DOS attacks will be easier against it due to its slow computation. However, if you play by the rules with Liftweb, all of these issues are not as important as Liftweb has been designed to cope with difficult security problems.
Liftweb is difficult to get started with, there’s a LOT of information to learn, Scala and all of its libraries, what are Snippets, how best to do things but at least, there is a “best” way to do anything. Liftweb has already explored the territory and knows what is the best way to solve a problem. In fact, it is a fairly mature technology with book(s) to read. However, you MUST follow the rules and you MUST know how to solve the Liftweb problems according to the rules. Not following the rules will lead to a mess and a headache. Also its more difficult to get Scala and Liftweb developers, they are not cheap and not easy to find as Javascript programmers, and a developer who does not know Scala is going to take weeks at least to get up to speed to learn Scala and Liftweb.
If NodeJS was as mature as Liftweb, most of the issues that I’m worried about would go away, but it is not, its a new technology with risks and unknowns. Unknown ways of solving problems means difficulty in deciding how to solve the problems. A typical NodeJS project is going to include many modules which may disappear or become less popular over time. This means that programmers who come back to the project will have to look at modules and API’s which are different in years to come. Also the Javascript language is not typed which is annoying and its really not such a great language, I guess you can program NodeJS in Coffeescript which helps.
Yahoo might release something about NodeJS this year. If there is larger company support then it will help.
Ultimately I prefer Liftweb over NodeJS, but for me, they are both very close in terms of preference. NodeJS may be best in a team environment where the programmers can all know Javascript. Liftweb requires the programmers to know the more difficult Scala and Liftweb, this is a risk if your Scala programmers are not available and you need to hire new Scala programmers. I just like Scala better than Javascript, sorry, and the maturity of the framework.
Then you can ask, why am I only comparing NodeJS with Liftweb in Scala? The reason is that these are my two favorite technology’s for server side development at the moment, and my other slightly less favorite general category for web development is SEAM Framework or JEE or Spring. Really the advantage of SEAM, JEE or Spring is that the API’s will not change much over time and there are very standard ways of solving problems. However, they are relatively heavyweight, although Spring would say it is not. These heavyweight environments can be slightly slower to get started in, but ok in the end.