SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
6000 Greenwood Plaza Blvd
                           Suite 110
                           Greenwood Village, CO 80111
                           303.798.5458

                           www.aspenware.com




Business
Considerations
for Node.js Applications

                           Michael Filbin
                           m.filbin@aspenware.com
Agenda…
•    Definitions
•    Introduction to Node.js
•    Problems it attempts to solve
•    Drawbacks and challenges to adoption
•    Use cases and case studies
•    Hello World example (if time)
•    Summary and conclusion




Business Considerations
for Node.js Applications
Who Am I?
       •     Consultant at Aspenware Internet Solutions Inc.
       •     Background in Open Source technologies
       •     Currently JavaScript engineer at Pearson
       •     Member of Linux and Free Software foundations
       •     Co-founder of Gogy Inc.




Business Considerations
for Node.js Applications
Who Are You?




Business Considerations
for Node.js Applications
Acknowledgements




Business Considerations
for Node.js Applications
Key Terms…
              •  API: A collection of publically exposed methods to
                 facilitate use of a library
              •  Asynchronous: The execution of a function and its
                 result are not mutually exclusive.
              •  JavaScript Runtime: Optimizes and executes
                 JavaScript code
              •  Language Binding: Uses of one programming language
                 to ‘wrap’ a library in another
              •  Callback: A reference to executable code that is passed
                 as an argument to a function.
              •  I/O Operations: Operations that involve reading/writing
                 data through some time of interface.
              •  Procedural Programming: Programs are expressed in
                 terms of steps (procedures) to be carried out
              •  Event-driven Programming: Execution of a program is
                 carried out in response to events.
              •  Blocking Process: A process that prevents the
                 continuation of execution until it returns.


Business Considerations         Brief Introduction to Node
for Node.js Applications
What Is Node?


Business Considerations
for Node.js Applications
What does Node do?
•  API for interacting with low-level system libraries
   asynchronously
•  Leverages features inherent in the JavaScript language
•  Intends to manage concurrency, latency, parallelism




  Business Considerations
  for Node.js Applications
Visualizing Latency
                                  300000000	
  

                                  250000000	
                                                           240000000	
  
        Processor	
  Cycles	
  




                                  200000000	
  

                                  150000000	
  

                                  100000000	
  
                                                                                         41000000	
  
                                   50000000	
  
                                                        3	
     14	
         250	
  
                                               0	
  
                                                                               1	
  
                                     L1	
  Cache	
                             3	
  
                                     L2	
  Cache	
                            14	
  
                                     RAM	
                                   250	
  
                                     Hard	
  Disk	
                      41000000	
  
                                     Network	
                           240000000	
  

Business Considerations
for Node.js Applications
Web Application Life Cycle?
                                           Route Request to Controller Action

                                   Respond to Request
                                                                           Make Database Query




                      Write to log file

                                    Operate on results
Business Considerations
for Node.js Applications
Traditional Scaling Model…
                        Route Request to Controller Action                                           Route Request to Controller Action                                           Route Request to Controller Action                                           Route Request to Controller Action                                           Route Request to Controller Action

               Respond to Request                                                          Respond to Request                                                           Respond to Request                                                            Respond to Request                                                          Respond to Request
                                                        Make Database Query                                                          Make Database Query                                                          Make Database Query                                                          Make Database Query                                                          Make Database Query




  Operate on results                                                          Operate on results                                                           Operate on results                                                            Operate on results                                                          Operate on results

                 Operate on results                                                          Operate on results                                                           Operate on results                                                            Operate on results                                                          Operate on results




                                Route Request to Controller Action                                           Route Request to Controller Action                                           Route Request to Controller Action                                           Route Request to Controller Action                                           Route Request to Controller Action

                       Respond to Request                                                          Respond to Request                                                           Respond to Request                                                            Respond to Request                                                          Respond to Request
                                                                Make Database Query                                                          Make Database Query                                                          Make Database Query                                                          Make Database Query                                                          Make Database Query




         Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results

                        Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results




                                Route Request to Controller Action                                          Route Request to Controller Action                                           Route Request to Controller Action                                            Route Request to Controller Action                                          Route Request to Controller Action

                       Respond to Request                                                          Respond to Request                                                           Respond to Request                                                            Respond to Request                                                          Respond to Request
                                                                Make Database Query                                                          Make Database Query                                                          Make Database Query                                                          Make Database Query                                                          Make Database Query




         Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results

                        Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results                                                           Operate on results




