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.
Node. js for Mobile Apps is a Node. js runtime that runs on Android and iOS, using the V8 JavaScript engine.
Node. js is pretty weak with computations, so it won't work here. In the development of such applications, it is better to use Python, which has proven itself well in terms of computing power. To understand what is better to use for the Andriod app backend, you need to consider each case separately.
Android JS provides Node JS runtime environment, So you can write your code in Node. JS and can use any `npm` package which helps to build your app in a quick way.
It is a used as backend service where javascript works on the server-side of the application. This way javascript is used on both frontend and backend. Node. js runs on chrome v8 engine which converts javascript code into machine code, it is highly scalable, lightweight, fast, and data-intensive.
This is the main repository for Node.js for Mobile Apps, a toolkit for integrating Node.js into mobile applications. This is the central repository for reporting all issues related to the Node.js for Mobile Apps project, including issues pertaining to the React Native and Cordova plugins. The core library source code is in this repo.
Other things that you may or may not have read about Node.js is that it is single-threaded, based on event-driven architecture, and non-blocking based on the I/O model.
How Node.js works behind the scene ? Node.js is the JavaScript runtime environment which is based on Google’s V8 Engine i.e. with the help of Node.js we can run the JavaScript outside of the browser.
2) Node.js Application: So now that, we have learned about the Node.js architecture, it’s time to learn how a Node.js application runs and this part includes the concept of Node.js being single-threaded and its non-blocking nature as well. So, first of all, what is a thread?
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.
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.
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/
They are referring to node.js on the server back-end.
Examples would be:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With