1 / 44

Sofia Event Center 14-15 May 2014

Sofia Event Center 14-15 May 2014. Node.js and Open Source Software Development on Microsoft Azure. Boris Simandoff, Product Manager @ Chaos Group Mihail Mateev , Senior Technical Evangelist, TL @ Infragistics Inc. How this talk has started …. Боби, хайде да направим една презентация за

lilika
Download Presentation

Sofia Event Center 14-15 May 2014

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sofia Event Center 14-15 May 2014 Node.js and Open Source Software Development on Microsoft Azure Boris Simandoff, Product Manager @ Chaos Group Mihail Mateev, Senior Technical Evangelist, TL @ Infragistics Inc.

  2. How this talk has started…. Боби, хайде да направим една презентация за Microsoft Azure

  3. How this talk has started…. Ами… щом е за облачнитехнолологииняма да откажа…но нека да е с Node.js

  4. How this talk has started…. А защо да не е за open source технологии в Microsoft Azure ? Да включим идруги технологии ?

  5. How this talk has started…. Ето така се правят презентации…

  6. Contents • Comparing Node.js to .NET • Introduction to Node.js on Windows • Accessing Azure Storage with Node.js • Using Azure SQL Database with Node.js • Building a Web Site with Node.js • Deploying a Node.js Application • Microsoft Azure Mobile Services and Node.js • Edge.js • Resources

  7. What is Node.js • Node.js is a simple but powerful tool for asynchronous network programming • By utilizing your existing knowledge of JavaScript, you can get up and running Apps quickly • Node.js is based on V8 JS engine • Practically no installation required • Very lightweight (one 7MB static exe) • Node.js encourages good software practices out of the box like async programming and inversion of control

  8. Node.jsTimeline July 2011 LinkedIn adopts node for mobile platform port to Windows IISNode April 2014 Visual Studio support Node.js for VS 2012 & 2013 Beta 1.0 April 2010 Heroku launches node support Nov 2011 Windows Azure support EBay releases API built on node Cloud9IDE azure support Nov 2010 Cloud9IDE launches Jan 2009 Created Ryan Dahl Oct 2011 node.js overtakes Ruby as most popular repo on gitHub Walmart Launch mobile site on node.js July 2010 Yammer adopts node.js Nov 2013 Visual Studio support Node.js for VS 2012 & 2013 Alpha 1.0 Feb 2012 App Harbour support

  9. Comparing Node.js to .NET • Traditional Web Server Model Client Server Dedicated Thread to service request Request Response

  10. Comparing Node.js to .NET • Traditional Web Server Model Web Server (with 1000 threads) Request 1001 Request 1 thread 1 processes the request and blocks till completion Request 1002 Response 1 Request 1003 Request 1000 thread 1000 processes the request and blocks till completion Requests queue up as blocked threads wait on server Response 1000

  11. Comparing Node.js to .NET • Async Web Server Model Client Server Request Do Async Work Once event or asyncoperation is completethread completes the request Thread is free to service other requests Return from Async Response

  12. Comparing Node.js to .NET • Async Web Server Model Web Server Request 1 Request 99999 Single threaded event Loop Response 5 • Listen for requests • Starts any I/O operations by specifying a call back to execute on completion • Continue to listen for requests Response 1 Response 99999 “With node.js everything runs in parallel Except your code ! ”

  13. Comparing Node.js to .NET • Mapping the Nomenclature

  14. Introduction to Node.js on Windows • How Node.js works?

  15. Introduction to Node.js on Windows Node is Single Threaded!

  16. Introduction to Node.js on Windows ..but, Node is FAST!

  17. Introduction to Node.js on Windows • How Node.js works? • Asynchronous I/O • Event Loop with Pool of Threads • Dead-Lock Free (no concurrency issues)

  18. Introduction to Node.js on Windows • How Node.js works?

  19. Introduction to Node.js on Windows • Why Node.js • The good parts of JavaScript are really awesome • One language for the browser and the server • Async by default • Over 1M concurrent requests

  20. Introduction to Node.js on Windows • Enabling a Node.js Server-Side App on Microsoft Azure (PaaS) • Web Role - all requests are received by Microsoft IIS 7 and passed to a native IIS module called iisnode • Worker roles are much more like the basic node application in that they directly run node.exe for Server.js when the role instance starts.

  21. Introduction to Node.js on Windows • Enabling a Node.js Server-Side App on Windows Azure (PaaS)

  22. Introduction to Node.js on Windows • Node.js in Azure Websites • The architecture for running Node.js within Azure Websites is identical to that used when hosting within a Web role

  23. Introduction to Node.js on Windows • Integrating Node with IIS / Benefits of using IISNode: • Run your Node application across multiple CPU cores • Serve static content from IIS, dynamic content from node • Integrated, browser-based debugging with node-inspector • Monitor the node executable plus changes to your code • Configuration flexibility with XML + YAML overrides • View console logs from the browser • All the other existing IIS benefits, including output caching

  24. Azure Storage with Node.js • Azure Storage • Blob Storage Table Storage Queue

  25. Azure SQL Database with Node.js • Microsoft Driver for Node.JS for SQL Server • Open First – hosted on Githubhttps://github.com/Azure/node-sqlserver • Simplicity by Design– keeps the simple API • Use in Windows Azure Web Sites

  26. Azure SQL Database with Node.js • Connecting to SQL Server Database with Node.JS varsql = require('node-sqlserver'); varconn_str = "Driver={SQL Server Native Client 11.0};" + "Server=tcp:[databasename].database.windows.net,1433;" + "Database=TaskList;Uid=[username];" + "Pwd=[password];Encrypt=yes;Connection Timeout=30“

  27. Azure SQL Database with Node.js • Connecting to SQL Server Database with Node.JS sql.open(conn_str, function (err, conn) { err && throw err; conn.queryRaw(query, function (err, results) { err && throw err; for (vari = 0; i < results.rows.length; i++) { res.write( "Description: " + results.rows[i][0] + "\n"); • } res.end(); }); }); // sql.open

  28. Mobile Services & Node.js • JSON to SQL Type Mappings

  29. Building a Web Site with Node.js • Node Options in the Gallery

  30. Building a Web Site with Node.js • DEMO

  31. Building and Deploying • No build needed • Deploy with Git (awesome)

  32. Mobile Services & Node.js Data Authentication Notifications Scripts & Svcs • Azure Mobile Services Review

  33. Mobile Services & Node.js • Microsoft Azure Mobile Services Architecture

  34. Mobile Services & Node.js • Data Storage Services

  35. Mobile Services & Node.js Node.JS Scripts • Mobile Services Data Workflow Read script Delete script Insert script Update script REST over HTTP Client SDK Simplifies This Some JSON Object{ FirstName=“…”, LastName=“…” }

  36. Mobile Services & Node.js • Authentication Services

  37. Mobile Services & Node.js • Authentication

  38. Mobile Services & Node.js • Push Notification Services

  39. Mobile Services & Node.js • Push Notifications Insert, Update, Delete, Read on a Table Script Runs in the Azure Mobile Service Automatic or Manual Server Script An Event WNS MPNS APNS GCM iOS Windows 8 WindowsPhone 8 Android

  40. Mobile Services & Node.js • Node Modules • Extensibility through numerous included modules request push.* sendgrid console mssql pusher statusCodes azure twilio

  41. Mobile Services & Node.js • DEMO

  42. Node.js and C# with Edge.js • Edge.js • Native binding to .Net world var edge = require('edge')var hello = edge.func(function() {/*async (input) => { return ".NET welcomes " + input.ToString();      • }*/})hello('Node.js', function(error, result) { error && throw errorconsole.log(result)})

  43. Resources: • Node.js - http://nodejs.org/ • Node.js for Visual Studio - https://nodejstools.codeplex.com/ • Scott Hanselman blog - http://www.hanselman.com/blog/ • Microsoft Azure – Node.js Developer Center - http://azure.microsoft.com/en-us/develop/nodejs/ • Azure SDK for Node.js in GitHub- https://github.com/Azure/azure-sdk-for-node

  44. Questions??? Share your feedback for this particular session and for the overall conference experience at http://aka.ms/intouch for a chance to win our prizes!

More Related