6

Some time ago I made this question about porting a Silverlight application to web. We lack experience working with web applications and have started to look for training and resources. We have noted that there is a strong trend about Node.js at the moment, and while we are aware its popularity and support, we have some doubts about its suitability for our needs. Our application would consist on one to several web applications, linked to different operational units in the company, each one performing several different functions. Some of these function, however, would include Reporting and Data analysis, requiring sometimes (but not always) long-running operations related to number crunching and transformation of significant amounts of data.

In the past, these cpu-expensive operations were managed client-side with Silverlight, but in our future set-up, they would be done in the server, and I have found several resources in the net pointing to possible problems that an application with these requirements might face in Node.js due its architecture. Of course, there is many other resources claiming that those problems do not exist or are easily solvable with certain module or offloading heavy tasks to another server. The last solution, however, would be difficult to implement for us due several reasons.

So now the question. Can Node.js manage applications required to perform CPU-intensive tasks as described?

The application started as a windows form application, but we were more or less forced to move to web due the higher ups decided it was the solution for several problems the application had, and they do not think that returning to a desktop application is an option. Also, we have little to no control over the production server(one server and one backup server that mirrors the first, with a load balancer) , and must trust the company that manage them to do all the installation. This mean that, to maintain our sanity and theirs, the set-up of the application should be as simple as possible.

Most of us have a background limited to .net desktop and Silverlight applications, and we have to rely on others for counsel in pure web applications. This question is only one of many we are trying to give an answer in order to have a clear understanding of what options we have available and the pros and cons of each one. As "What is the pros and cons of X" might not be an appropriate format for a question in this site, and since most of them are covered anyway all over the net, I decided to make the question about one of those points I was having more doubts.

  • Im sure node.js is as effecient as any other language. but why you would switch to it from a proper language like .net I dont understand. I think the key thing you need to consider is your need for off line, non webpage functions like those long running processes you mention. these may well be best addressed with a windows service or console app which you can easily knock up in .net and will compliment your .net website – Ewan May 31 '15 at 16:48
  • 2
    Perhapse you are asking for the wrong thing? I know node, angular and all things javascript are considered 'web development' by 'web designers' but theres plenty of microsoft stack training out there – Ewan May 31 '15 at 18:47
  • Just reading your other question and wondering why you dont do a windows universal app instead. seems a more logical progression from silverlight and gives you that client side power – Ewan May 31 '15 at 18:55
  • @Ewan is that WinRT? I thought WinRT was dead, that HTML5/CSS3/Javascript was the new hotness. – Robert Harvey May 31 '15 at 18:58
  • Related: stackoverflow.com/q/2387724 – Robert Harvey May 31 '15 at 18:59
5

The main problem that Node.js has in your usecase is that it runs on a single thread. This means that a CPU-intensive task has a great chance of blocking the whole server until it has finished.

On the other hand, you could use a task queue running on another server (or process), as described in this answer. If you do this, your client-facing server shouldn't block.

  • At the end, we decided to go for ASP.net Web Api for our web application, main reasons being ease of portability of the old code (.net to .net), compatibility with current tools (visual studio) and ease of deployment with our current environment. We made some viable tests with the alternatives sugested in the answer in our test servers, but found several issues when we tried to create a working deployment setup for production servers, and decided to search other alternatives. – MACN Jul 1 '15 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.