Business Considerations
for Node.js Applications
Resource Limited Scaling

                                          Load	
  Balancer	
  



                            Web	
               App	
                       App	
  
                           Server	
            Server	
                    Server	
  




                             Search	
  
                                                            Database	
  
                             Engine	
  



Business Considerations
for Node.js Applications
Resource Limited Scaling




Business Considerations
for Node.js Applications
Node’s Execution Model
 •  Using an event loop
     •  Event occurs (emitted)
     •  Non-I/O operations return immediately
     •  I/O operations defer to libeio or libuv
     •  I/O interrupt received and callback is executed
     •  Data returned to client



        Event	
  1	
                                                                            libeio	
     FS	
  
        …	
                                                                                                  Network	
  
                                                                                                             Crypto	
  
        Event	
  N	
                                                                            libuv	
  




                         All	
  on	
  a	
  single	
  thread	
  on	
  a	
  single	
  processor	
  
RESTful Web Services
with Node.js
Event Loop Analogy




RESTful Web Services
with Node.js
Node Architecture…




                                                                       Async	
  DNS	
  
                           V8	
  RunLme	
  




                                                                                          OpenSSL	
  
                                                           libuv	
  
                                              libeio	
  




Business Considerations
for Node.js Applications
Scaling Node Applications:


                           Load	
  Balancer	
  /	
  Reverse	
  Proxy	
  



                                             App	
  
     Content	
  
                                            Server	
  
     Delivery	
  
     Network	
  
      (CDN)	
  
                           Search	
  
                                                         Database	
  
                           Engine	
  


Business Considerations
for Node.js Applications
Managing Node Dependencies
•  ‘Requiring’ external libraries is handled though the
   CommonJS module pattern.
•  3rd party libraries distributed though NPM package
   management tool
•  Packages can be installed globally or locally
•  Application dependencies can be expressed in a manifest
   file (package.json)




  Business Considerations
  for Node.js Applications
Including Dependencies




          <script type="text/javascript" src="scripts/myscript.js"></script>




