How can I install node.js module using phantom, instead of npm?

What are the caveats for using nodejs for huge systems like ecommerce, which expects to get about a million page-views per month?

  • I read stuff about nodejs and how it's different from traditional way of processing requests. What are the limitations of it using in a huge-scale systems like e-commerce , which expects to make huge transactions, on an average. Is anybody using nodejs at that big a scale yet ? What are some good resources on reading about using nodejs in such environments ? What would be an ideal tech-stack with it ?

  • Answer:

    The most important thing to know about Node is why it's different from other platforms. Node's strength is in it's evented, callback-driven nature (asynchronous, aka non-blocking). Page requests are going to be perfectly aligned with Node's strengths. A request is nothing but an event and the returning of the assets for that request is the callback. Beautiful! So, since page views are not a concern with Node, what is? Well, due to JavaScript's single threaded nature, it's not optimally designed for heavy data chrunching. So, the relevant question is how much data processing will your ecommerce site have to handle? I honestly can't think of much heavy data processing for an ecommerce site. It seems mostly just data requests (again events), I&O (perfect) and small mathematical functions (no problem). So, I would bet that Node would be just fine for an ecommerce site. Now, if you were building a financial platform or handling statistical analysis with report generation, you should probably avoid Node, or at least be aware of how to work around JavaScript's single thread limitation (e.g. spin up additional nodes/workers to mimic parallel processing, aka threads). As far as your other questions, I think addressed them well.

Justin Lowery at Quora Visit the source

Was this solution helpful to you?

Other answers

A million page-views a month is not much, honestly, and nothing a well written Node application cannot handle easily. Linkedin[1], Microsoft, eBay, and Walmart[2], are some of the better known brand names using Node but the published list of companies[and projects is quite long[3]. The main caveat I can think of is that it takes discipline to write a performant, well structured Node application.  It's easy for a Node project in the hands of the uninitiated to spiral into an unstructured, non-performant mess. To best avoid the pitfalls there's a wealth of well-established patterns and best practices out there to use as examples. Just scan Github, Stack Overflow, Quora, etc. for examples. A year ago I was apprehensive about using Node for our production systems due to its maturity at the time. I said I'd give it a year and I did. Now we have Node backing at least one very high traffic application that's in the works and are using it for critical subsystems of other high traffic applications. [1] - http://venturebeat.com/2011/08/16/linkedin-node/ [2] - http://venturebeat.com/2012/01/24/why-walmart-is-using-node-js/ [3] - https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node

Chris Longo

Like Justin said, it really just comes down to the question: is your application more IO-intensive (huge amount of DB reading/writing) or more computation-intensive (huge amount of computation)?  I think a e-commerce site falls into the former case, and that's where Node.js shines.

Derek Chiang

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.