Is it best to use Node.js or SignalR [closed] - node.js

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
At the risk of this question being closed I will ask anyway.
I have been looking at the different JavaScript Frameworks as most jobs roles seem to want:
angular.js
Knockout.js
Node.js
Whilst i can see Angualr.js and Knockout.js provides a MVC construct to the markup pages (though still not sure which one is best to use) I cannot see what is the case for node.js?
Whilst I appreciate node.js is good for real-time comms but so is Signalr as they both use long-polling.
At present I use signalr to update images on my clients.
is there any purpose to swapping this out for node.js?
Like I said this question could be voted to be closed as it may seem to be asking an opinion - and that would be an answer to me in itself as it would be down to developer choice but is there a DEFINITIVE reason to use node.js over signalr?
thanks

One reason to use node.js is code redundancy. Both the server and client run the same language, thus they may share a certain part of the codebase, meaning potentially less to write. With libraries like Browserify this process can be made a lot more transparent and writing the client-side can be almost indistinguishable from server-side development. Another opportunity this opens up is both client and server side rendering + MVC setups with, for example, rendr.js. So you can have both the fast load speeds of server-side and responsiveness of client-side rendering. If any of this will be useful naturally depends on what you are developing.

Related

Is it a bad idea to start to write a microservices NodeJS backend application in REST, then try to convert/wrap some/whole parts with gRPC or GraphQL? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 months ago.
Improve this question
Is it a wrong manner to start writing a NodeJS application using REST architecture, then try to use GraphQL or gRPC approaches in some parts or completely rewrite some or whole the application in the future?
The reason for doing this is previous experience and coding speed in REST APIs. But at the other hand it's kinda a big microservices project and should support millions of users.
GraphQL is not going to help you scale, quite the opposite in many cases. GraphQL is an optimization (in some cases) but mostly for developer productivity, but there is a complexity cost.
Generally I would suggest to steer away from this optimization unless you have a clear understanding of what you're solving for. REST is a good 'default choice' because it's well understood, requires little tooling and is pretty universal.
Once you are further into your project and you find that you have (ideally measurable) challenges, you're in a much better place to decide to use a more specialized paradigm (gRPC/graphql) and why, but it doesn't sound like you're there yet.

Can NodeJs be used on the web just like php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Guys i'm new in Nodejs,
please can it be used on the web like php?
First you decide what type of situation you have.
If you want to make shopping site, social network etc which use large data processing , then you go for node.js (for example linkedin is made in node.js ).
But if your website does not require much data processing in server side you can go for php.
Nodejs is little difficult to use but once you use it perfectly your website will run smooth.
Both are good languages.
Yes you can easily use nodejs as a server side language.
Nodejs is faster than php. You can use nodejs to speedup your loading speed of your website.
Because nodejs heavily use callbacks.

Sinatra vs Node.js performance for a simple REST API [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
This is not a holy war question, I'm just asking what framework would be the best choice in terms of performance in my specific project.
I'm writing a REST API and choosing between Node.js and Sinatra. One method of the API will be used very frequently (± 100k requests per day).
This request is very simple: select one row from a database, make a few calculations, update one row in a database.
But, as I said, it will be called frequently and I need to choose a framework that will perform better in this case.
This is a simple app and in this case I don't care which framework is easier or "better", just interested in the performance. I already wrote a prototype in Sinatra, the whole app is less than 150 lines of code.
I read about Node.js, but never created a real app with it.
Will Node.js be a significantly better choice for this project in terms of performance and scalability?
100k requests a day is roughly a request per second assuming a flat distribution of requests during the day. Both solutions will probably serve that without a problem. You're probably falling into the premature optimisation trap.
That being said, Javascript, because of it's asynchronous nature is significantly better at high i/o than Ruby (Sinatra is just a simple web framework, Node is just how you run Javascript on a server).
Now as per the "what should I do", I suspect most people would tell you to use the prototype you already have working and use it until it's no longer good, if it ever comes to it. Seeing it's such a small app it shouldn't be a problem to rewrite it later with Node anyway!

Why people use node.js to provide http service? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I just began to study web developing and heard that node.js can be easily used to deal with incoming HTTP requests. But I'm wondering why they don't simply use Apache or IIS? Under what circumstance would people prefer handling HTTP requests with their own code written in node.js? Thanks.
Go and have a look into the Raspberry PI community. I know that there this is discussed every once in a while to have a very lightweight server to do stuff. So I believe this is one occasion.
In reality it's though very common to have nginx or apache as a proxy before the node server. The proxy then handles all the heavy lifting like handling static files, while node handles the dynamic stuff.
Node.js compared to PHP is a completely different concept. While a PHP application is stateless, a Node application is stateful, meaning you start the application and it's just running, even when there's no requests, which would not be the case with PHP.

Best XMPP client library for Node.js [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
What are your experiences with Node.js XMPP client libraries? What do you recommend?
I would highly recommed node-xmpp, which is the most idiomatic library available for Node, in that each connection is an EventEmitter which emits events in a similar manner to the built in modules.
If you are coming at Node from a browser-based background, the way stanzas are constructed is identical to Strophe.js, which minimizes the learning curve.
As you venture further into XMPP territory, node-xmpp is also a great way to write components. And its architecture is clean enough that there is even an xmpp-server project being built on it.
Finally, I'm also developing Junction, which is a suite of XMPP middleware, similar in style to what Connect/Express offers for HTTP. I'm currently building out examples and additional documentation, but the source code has full API docs, and I think its a solid framework, particularly if you are incorporating various XEPs into your client/component.
If you are trying to build a bot for Google Talk, I would suggest using https://github.com/simple-xmpp/node-simple-xmpp
Node-xmpp did not work for me while connecting with google's servers.

Resources