ekeepo LLC
  • Home
  • Services
  • Products
    • AllocateIt
    • Blog
    • Our Story
    node.js, the Cloud, and The Mobile Device 08/08/2011
    0 Comments
     
    node.js, The Overview
    node.js is a very interesting use of JavaScript.  Think of it as a JavaScript host which enables you to create non-blocking code which can be very fast due to (among other reasons) it's ability to scale.  Why is non-blocking code interesting/useful?  In a world of parallel and distributed computing, blocking code is like inserting sand into your car's gear-box.  It makes everything grind to a halt while wasting energy.  

    Node.js takes this asynchronous (non-blocking) model of programming and exposes resources as services.  For example, you can open a TCP port or handle HTTP requests using a node.js service through a very simple snippet of JavaScript.  Take a look at http://www.nodejs.org/ for some great resources on how to do this.

    There are a number of Cloud Service Providers which are offering node.js hosts which will enable you to expose a node.js service to the internet.  Of course, you can always host it either on your own server or a virtual machine, but by using the Cloud you won't need to manage your own infrastructure.

    Some Cloud Providers and community support for Node.js:
    Heroku: http://devcenter.heroku.com/articles/node-js
    Joyent: http://www.joyentcloud.com/products/smart-appliances/node-js-smartmachine/
    Windows Azure (Steve Marx shows how to use node.js on Windows Azure in his Mix11 session):  http://channel9.msdn.com/Events/MIX/MIX11/SVC04
    Amazon Web Services: https://github.com/raincloud/node-aws

    node.js and Mobile Devices
    HP/Palm is taking a very interesting approach and using node.js inside their mobile device.  Traditionally, it would be insane to run a server on a mobile device given the power constraints on a mobile device.  With WebOS, HP/Palm are enabling us to create node.js services on the device and are exposing some of the WebOS functionality through node.js services.

    As shown in the figure below, the 'Client Code' which is running on the device can depend on a node.js service that is also running on the device.  This on-device node.js service is guaranteed to be available since there is no need for a network call.  It can be thought of as a middle-tier service which can determine what to do given the state of the network.  If the device is connected to the network, this service can reach out to other services located in the cloud.  If the device is *not* connected to the network or low on battery (or whatever other reason determined by the on-device node.js service), it can choose to use the local resources.  Since WebOS implements some operating system calls (i.e. local I/O to files) using node.js, the on-device node.js service can call these WebOS specific services.
    Picture
    For more information about the WebOS implementation of node.js see http://developer.palm.com/content/api/dev-guide/js-services/overview.html#javascript-for-services.

    Also check out this talk given by HP/Palm (discussed node.js at ~21:00) http://www.youtube.com/watch?v=gB1TNwSRI6U

    Whether it's an implementation of node.js or some other way of exposing asynchronous (non-blocking) services on a mobile device, this is a very interesting convention that is here for the long haul and will allow us to create better applications more quickly.
     


    Comments


    Your comment will be posted after it is approved.


    Leave a Reply

      Archives

      March 2012
      August 2011
      August 2010
      March 2010
      February 2010
      September 2009
      June 2009

      Categories

      All
      Allocateit
      Apps
      Async
      Design
      Mobile
      Node.js
      Process

      RSS Feed


      © 2011-2012 ekeepo LLC

    © 2008 - 2012 ekeepo LLC