Node.Js Server Side Javascript

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Tornado Web and MongoDB An Introduction to AsyncMongo MongoBoston John C. Zablocki Development Manager, HealthcareSource Organizer, Beantown.
By: Craig Hecock.  A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it.
N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( ) Ahmad Syafii ( ) Asri Taraqiadiyu ( )
Chap 2 System Structures.
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Ch 4: Threads Dr. Mohamed Hefeeda.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Ch 4: Threads Dr. Mohamed Hefeeda.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Thread definitions and relationship to process Multithreading.
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.
PHP and MySQL Week#1  Course Plan.  Introduction to Dynamic Web Content.  Setting Up Development Server Eng. Mohamed Ahmed Black 1.
Interesting facts about node.js.  Asynchronous I/O  How do they do that?..threads (usually) What do Web Servers do?
 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.
Node.js - What is Node.js? -
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
SE-2840 Dr. Mark L. Hornick1 NodeJS Server-side JavaScript.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
Threads. Readings r Silberschatz et al : Chapter 4.
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.
Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Operating System Concepts
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Introduction to Operating Systems Concepts
Introduction to threads
NodeJS and MEAN cs6320.
Chapter 4: Threads.
Node.Js Server Side Javascript
Physics validation database
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
The Server-side JavaScript
CS 6560: Operating Systems Design
Mobile App Development
Chapter 2: Operating-System Structures
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
NodeJS and MEAN Prof. L. Grewe.
Platform as a Service.
Chapter 4: Multithreaded Programming
Process Management Presented By Aditya Gupta Assistant Professor
Lecture 21 Concurrency Introduction
Chapter 4 Threads.
3 Things Everyone Knows About Node JS That You Don't
Introduction to Operating System (OS)
AJAX.
PHP / MySQL Introduction
Node.js talking to PROGRESS
Chapter 4: Threads.
2017, Fall Pusan National University Ki-Joune Li
Parallel Programming in Contemporary Programming Languages (Part 2)
Chapter 4: Threads.
Chapter 2: System Structures
INTRODUCTION TO By Stepan Vardanyan.
Multithreaded Programming
Week 01 Node.js Week 01
Prof. Leonardo Mostarda University of Camerino
Chapter 4: Threads & Concurrency
Why Threads Are A Bad Idea (for most purposes)
Chapter 2: Operating-System Structures
Introduction.
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
CS703 – Advanced Operating Systems
Web Servers (IIS and Apache)
Web Application Development Using PHP
Presentation transcript:

Node.Js Server Side Javascript External Sources

Introduction Node.js Node.js was created by Ryan Dahl starting in 2009, and its growth is sponsored by Joyent, his employer.

What is node.js ? Evented I/O for JavaScript Server Side JavaScript Runs on Google's V8 JavaScript Engine

Why Use Node.js ? Node's goal is to provide an easy way to build scalable network programs.

What is unique about Node.js? JavaScript used in client-side but node.js puts the JavaScript on server-side thus making communication between client and server will happen in same language Servers are normally thread based but Node.JS is “Event” based. Node.JS serves each request in a Evented loop that can able to handle simultaneous requests. Thread based servers like Apache server will serve each web request as individual threads which doesn’t fit well for concurrent connections.

WHAT IS UNIQUE ABOUT NODE.JS (CON’T)? Node.JS programs are executed by V8 Javascript engine the same used by Google chrome browser.

How does it differ? "Node is similar in design to and influenced by systems like Ruby's event machine or Python's twisted. Node takes the event model a bit further—it presents the event loop as a language construct instead of as a library."

What can you do with Node ? It is a command line tool. You download a tarball, compile and install the source. It lets you Layered on top of the TCP library is a HTTP and HTTPS client/server. The JS executed by the V8 javascript engine (the ting that makes Google Chrome so fast) Node provides a JavaScript API to access the network and file system.

WHAT CAN’T DO WITH NODE? Node is a platform for writing JavaScript applications outside web browsers. This is not the JavaScript we are familiar with in web browsers. There is no DOM built into Node, nor any other browser capability. Node can’t run on GUI, but run on terminal

Threads VS Event-driven Asynchronous Event-driven Lock application / request with listener-workers threads only one thread, which repeatedly fetches an event Using incoming-request model Using queue and then processes it multithreaded server might block the request which might involve multiple events manually saves state and then goes on to process the next event Using context switching no contention and no context switches Using multithreading environments where listener and workers threads are used frequently to take an incoming-request lock Using asynchronous I/O facilities (callbacks, not poll/select or O_NONBLOCK) environments

Why node.js use event-based? In a normal process cycle the webserver while processing the request will have to wait for the IO operations and thus blocking the next request to be processed. Node.JS process each request as events, The server doesn’t wait for the IO operation to complete while it can handle other request at the same time. When the IO operation of first request is completed it will call-back the server to complete the request.

System Requirements Node runs best on the POSIX-like operating systems. These are the various UNIX derivatives (Solaris, and so on) or work a likes (Linux, Mac OS X, and so on). While Windows is not POSIX compatible, Node can be built on it either using POSIX compatibility environments (in Node 0.4x and earlier).

Node.js VS Apache It's fast It can handle tons of concurrent requests It's written in JavaScript (which means you can use the same code server side and client side) Platform Number of request per second PHP ( via Apache) 3187,27 Static ( via Apache ) 2966,51 Node.js 5569,30

Conclusion Node.js faster than apache but it more hungry system’s CPU and memory Node.js use event based programming, it make the server doesn’t wait for the IO operation to complete while it can handle other request at the same time

Reference http://joind.in/3359 (gabriele lana : gabriele.lana@cleancode.it twitter: @gabrielelana) http://devlup.com/javascript/node-js-server-side- javascript/2198/ http://nodejs.org http://net.tutsplus.com/tutorials/javascript- ajax/this-time-youll-learn-node-js/ E-mail diana : roiswatidiana@gmail.com

REFERENCE (CONT’D) http://ta.gd/samsnodepresentation http://slideshare.net (Cojocaru Radu, node.js vs PHP & Apache)