Business Considerations
for Node.js Applications
Including Dependencies
                           // System-wide (global) libraries/modules
                           // Stored in /usr/local/lib/node_modules
                           var path = require('path');
                           var fileSystem = require('fileSystem')

                           // Local (project) libraries
                           // ./node_modules
                           var restify = require('restify');
                           var nconf = require('nconf');

                           // Including scripts from somewhere in
                           // the file system
                           var MyModel = require("./lib/models/
                           MyModel");



Business Considerations
for Node.js Applications
Use Cases for Node.js
•     Creating REST APIs (JSON APIs)
•     Creating chat servers or messaging clients
•     Single-page RIA
•     Data Streaming




     Business Considerations
     for Node.js Applications
Challenges to
Adoption

Business Considerations
for Node.js Applications
Evolving API
 •  (2012.01.06 – 24.10.2012): 46 Releases!
 •  Minor, even release number is stable
 •  Minor, odd release number is development




Business Considerations
for Node.js Applications
Windows Support
•  Was written originally for *NIX systems
•  Node core largely supports WIN, 3rd party libs… not so
   much
•  Build tools recently switched to better support WIN




  Business Considerations
  for Node.js Applications
Error Handling & Debugging
•  Asynchronous code breaks call stacks
•  For synchronous code, you must handle exceptions
   carefully (try/catch)
•  For asynchronous code, you must pass errors around to
   callbacks




  Business Considerations
  for Node.js Applications
Example:
outerFunction(arg1, arg2, function (callback){
     if(!arg1 || !arg2){
           return callback(new Error("Are you forgetting something?"));
     } else {
           return innerFunction(ar1, arg2, function (error, data){
                  if(error){
                        callback(error);
                  } else {
                        try{
                              var json = JSON.parse(data)
                              callback(null, json);
                        } catch(error){
                              callback(error);
                        }
                  }
           })
     }
});

Business Considerations
for Node.js Applications
Asynchronous Code is Complex
•  Deeply nested callbacks can become difficult to read &
   maintain




  Business Considerations
  for Node.js Applications
Single Threaded




Business Considerations
for Node.js Applications
Entire Stack Must Be Non-Blocking




Business Considerations
for Node.js Applications
Case Studies


Business Considerations
for Node.js Applications
Linkedin
•  Originally build on Rails Application Framework
•  Need to composite service calls for the client
•  Persistent socket connections
•  Much smaller code base (~50Kb when minified)
•  Reduce the amount of memory leak (from mongrel)
•  Benchmarked at 20X faster
•  Using 10% original resource (from 30 servers to just 3! &
   300MB or RAM to just over 30MB)
•  More Stable


     Business Considerations
     for Node.js Applications
Linkedin Mobile Architecture


                     iOS	
                  Android	
                    Mobile	
                  Client	
  
                                                                          Web	
                  Libraries	
  



                            Node.js	
  
                                                    Mobile	
  Server	
   MongoDB	
  Database	
  
                           ApplicaLon	
  



                  Bg.	
                                    Data	
                   Data	
         Other	
  
                                   Tracking	
  
                 Queue	
                                  Service	
                Service	
      Process	
  


Business Considerations                     Credit: Kirin Prasad, Linkedin Mobile Engineer
for Node.js Applications
Yammer
•  Similar use case as LinkedIn (cross-domain proxy)
•  JSON Out/JSON In




  Business Considerations
  for Node.js Applications
Resources:
       •  Concurrent Programming for Scalable Web Architectures, Benjamine Erb.
          http://berb.github.com/diploma-thesis/community/042_serverarch.html
       •  Benchmark Comparisons:
          http://shootout.alioth.debian.org/u64/benchmark.php?
          test=all&lang=nodejs&lang2=fsharp




Business Considerations
for Node.js Applications
Conclusion


Business Considerations
for Node.js Applications
Summation
       •  Node.js leverages an evented programming model
          to handle concurrency and availability
       •  Because Node does not rely on threads/processes to
          scale, it can use considerably fewer resources
       •  Fewer resources means lower cost
       •  More concurrent users means greater revenue
          potential
       •  Because node support the real-time web, you can
          improve your user’s experience


Business Considerations
for Node.js Applications
6000 Greenwood Plaza Blvd
                                                            Suite 110
                                                            Greenwood Village, CO 80111
                                                            303.798.5458

                                                            www.aspenware.com




Michael
Filbin
Michael Filbin, Software Developer m.filbin@aspenware.com

Weitere ähnliche Inhalte

Andere mochten auch

Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS Ganesh Kondal
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGrant Goodale
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsSpringPeople
 
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shellMongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shellPriti Solanki
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDBAlex Sharp
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 

Andere mochten auch (11)

Intro to node.js web apps
Intro to node.js web appsIntro to node.js web apps
Intro to node.js web apps
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Intro to node.js
Intro to node.jsIntro to node.js
Intro to node.js
 
Entities on Node.JS
Entities on Node.JSEntities on Node.JS
Entities on Node.JS
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
Getting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.jsGetting Started with MongoDB and Node.js
Getting Started with MongoDB and Node.js
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
MongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shellMongoDB-Beginner tutorial explaining basic operation via mongo shell
MongoDB-Beginner tutorial explaining basic operation via mongo shell
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Ähnlich wie Business considerations for node.js applications

A Service-Based Architecture for Multi-domain Search on the Web
A Service-Based Architecture for Multi-domain Search on the WebA Service-Based Architecture for Multi-domain Search on the Web
A Service-Based Architecture for Multi-domain Search on the WebAlessandro Bozzon
 
A Behind the Scenes Look at the Force.com Platform
A Behind the Scenes Look at the Force.com PlatformA Behind the Scenes Look at the Force.com Platform
A Behind the Scenes Look at the Force.com PlatformSalesforce Developers
 
Oracle Application Management Suite
Oracle Application Management SuiteOracle Application Management Suite
Oracle Application Management SuiteOracleVolutionSeries
 
All Aboard the Databus
All Aboard the DatabusAll Aboard the Databus
All Aboard the DatabusAmy W. Tang
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EEDmitri Shiryaev
 
API Strategy Austin - App-centric vs Job-centric Microservices
API Strategy Austin - App-centric vs Job-centric MicroservicesAPI Strategy Austin - App-centric vs Job-centric Microservices
API Strategy Austin - App-centric vs Job-centric MicroservicesIvan Dwyer
 
Sps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client sideSps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client sideElaine Van Bergen
 
SharePoint 2010 Online for Developer
SharePoint 2010 Online for DeveloperSharePoint 2010 Online for Developer
SharePoint 2010 Online for DeveloperK.Mohamed Faizal
 
Bottlenecks exposed web app db servers
Bottlenecks exposed web app db serversBottlenecks exposed web app db servers
Bottlenecks exposed web app db serversUpender Dravidum
 
Alfresco day madrid jeff potts - activiti
Alfresco day madrid   jeff potts - activitiAlfresco day madrid   jeff potts - activiti
Alfresco day madrid jeff potts - activitiAlfresco Software
 
Alfresco Day Madrid - Jeff Potts - Activiti
Alfresco Day Madrid - Jeff Potts - ActivitiAlfresco Day Madrid - Jeff Potts - Activiti
Alfresco Day Madrid - Jeff Potts - ActivitiToni de la Fuente
 
Flash Camp Chennai - Social network with ORM
Flash Camp Chennai - Social network with ORMFlash Camp Chennai - Social network with ORM
Flash Camp Chennai - Social network with ORMRIA RUI Society
 
Connected Applications using WF and WCF
Connected Applications using WF and WCFConnected Applications using WF and WCF
Connected Applications using WF and WCFmaddinapudi
 
Windows azure uk universities overview march 2012
Windows azure uk universities overview march 2012Windows azure uk universities overview march 2012
Windows azure uk universities overview march 2012Lee Stott
 
[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform
[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform
[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure PlatformVitor Tomaz
 
Open Cloud Interop Public
Open Cloud Interop PublicOpen Cloud Interop Public
Open Cloud Interop Publicrvanhoe
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity FrameworkLynn Langit
 
Play with cloud foundry
Play with cloud foundryPlay with cloud foundry
Play with cloud foundryPeng Wan
 
Session 49 Practical Semantic Sticky Note
Session 49 Practical Semantic Sticky NoteSession 49 Practical Semantic Sticky Note
Session 49 Practical Semantic Sticky NoteISSGC Summer School
 

Ähnlich wie Business considerations for node.js applications (20)

A Service-Based Architecture for Multi-domain Search on the Web
A Service-Based Architecture for Multi-domain Search on the WebA Service-Based Architecture for Multi-domain Search on the Web
A Service-Based Architecture for Multi-domain Search on the Web
 
A Behind the Scenes Look at the Force.com Platform
A Behind the Scenes Look at the Force.com PlatformA Behind the Scenes Look at the Force.com Platform
A Behind the Scenes Look at the Force.com Platform
 
Oracle Application Management Suite
Oracle Application Management SuiteOracle Application Management Suite
Oracle Application Management Suite
 
All Aboard the Databus
All Aboard the DatabusAll Aboard the Databus
All Aboard the Databus
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EE
 
API Strategy Austin - App-centric vs Job-centric Microservices
API Strategy Austin - App-centric vs Job-centric MicroservicesAPI Strategy Austin - App-centric vs Job-centric Microservices
API Strategy Austin - App-centric vs Job-centric Microservices
 
Sps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client sideSps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client side
 
SharePoint 2010 Online for Developer
SharePoint 2010 Online for DeveloperSharePoint 2010 Online for Developer
SharePoint 2010 Online for Developer
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 
Bottlenecks exposed web app db servers
Bottlenecks exposed web app db serversBottlenecks exposed web app db servers
Bottlenecks exposed web app db servers
 
Alfresco day madrid jeff potts - activiti
Alfresco day madrid   jeff potts - activitiAlfresco day madrid   jeff potts - activiti
Alfresco day madrid jeff potts - activiti
 
Alfresco Day Madrid - Jeff Potts - Activiti
Alfresco Day Madrid - Jeff Potts - ActivitiAlfresco Day Madrid - Jeff Potts - Activiti
Alfresco Day Madrid - Jeff Potts - Activiti
 
Flash Camp Chennai - Social network with ORM
Flash Camp Chennai - Social network with ORMFlash Camp Chennai - Social network with ORM
Flash Camp Chennai - Social network with ORM
 
Connected Applications using WF and WCF
Connected Applications using WF and WCFConnected Applications using WF and WCF
Connected Applications using WF and WCF
 
Windows azure uk universities overview march 2012
Windows azure uk universities overview march 2012Windows azure uk universities overview march 2012
Windows azure uk universities overview march 2012
 
[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform
[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform
[.Net Juniors Academy] Introdução ao Cloud Computing e Windows Azure Platform
 
Open Cloud Interop Public
Open Cloud Interop PublicOpen Cloud Interop Public
Open Cloud Interop Public
 
Real-world Entity Framework
Real-world Entity FrameworkReal-world Entity Framework
Real-world Entity Framework
 
Play with cloud foundry
Play with cloud foundryPlay with cloud foundry
Play with cloud foundry
 
Session 49 Practical Semantic Sticky Note
Session 49 Practical Semantic Sticky NoteSession 49 Practical Semantic Sticky Note
Session 49 Practical Semantic Sticky Note
 

Mehr von Aspenware

Playing nice with the MEAN stack
Playing nice with the MEAN stackPlaying nice with the MEAN stack
Playing nice with the MEAN stackAspenware
 
Stop competing and start leading: A user experience case study.
Stop competing and start leading: A user experience case study.Stop competing and start leading: A user experience case study.
Stop competing and start leading: A user experience case study.Aspenware
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sitesAspenware
 
Build once deploy everywhere using the telerik platform
Build once deploy everywhere using the telerik platformBuild once deploy everywhere using the telerik platform
Build once deploy everywhere using the telerik platformAspenware
 
Building web applications using kendo ui and the mvvm pattern
Building web applications using kendo ui and the mvvm patternBuilding web applications using kendo ui and the mvvm pattern
Building web applications using kendo ui and the mvvm patternAspenware
 
Rich Web Applications with Aspenware
Rich Web Applications with AspenwareRich Web Applications with Aspenware
Rich Web Applications with AspenwareAspenware
 
Taking the Share out of Sharepoint: SharePoint Application Security.
Taking the Share out of Sharepoint: SharePoint Application Security.Taking the Share out of Sharepoint: SharePoint Application Security.
Taking the Share out of Sharepoint: SharePoint Application Security.Aspenware
 
Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)Aspenware
 
Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)Aspenware
 
Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013Aspenware
 
Aspenware TechMunch presents: mobile communities of interest
Aspenware TechMunch presents: mobile communities of interestAspenware TechMunch presents: mobile communities of interest
Aspenware TechMunch presents: mobile communities of interestAspenware
 
Hate JavaScript? Try TypeScript.
Hate JavaScript? Try TypeScript.Hate JavaScript? Try TypeScript.
Hate JavaScript? Try TypeScript.Aspenware
 
Understanding Game Mechanics
Understanding Game MechanicsUnderstanding Game Mechanics
Understanding Game MechanicsAspenware
 
What people are saying about working with Aspenware.
What people are saying about working with Aspenware.What people are saying about working with Aspenware.
What people are saying about working with Aspenware.Aspenware
 
Aspenware Customer Labs lift line experience
Aspenware Customer Labs lift line experienceAspenware Customer Labs lift line experience
Aspenware Customer Labs lift line experienceAspenware
 
Aspenware 2013 consulting program
Aspenware 2013 consulting programAspenware 2013 consulting program
Aspenware 2013 consulting programAspenware
 
On Culture and Perks
On Culture and PerksOn Culture and Perks
On Culture and PerksAspenware
 
Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...
Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...
Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...Aspenware
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sitesAspenware
 
Restful web services with nodejs
Restful web services with nodejsRestful web services with nodejs
Restful web services with nodejsAspenware
 

Mehr von Aspenware (20)

Playing nice with the MEAN stack
Playing nice with the MEAN stackPlaying nice with the MEAN stack
Playing nice with the MEAN stack
 
Stop competing and start leading: A user experience case study.
Stop competing and start leading: A user experience case study.Stop competing and start leading: A user experience case study.
Stop competing and start leading: A user experience case study.
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sites
 
Build once deploy everywhere using the telerik platform
Build once deploy everywhere using the telerik platformBuild once deploy everywhere using the telerik platform
Build once deploy everywhere using the telerik platform
 
Building web applications using kendo ui and the mvvm pattern
Building web applications using kendo ui and the mvvm patternBuilding web applications using kendo ui and the mvvm pattern
Building web applications using kendo ui and the mvvm pattern
 
Rich Web Applications with Aspenware
Rich Web Applications with AspenwareRich Web Applications with Aspenware
Rich Web Applications with Aspenware
 
Taking the Share out of Sharepoint: SharePoint Application Security.
Taking the Share out of Sharepoint: SharePoint Application Security.Taking the Share out of Sharepoint: SharePoint Application Security.
Taking the Share out of Sharepoint: SharePoint Application Security.
 
Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)
 
Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)Implementing Scrum with Microsoft Team Foundation Service (TFS)
Implementing Scrum with Microsoft Team Foundation Service (TFS)
 
Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013
 
Aspenware TechMunch presents: mobile communities of interest
Aspenware TechMunch presents: mobile communities of interestAspenware TechMunch presents: mobile communities of interest
Aspenware TechMunch presents: mobile communities of interest
 
Hate JavaScript? Try TypeScript.
Hate JavaScript? Try TypeScript.Hate JavaScript? Try TypeScript.
Hate JavaScript? Try TypeScript.
 
Understanding Game Mechanics
Understanding Game MechanicsUnderstanding Game Mechanics
Understanding Game Mechanics
 
What people are saying about working with Aspenware.
What people are saying about working with Aspenware.What people are saying about working with Aspenware.
What people are saying about working with Aspenware.
 
Aspenware Customer Labs lift line experience
Aspenware Customer Labs lift line experienceAspenware Customer Labs lift line experience
Aspenware Customer Labs lift line experience
 
Aspenware 2013 consulting program
Aspenware 2013 consulting programAspenware 2013 consulting program
Aspenware 2013 consulting program
 
On Culture and Perks
On Culture and PerksOn Culture and Perks
On Culture and Perks
 
Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...
Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...
Maintaining Culture and Staying True to Your Values in Times of Change: Tye E...
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sites
 
Restful web services with nodejs
Restful web services with nodejsRestful web services with nodejs
Restful web services with nodejs
 

Kürzlich hochgeladen

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Kürzlich hochgeladen (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Business considerations for node.js applications

  • 1. 6000 Greenwood Plaza Blvd Suite 110 Greenwood Village, CO 80111 303.798.5458 www.aspenware.com Business Considerations for Node.js Applications Michael Filbin m.filbin@aspenware.com
  • 2. Agenda… •  Definitions •  Introduction to Node.js •  Problems it attempts to solve •  Drawbacks and challenges to adoption •  Use cases and case studies •  Hello World example (if time) •  Summary and conclusion Business Considerations for Node.js Applications
  • 3. Who Am I? •  Consultant at Aspenware Internet Solutions Inc. •  Background in Open Source technologies •  Currently JavaScript engineer at Pearson •  Member of Linux and Free Software foundations •  Co-founder of Gogy Inc. Business Considerations for Node.js Applications
  • 4. Who Are You? Business Considerations for Node.js Applications
  • 6. Key Terms… •  API: A collection of publically exposed methods to facilitate use of a library •  Asynchronous: The execution of a function and its result are not mutually exclusive. •  JavaScript Runtime: Optimizes and executes JavaScript code •  Language Binding: Uses of one programming language to ‘wrap’ a library in another •  Callback: A reference to executable code that is passed as an argument to a function. •  I/O Operations: Operations that involve reading/writing data through some time of interface. •  Procedural Programming: Programs are expressed in terms of steps (procedures) to be carried out •  Event-driven Programming: Execution of a program is carried out in response to events. •  Blocking Process: A process that prevents the continuation of execution until it returns. Business Considerations Brief Introduction to Node for Node.js Applications
  • 7. What Is Node? Business Considerations for Node.js Applications
  • 8. What does Node do? •  API for interacting with low-level system libraries asynchronously •  Leverages features inherent in the JavaScript language •  Intends to manage concurrency, latency, parallelism Business Considerations for Node.js Applications
  • 9. Visualizing Latency 300000000   250000000   240000000   Processor  Cycles   200000000   150000000   100000000   41000000   50000000   3   14   250   0   1   L1  Cache   3   L2  Cache   14   RAM   250   Hard  Disk   41000000   Network   240000000   Business Considerations for Node.js Applications
  • 10. Web Application Life Cycle? Route Request to Controller Action Respond to Request Make Database Query Write to log file Operate on results Business Considerations for Node.js Applications
  • 11. Traditional Scaling Model… Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Respond to Request Respond to Request Respond to Request Respond to Request Respond to Request Make Database Query Make Database Query Make Database Query Make Database Query Make Database Query Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Respond to Request Respond to Request Respond to Request Respond to Request Respond to Request Make Database Query Make Database Query Make Database Query Make Database Query Make Database Query Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Route Request to Controller Action Respond to Request Respond to Request Respond to Request Respond to Request Respond to Request Make Database Query Make Database Query Make Database Query Make Database Query Make Database Query Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Operate on results Business Considerations for Node.js Applications
  • 12. Resource Limited Scaling Load  Balancer   Web   App   App   Server   Server   Server   Search   Database   Engine   Business Considerations for Node.js Applications
  • 13. Resource Limited Scaling Business Considerations for Node.js Applications
  • 14. Node’s Execution Model •  Using an event loop •  Event occurs (emitted) •  Non-I/O operations return immediately •  I/O operations defer to libeio or libuv •  I/O interrupt received and callback is executed •  Data returned to client Event  1   libeio   FS   …   Network   Crypto   Event  N   libuv   All  on  a  single  thread  on  a  single  processor   RESTful Web Services with Node.js
  • 15. Event Loop Analogy RESTful Web Services with Node.js
  • 16. Node Architecture… Async  DNS   V8  RunLme   OpenSSL   libuv   libeio   Business Considerations for Node.js Applications
  • 17. Scaling Node Applications: Load  Balancer  /  Reverse  Proxy   App   Content   Server   Delivery   Network   (CDN)   Search   Database   Engine   Business Considerations for Node.js Applications
  • 18. Managing Node Dependencies •  ‘Requiring’ external libraries is handled though the CommonJS module pattern. •  3rd party libraries distributed though NPM package management tool •  Packages can be installed globally or locally •  Application dependencies can be expressed in a manifest file (package.json) Business Considerations for Node.js Applications
  • 19. Including Dependencies <script type="text/javascript" src="scripts/myscript.js"></script> Business Considerations for Node.js Applications
  • 20. Including Dependencies // System-wide (global) libraries/modules // Stored in /usr/local/lib/node_modules var path = require('path'); var fileSystem = require('fileSystem') // Local (project) libraries // ./node_modules var restify = require('restify'); var nconf = require('nconf'); // Including scripts from somewhere in // the file system var MyModel = require("./lib/models/ MyModel"); Business Considerations for Node.js Applications
  • 21. Use Cases for Node.js •  Creating REST APIs (JSON APIs) •  Creating chat servers or messaging clients •  Single-page RIA •  Data Streaming Business Considerations for Node.js Applications
  • 23. Evolving API •  (2012.01.06 – 24.10.2012): 46 Releases! •  Minor, even release number is stable •  Minor, odd release number is development Business Considerations for Node.js Applications
  • 24. Windows Support •  Was written originally for *NIX systems •  Node core largely supports WIN, 3rd party libs… not so much •  Build tools recently switched to better support WIN Business Considerations for Node.js Applications
  • 25. Error Handling & Debugging •  Asynchronous code breaks call stacks •  For synchronous code, you must handle exceptions carefully (try/catch) •  For asynchronous code, you must pass errors around to callbacks Business Considerations for Node.js Applications
  • 26. Example: outerFunction(arg1, arg2, function (callback){ if(!arg1 || !arg2){ return callback(new Error("Are you forgetting something?")); } else { return innerFunction(ar1, arg2, function (error, data){ if(error){ callback(error); } else { try{ var json = JSON.parse(data) callback(null, json); } catch(error){ callback(error); } } }) } }); Business Considerations for Node.js Applications
  • 27. Asynchronous Code is Complex •  Deeply nested callbacks can become difficult to read & maintain Business Considerations for Node.js Applications
  • 29. Entire Stack Must Be Non-Blocking Business Considerations for Node.js Applications
  • 31. Linkedin •  Originally build on Rails Application Framework •  Need to composite service calls for the client •  Persistent socket connections •  Much smaller code base (~50Kb when minified) •  Reduce the amount of memory leak (from mongrel) •  Benchmarked at 20X faster •  Using 10% original resource (from 30 servers to just 3! & 300MB or RAM to just over 30MB) •  More Stable Business Considerations for Node.js Applications
  • 32. Linkedin Mobile Architecture iOS   Android   Mobile   Client   Web   Libraries   Node.js   Mobile  Server   MongoDB  Database   ApplicaLon   Bg.   Data   Data   Other   Tracking   Queue   Service   Service   Process   Business Considerations Credit: Kirin Prasad, Linkedin Mobile Engineer for Node.js Applications
  • 33. Yammer •  Similar use case as LinkedIn (cross-domain proxy) •  JSON Out/JSON In Business Considerations for Node.js Applications
  • 34. Resources: •  Concurrent Programming for Scalable Web Architectures, Benjamine Erb. http://berb.github.com/diploma-thesis/community/042_serverarch.html •  Benchmark Comparisons: http://shootout.alioth.debian.org/u64/benchmark.php? test=all&lang=nodejs&lang2=fsharp Business Considerations for Node.js Applications
  • 36. Summation •  Node.js leverages an evented programming model to handle concurrency and availability •  Because Node does not rely on threads/processes to scale, it can use considerably fewer resources •  Fewer resources means lower cost •  More concurrent users means greater revenue potential •  Because node support the real-time web, you can improve your user’s experience Business Considerations for Node.js Applications
  • 37. 6000 Greenwood Plaza Blvd Suite 110 Greenwood Village, CO 80111 303.798.5458 www.aspenware.com Michael Filbin Michael Filbin, Software Developer m.filbin@aspenware.com