Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.

Slides:



Advertisements
Similar presentations
N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( ) Ahmad Syafii ( ) Asri Taraqiadiyu ( )
Advertisements

© 2014 IBM Corporation Empowering the IBM ecosystem Introduction to Developing applications using node.js on Bluemix IBM Ecosystem Development Instructors.
Introduction to ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Static vs. Dynamic Web Pages.NET Framework Installing ASP.NET First.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Introduction to Web Based Application. Web-based application TCP/IP (HTTP) protocol Using WWW technology & software Distributed environment.
Lecture 2: Technical Basics
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
WEB DESIGN SOME FOUNDATIONS. SO WHAT IS THIS INTERNET.
JavaScript Event Loop Not yo mama’s multithreaded approach. slidesha.re/ZPC2nD.
 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.
Client/Server Architectures
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
MEAN Stack c0nrad. Overview Day 1: – MEAN Stack – NodeJS Mini Cat Fact Spammer – MongoDB Cat Profiles – Express Catbook API (Facebook for cats) Day 2:
Chapter 1: Introduction to Web
L. Grewe LAMP, WAMP and... Motivaiton Basic Web Systems with Delivery of Static and Dynamic Web Pages html, css, media javascript (“dynamic” on client.
Paradigms & Benchmarks Ryan McCune CSE Final Presentation 11/3/11 Notre Dame Computer Science 1.
Introduction to Internet Programming (Web Based Application)
Node.js - What is Node.js? -
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
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,
Martin Kruliš by Martin Kruliš (v1.1)1.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
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.
The basics of knowing the difference CLIENT VS. SERVER.
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 ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
Learn Nodejs by Building 10 projects. What is Nodejs  An Open source, Cross platform, Event Based and Non-blocking framework used to develop server side.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
CS320 Web and Internet Programming Introduction to Web Application Development Chengyu Sun California State University, Los Angeles.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Dive into web development
Profound.js: The future of open source development on IBM i
NodeJS and MEAN cs6320.
Node.Js Server Side Javascript
Physics validation database
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
AJAX.
PHP / MySQL Introduction
CS5220 Advanced Topics in Web Programming Course Overview
Developing applications using Chromium
Node.js talking to PROGRESS
LAMP, WAMP and.. L. Grewe.
A lot of Software Development is about learning
Node.Js Server Side Javascript
2017, Fall Pusan National University Ki-Joune Li
Nathan Totten Technical Evangelist Windows Azure
Secure Web Programming
INTRODUCTION TO By Stepan Vardanyan.
Week 01 Node.js Week 01
CS5220 Advanced Topics in Web Programming Course Overview
Introduction.
Web Servers (IIS and Apache)
Web Application Development Using PHP
Presentation transcript:

Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015

Why node.js ? “Node's goal is to provide an easy way to build scalable Network programs”

Created by Ryan Dahl in 2009 Development && maintenance sponsored by Joyent Licence MIT Last release : Based on Google V8 Engine packages About Node.js……

Success Stories…..

● Vert.x => Polygot programming ● Akka => Scala and Java ● Tornado => Python ● Libevent => C ● EventMachine => Ruby Other projects like Node.js….

● Another Web framework ● For beginner ● Multi-thread Node.js is not……

Traditional desktop applications have a user interface wired up with background logic –user interfaces are based on Windows Forms, Jswing, WPF, Gtk, Qt, etc. and dependant on operating system On the web user interfaces are standardized –HTML for markup –CSS for style –JavaScript for dynamic content In the past proprietary technologies existed on the web, e.g. Adobe Flash, ActiveX –They are slowly dying Data is generated on the server, transferred to the client and displayed by the browser Server Side technologies include PHP, JSP, ASP.net, Rails, Djanog, and yes, also node.js Development for the Web….

● REST = REpresentational State Transfer ● Not new technology ● Architectural style for client-server REST……

● General interface ● Scalability of component interface ● Reduce latency ● Encapsulate legacy system Goals of REST……..

● GET ● POST ● PUT ● DELETE HTTP Method……

● POST => Create ● GET => Read ● PUT => Update ● DELETE => Delete HTTP Method with CRUD…..

● Non Blocking I/O ● V8 Javascript Engine ● Single Thread with Event Loop ● 40,025 modules ● Windows, Linux, Mac ● 1 Language for Frontend and Backend ● Active community Why node.js ?

Asynchronous i/o framework Core in c++ on top of v8 Rest of it in javascript Swiss army knife for network Related stuffs Can handle thousands of Concurrent connections with Minimal overhead (cpu/memory) on a single process It’s NOT a web framework, and it’s also NOT a language What is node.js? « A platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. »

Friendly callbacks Ubiquitous No I/o Primitives One language to RULE them all JavaScript is well known for client-side scripts running inside the browser node.js is JavaScript running on the server-side SSJS -> Server-Side JavaScript Use a language you know Use the same language for client side and server side Why javascript ?!!!

JavaScript Engines……

Perform asynchronous processing on single thread instead of classical multithread processing, minimize overhead & latency, maximize scalability Scale horizontally instead of vertically Ideal for applications that serve a lot of requests but dont use/need lots of computational power per request Not so ideal for heavy calculations, e.g. massive parallel computing Also: Less problems with concurrency The idea behind node.js….

Node.js Event Loop There are a couple of implications of this apparently very simple and basic model Avoid synchronous code at all costs because it blocks the event loop Which means: callbacks, callbacks, and more callbacks

Example :: Read data from file and show data Blocking vs Non-Blocking……

● Read data from file ● Show data ● Do other tasks var data = fs.readFileSync( “test.txt” ); console.log( data ); console.log( “Do other tasks” ); Blocking…..

● Read data from file When read data completed, show data ● Do other tasks fs.readFile( “test.txt”, function( err, data ) { console.log(data); }); Non-Blocking…… Callback

Chat/Messaging Real-time Applications Intelligent Proxies High Concurrency Applications Communication Hubs Coordinators When to use it ?

● Web application ● Websocket server ● Ad server ● Proxy server ● Streaming server ● Fast file upload client ● Any Real-time data apps ● Anything with high I/O Node.js for….

and Download tar.gzhttp://nodejs.org/ Extract to any directory $./configure && make install Getting Started…..

Project informations Name Version Dependencies Licence Main file Etc... File package.json…..

● ● # of modules = 1,21,943 Node.js Modules…..

$npm install Install module…..

var http = require(‘http’); var fs = require(‘fs’); var express = require(‘express’); Using module…..

In NodeJS