The talk I gave on UA Dev Club, 8-Jul-2014
This isNode.js
View Slide
[email protected]http://beletsky.nethttp://twitter.com/alexbeletsky
"I was concerned about the ability toprogram advanced push features intothe website like I had seen in Gmail"Ryan Dahlthe creator of Node.js
V8Google's open source JavaScript engine.V8 can run standalone, or can be embedded into any C++ application.
LibUVHigh performance evented I/OOriginally based on LibEV switch to LibUV with support of Windows
JavaScriptDynamic, prototype-based languageHighly popular due to browser programming
http://jsconf.eu/2009/speakers.html
Why JavaScript?functions as first-class citizen
Why JavaScript?function as first-class citizen//closures..
JavaScript designed for event-oriented systemsThere was a natural fit V8 + LibEV + JavaScript
“Node.js is a platform for easily buildingscalable network applications. Node.jsuses an event-driven (single threaded),non-blocking I/O model that makes itlightweight and efficient…”http://nodejs.org
Non Blocking I/OThe concept of accessing I/O without blocking of application
https://www.flickr.com/photos/papyrist/Line to ATM is blocking I/O
Mac’s Drive is non-blocking I/O
execution started from first line..Output:
async operation started…Output:
but execution goes on..> pingOutput:
after ~ms file is read…> ping> pongOutput:
Event DrivenApplication flow is driven by events
http://misclassblog.com/interactive-web-development/node-js/
Single ThreadedSingle-thread programming concepts is more easy to understand. Applicationsrunning in single thread are lightweight and efficient
“Node.js is designed forbuilding efficientnetworking applications”
Core components:!• HTTP / HTTPS• TCP / UDP / Sockets• DNS• File System• Crypto / Arch• Events• Streams
Efficiency & ScalabilityBuild-in server, high concurrency, horizontal scalability, clustering
NPMNode Package Manager - the richest collection of high quality open sourcemodules
Thanks,@alexbeletsky