4. Node.js is Hot
Hipster Hackers
http://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 Hackers
http://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 Brogrammers
http://cavemancircus.com/2010/02/26/hipster-douchebags/
http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer
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
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 concurrency
JavaScript from head to tail
Quick development turn-around
Keep in mind
Asynchronous programming is a burden
Define programming conventions early
Stay in sync with Node.js versions
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
Notes de l'éditeur
\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
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