INTRODUCTION TO By Stepan Vardanyan.

Slides:



Advertisements
Similar presentations
Microsoft Confidential. An incubation effort to: Support client -> server communication in native code with a modern C++ API design Support writing Azure-based.
Advertisements

Introduction to .NET Framework
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( ) Ahmad Syafii ( ) Asri Taraqiadiyu ( )
© 2014 IBM Corporation Empowering the IBM ecosystem Introduction to Developing applications using node.js on Bluemix IBM Ecosystem Development Instructors.
Jerry Neal. Agenda ➢ About Node ➢ Modules ➢ Node Architecture ➢ NPM ➢ FAQ ➢ Other Awesome Modules! get ready to node, this session is hands on!
 A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it really fast  Runs.
Presented by…. Group 2 1. Programming language 2Introduction.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Node.js - What is Node.js? -
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Chat Room App Logan Linn Network Application Design Fall 2010.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Stacey Mulcahy | Technical Evangelist Rami Sayar | Technical Evangelist.
Threads. Readings r Silberschatz et al : Chapter 4.
Apache Web Server Architecture Chaitanya Kulkarni MSCS rd April /23/20081Apache Web Server Architecture.
Node.Js 1. 2 Contents About Node.Js Web requirement latest trends Introduction Simple web server creation in Node.Js Dynamic Web pages Dynamic web page.
Stacey Mulcahy | Technical Evangelist Rami Sayar | Technical Evangelist.
Node.JS introduction. What is Node.JS? v8 JavaScript runtime Event driven Non-blocking standard libraries Most APIs speak streams Provides a package manager.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
A Detailed Introduction To Visual Studio.NET CRB Tech ReviewsCRB Tech Reviews introduces you to the world of Visual.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
QML and JavaScript for Native App Development Michael Tims Jen Trieu.
Profound.js: The future of open source development on IBM i
Applications Active Web Documents Active Web Documents.
Lean With MEAN.
Building Desktop Apps with Node.js and Electron
NodeJS and MEAN cs6320.
The Share Widget Library
Node.Js Server Side Javascript
Physics validation database
Angular 4 + TypeScript Getting Started
The Server-side JavaScript
Netscape Application Server
Node.js Express Web Applications
Advanced Topics in Distributed and Reactive Programming
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
NodeJS and MEAN Prof. L. Grewe.
3 Things Everyone Knows About Node JS That You Don't
Haritha Dasari Josue Balandrano Coronel -
AJAX.
PHP / MySQL Introduction
Developing applications using Chromium
Node.js talking to PROGRESS
Jessica Betts, Sophia Pandey, & Ryan Amundson
Node.Js Server Side Javascript
2017, Fall Pusan National University Ki-Joune Li
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Advanced Topics in Distributed and Reactive Programming
MEAN stack L. Grewe.
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
Lecture 1: Multi-tier Architecture Overview
Nathan Totten Technical Evangelist Windows Azure
Web Programming Language
Cordova & Cordova Plugin Installation and Management
Week 01 Node.js Week 01
Java Programming Introduction
JavaScript CS 4640 Programming Languages for Web Applications
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Week 02 Node.js Week 02
Introduction.
Advanced Topics in Functional and Reactive Programming
CMPE419 Mobile Application Development
Web Application Development Using PHP
JavaScript CS 4640 Programming Languages for Web Applications
JavaScript.
Presentation transcript:

INTRODUCTION TO By Stepan Vardanyan

CONTENT Theory: Practice: Blocking vs Non blocking i/o. V8, Libuv, node bindings. node.js history & philosophy. Npm & Frameworks. Comparison. Practice: Project structure, modules. C++ addons for node.js + example. Socket.io + node.js 50 lines realtime chat.

Resources CPU RAM HDD Network

Problem - Blocking I/O

Solution 1 - Multithreading

Solution 2 - Non-blocking I/O

Reactor design pattern Application 1 Request i/o 5b Execute Handler 5a 4 Event Queue Event Demultiplexer Event Handler Resource Operation Handler 6 Event Loop 3 Event Handler Resource Operation Handler Event Handler 2

VS

VS

Node.js Timeline Initial release in 2009. Express.js 1.0 has been released in 2010. Socket.io initial release in 2010 npm has been released in 2011. iojs separated from node.js in 2014. io.js and node.js had been merged into node.js version 4.0 ( first release version of node.js ) in 2015. Current version is 7.7.x (april 2017) Ryan Dahl - node.js creator

Google V8 V8 is google’s open source, high performance, cross browser javascript engine written in C++. V8 compiles and executes javascript source code, handles memory allocation for objects and garbage collects objects it no longer need. Developed in 2008 for Google Chrome, now used in node.js, opera, vivaldi and electron.

Libuv - Multiplatform C library Provides support for asynchronous i/o based on event loops. Full featured event loop backed by unix-epoll & kqueue, windows-IOCP, solaris - event ports. Primarily designed for use in node.js, but it is also used in other software projects.

Node.js bindings Reusability Performance Bindings simply expose core Node.js internal libraries written in C/C++ (c-ares, zlib, OpenSSL, http-parser, etc.) to JavaScript. System programming languages such as C/C++ are generally much faster than other high-level languages.

So what node.js exactly is? “Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.” official documentation Javascript engine - compiles and executes js code Cross platform async i/o layer

Node package manager - npm Developed in 2010 by Isaac Z. Schlueter npm has : 400.000+ packages 200.000+ users registered Npm is largest ecosystem of open source libraries in the world! npm install / update / uninstall {packageName}@{version} “-g” - globally, “-s” - updating in package.json

Node.js Philosophy - “The Node way” Node.js extends UNIX philosophy’s postulats: Small is beautiful. 2. Make each program do one thing well. Node.js postulats: Small core - large userland. Callback comes last - error first.

input.txt file: “Hello” Synchronous code Asynchronous code Callback and Error handling input.txt file: “Hello” Synchronous code Asynchronous code var fs = require("fs"); fs.readFile('input.txt', function (err, data) { if (err) { return console.error(err); } console.log(data.toString()); }); console.log("World"); var fs = require("fs"); var data = fs.readFileSync('input.txt'); console.log(data.toString()); console.log("World"); > Hello > World > World > Hello

Node.js frameworks

Electron - cross platform framework for desktop applications based on node.js. Electron is an open source framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.

Companies are using node.js

Node.js at PayPal In 2013 PayPal rewrited some of services from java to node.js.

Node.js at PayPal Development Performance Built almost twice as fast with fewer people. Written in 33% fewer lines of code. Constructed with 40% fewer files. Performance Double the requests per second vs. the Java application. 35% decrease in the average response time. This resulted in the pages being served 200ms faster — something users will definitely notice.

Reasons to move to Node.js “Any application that can be written in JavaScript, will eventually be written in JavaScript”. Jeff Atwood, co-founder of Stack Overflow "Node allows you to easily build applications with high confidence in build quality. Unit testing is easier. Integration testing is easier. REST is easier. Deployments are easier." Stephen Comissio, senior .NET developer at GoDaddy "We’ve been doing a lot of things twice. Pretty much had to write everything twice - once for the server and once for the client." Kim Trott, director of UI platform engineering at Netflix “The thing that I like best about Node is the amount of power that I've personally found it gives me.” Tom Croucher, Staff site reliability engineer at Uber Technologies