Your SlideShare is downloading. ×
Joys and Pains of Node.js in the Enterprise
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Joys and Pains of Node.js in the Enterprise

6,152

Published on

Presentation at the OSDC 2011

Presentation at the OSDC 2011

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,152
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
42
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Node.js started in 6/2009\nStarted to appear on radar 6/2010\nShine involved since 11/2010\n\n
  • Enterprise as in Enterprise Java\nEnterprise: Big and important\nProjects with long life-cycle\nSeparate deployment team, test team\n
  • \nCitySearch is an online city guide for all major Australian cities\nInformation on Restaurants, Bars&Clubs,Music,... \nRun by Sensis, a subsidiary of Telstra\nUsed to be Enterprise Java\nRuns on two clustered Node.js servers front-end and 2 clustered CouchDB servers back-end\n6 Million requests per month\n\n
  • Alternative to multi-threading\nOne event loop for all requests\nJavaScript on the Server with a side of asynchronous evented I/O \n
  • Constraints: Memory and CPU\nMinimum memory per thread in JVM 48K\n\n
  • \n
  • \n
  • \n
  • \n
  • Early adopters\n\n
  • Do we have high concurrency? What is high concurrency? C10K requests\nGoogle gets 3 billion per day, 34000 searches per second, 200ms \n= 6800 concurrent requests\n\nSynchronous Application programmer: Business logic\nAsynchronous: More burden on control flow\n\nOnce you start using asynchronous code, all your code will turn asynchronous\n\nGoogle = Java, C++, Python\nFacebook = Optimised PHP\neBay = Java\n\n
  • Bare metal\n
  • \n
  • \n\n
  • On par similar interpreted languages\nLinkedIn switched from Rails to Node.js for their mobile site and saw a huge performance increase\n\nPHP’s lack of performance didn’t hinder its rise to fame\n
  • \n
  • \n
  • Marriage of HTML5/CSS/JavaScript\nFat client apps are coming\nFat-client HTML5/CSS/JavaScript is JQuery ^2: Sproutcore, Cappuchino\nGMail\nTwitter\nJavaScript is a mixed blessing!\nInterpreted\nAll errors occur at runtime\nTesting, testing, testing\nDynamic typing\nCode refactoring difficult\n\nJavaScript is a mixed blessing\n
  • Node.js makes this possible!\nBackbone.js\nValidation logic\nJQuery - Node - CouchDB \nEven in the DB layer!\n\nJavaScript from Head to Tail is a win\n
  • 60% test code vs. 40% application code; 10000 LOC application code 15000 LOC test code\n\nImagine upgrading the Node.js library\n
  • Quick turn-around\nInterpreted: Short cycle between code changes \nDynamic typing: No need to bother with complex object model\nPattern language: Delegates, Facades, Service locators, \nSpeed-up JavaScript vs. Java: 1 day vs. 1 week\n\n
  • Example: 15 000 LOC test code for 10 000 LOC application code\n\nNo programming patterns -> No programming standards\nModule system with imports\nPublic methods and interfaces \nClasses and Inheritance \nNo programming standards established\nModule naming, logging, file naming\nProgramming patterns\n\nAs team grows and project grows\n
  • Node.js addresses these issues by retrofitting the language with these concepts (CommonJS for interface/ public methods, import) \nThis is ill-fitting at best\nModule system with imports\nPublic methods and interfaces \nClasses and Inheritance \nCoffee-Script\nNo programming standards established\nModule naming, logging, file naming\nProgramming patterns\n\n\n
  • “I write Enterprise Software” is meant to sound like “I write big and important software”\nEnterprise Java world\nTedious\nEnterprise Architecture\n200 000 requests per day\n
  • Easy to read, easy to use!\n
  • \n
  • \n
  • \n
  • How hard is it to find developers for this technology? New technology, but surprisingly not too complex. It is relatively easy to start developing\nWill they be around in 5 years? With the current Renaissance of JavaScript as a fat-client programming language - Quite possible; it is lacking a strong corporate sponsor; maybe Yahoo will do that\nHow hard is it to install Node.js, monitor Node.js , deploy applications to Node.js? Easy\nHow hard is it to convince operators to do that? Difficult\n\n\n
  • How does Node.js programs scale?\nCan I write a lot lot code and still manage it? \nNo defined package structure\nModules are from CommonJS with public and private methods\nNo Interfaces\nNo Inheritance\nAsynchronous Programming\nSmall to medium projects best -> If the client logic is done in JavaScript, then there is not that much left to do in Node.js\n \n\n
  • 200 000 requests per day\nPHP > Ruby > Python > Node.js \nJava EE\n\n
  • 200 000 requests per day\n
  • 200 000 requests per day\n
  • 200 000 requests per day\n
  • 200 000 requests per day\n
  • 200 000 requests per day\n
  • 200 000 requests per day\n
  • Feel the excitement!\nYoung developers lack Enterprise experience\nGithub: Social Coding\n“Look Ma, I built a framework!”\nFramework\n* Experience\n* Responsibility\nCreator of some central Node.js frameworks\n \n
  • Github\n
  • \n
  • \n
  • Quick turn-around in development\n* Small team\n* Small code base\n
  • \n
  • \n
  • Transcript

    • 1. Joys and Pains of Node.js in the Enterprise Marc Fasel @marcfasel Shine Technologies http://blog.shinetech.com
    • 2. Node.js is Hothttp://cavemancircus.com/2010/02/26/hipster-douchebags/http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
    • 3. Node.js is Hothttp://cavemancircus.com/2010/02/26/hipster-douchebags/http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
    • 4. Node.js is Hot Hipster Hackershttp://cavemancircus.com/2010/02/26/hipster-douchebags/http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
    • 5. Node.js is Hot Hipster Hackershttp://cavemancircus.com/2010/02/26/hipster-douchebags/http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
    • 6. Node.js is Hot Hipster Hackers Brogrammershttp://cavemancircus.com/2010/02/26/hipster-douchebags/http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
    • 7. Node.js is Controversyhttp://teddziuba.com/2011/10/node-js-is-cancer.htmlhttp://blog.brianbeck.com/post/10967024222/node-js-cures-cancer
    • 8. Node.js is Controversyhttp://teddziuba.com/2011/10/node-js-is-cancer.htmlhttp://blog.brianbeck.com/post/10967024222/node-js-cures-cancer
    • 9. Node.js is Controversyhttp://teddziuba.com/2011/10/node-js-is-cancer.htmlhttp://blog.brianbeck.com/post/10967024222/node-js-cures-cancer
    • 10. Shine Technologies Specialises in Enterprise software development Large corporations Node.js since version 0.2 Several Enterprise Node.js projects
    • 11. The Enterprise Team of Developers Long life-cycle Other stakeholders
    • 12. http://citysearch.com.au
    • 13. Node.js JavaScript on the server Asynchronous event-driven non-blocking I/O Event-loop Asynchronous non-blocking I/O libraries
    • 14. Multi-Threading
    • 15. Event Loop
    • 16. Node is Different!
    • 17. Experiences Node.js JavaScript Ecosystem
    • 18. Node.js
    • 19. Node.js Early adopters Only version 0.6: Not officially production-ready Surprisingly stable since 0.2 Fundamental API changes Significant infrastructure still missing
    • 20. Asynchronous Evented I/O Highly specialised I/O model Particularly useful for high concurrency Steep learning curve Control flow burden on the programmer
    • 21. Hello Worldhttp://nodejs.org/
    • 22. Callback Hellhttp://stackoverflow.com/questions/4234619/how-to-avoid-long-nesting-of-asynchronous-functions-in-node-js
    • 23. Performance
    • 24. JavaScript
    • 25. JavaScript Most common programming language in the world Will only increase in popularity Dynamic, interpreted language Quick development turn-around
    • 26. JavaScript from Nose to Tail jQuery - Node.js - CouchDB Single development language No translation between layers JavaScript Object is a JSON object is a JavaScript object
    • 27. JavaScript: Not All Joy Ben Teese: JavaScript is a dog of a language. Interpreted: All errors occur at runtime Test, test, test Dynamic typing: Refactoring difficult Programming conventions not widely used No provisions for programming-in-the-large
    • 28. Community Open, helpful, and welcoming Exploding ecosystem TJ Holowaychuk: “If I only had a dime for every Ruby library poorly ported to Node”
    • 29. When Choose Node.js?High concurrencyJavaScript from head to tailQuick development turn-aroundKeep in mind Asynchronous programming is a burden Define programming conventions early Stay in sync with Node.js versions
    • 30. Questions? When is the coffee break?
    • 31. References Node.js vs. PHP: http://www.synchrosinteractive.com/blog/9-nodejs/22-nodejs-has-a-bright- future Node.js vs. Python: http://blog.mixu.net/2011/01/17/performance-benchmarking-the-node-js- backend-of-our-48h-product-wehearvoices-net/ Express vs. Sinatra: http://tjholowaychuk.com/post/543953703/express-vs-sinatra-benchmarks JavaScript from Nose to Tail: http://www.slideshare.net/cliffano/javascript-everywhere-from-nose- to-tail

    ×