Reputation: 3277
Now-days I'm aiming to start learning to develop with node.js.
I hope my question is clearly - when you are talking about node.js and mobile, what do you mean? to web application which is developed by node.js and the users come via the simple web-browser, or a pure mobile application (for example for android with java) and the node.js takes part in this process somehow (how?).
I asked it because I saw that Linkedin developed a mobile application based on node.js, but I didn't understand where they integrated the node.js - at the web application? android application? iOS application? not clearly for me (my assumption is the web application, but I'm really confused).
Thank you.
Upvotes: 7
Views: 10792
Reputation: 40513
Node.js (Node) is a scalable, event-driven I/O environment built on top of Google Chrome's JavaScript runtime—essentially, a server-side implementation of JavaScript. Google V8 actually compiles JavaScript into native machine code prior to execution, resulting in extremely fast runtime performance—something not typically associated with JavaScript. As such, Node enables you to rapidly build network apps that are lightning fast and highly concurrent.
What it really means is that Node.js is not a silver-bullet new platform that will dominate the web development world. Instead, it’s a platform that fills a particular need. And understanding this is absolutely essential. You definitely don’t want to use Node.js for CPU-intensive operations; in fact, using it for heavy computation will annul nearly all of its advantages. Where Node really shines is in building fast, scalable network applications, as it’s capable of handling a huge number of simultaneous connections with high throughput, which equates to high scalability.
How it works under-the-hood is pretty interesting. Compared to traditional web-serving techniques where each connection (request) spawns a new thread, taking up system RAM and eventually maxing-out at the amount of RAM available, Node.js operates on a single-thread, using non-blocking I/O calls, allowing it to support support tens of thousands of concurrent connections
A quick calculation: assuming that each thread potentially has an accompanying 2 MB of memory with it, running on a system with 8 GB of RAM puts us at a theoretical maximum of 4000 concurrent connections, plus the cost of context-switching between threads. That’s the scenario you typically deal with in traditional web-serving techniques. By avoiding all that, Node.js achieves scalability levels of over 1M concurrent connections
Continue Reading .. http://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js
Prime-time companies have relied on Node.js for their mobile solutions.
LinkedIn is a prominent user. Their entire mobile stack is built on Node.js. They went from running 15 servers with 15 instances on each physical machine, to just 4 instances – that can handle double the traffic!
eBay launched ql.io, a web query language for HTTP APIs, which uses Node.js as the runtime stack. They were able to tune a regular developer-quality Ubuntu workstation to handle more than 120,000 active connections per node.js process, with each connection consuming about 2kB memory!
Walmart re-engineered its mobile app to use Node.js and pushed its JavaScript processing to the server.
Read more at: http://www.pixelatingbits.com/a-closer-look-at-mobile-app-development-with-node-js/
Upvotes: 5
Reputation: 1317
An article about how LinkedIn uses the Node.js technology can be found here:
http://venturebeat.com/2011/08/16/linkedin-node/
The biggest reason for the use of the technology at LinkedIn was because of the speed and use of less resources.
The app is two to 10 times faster on the client side than its predecessor, and on the server side, it’s using a fraction of the resources, thanks to a switch from Ruby on Rails to Node.js
The new mobile app probably uses a little bit of browser sandboxing and native app code.
“There’s this battle between HTML5 web apps and native apps. But we’ve interspersed HTML5 in the native app, where web-based content excels. The things that are hard to do in HTML5 are a scrolling infinite list, so we went native with that.”
and
The way our mobile web app works is it’s all rendered on the browser side.
A few more reasons for LinkedIn choosing Node:
BlockquoteOne reason was scale. The second is, if you look at Node, the thing it’s best at doing is talking to other services.
Hope some of this helps answer your questions.
Upvotes: 5
Reputation: 1638
They are referring to node.js on the server back-end.
Examples would be:
Upvotes: 1
Reputation: 211700
NodeJS is a server back-end component that responds to network requests of various kinds, but most commonly HTTP requests. In the case of a mobile app it might be used to interface with a database and interpret JSON HTTP calls, fetch and/or insert data, and return JSON data to the mobile client.
In most cases, iOS, Android and mobile web clients will connect to NodeJS over HTTP to send GET
and POST
requests through an API of some variety.
It's also possible for NodeJS to interface with the various push notification systems available on each platform, or to use something like SocketIO to provide real-time communications between client and server.
Upvotes: 8