N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( 7408040010) Ahmad Syafii (7408040014) Asri Taraqiadiyu (7408040021)

Slides:



Advertisements
Similar presentations
Tornado Web and MongoDB An Introduction to AsyncMongo MongoBoston John C. Zablocki Development Manager, HealthcareSource Organizer, Beantown.
Advertisements

Intel Do-It-Yourself Challenge node.js
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.
Operating-System Structures
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
1 Chapter 4 Threads Threads: Resource ownership and execution.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Thread definitions and relationship to process Multithreading.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
E-Commerce The technical side. LAMP Linux Linux Apache Apache MySQL MySQL PHP PHP All Open Source and free packages. Can be installed and run on most.
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.
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
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.
TOPIC 1 – SERVER SIDE APPLICATIONS IFS 234 – SERVER SIDE APPLICATION DEVELOPMENT.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Silberschatz, Galvin and Gagne ©2011Operating System Concepts Essentials – 8 th Edition Chapter 4: Threads.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Paradigms & Benchmarks Ryan McCune CSE Final Presentation 11/3/11 Notre Dame Computer Science 1.
Node.js - What is Node.js? -
Chapter 2 (PART 1) Light-Weight Process (Threads) Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
1 Welcome to CSC 301 Web Programming Charles Frank.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 13 Threads Read Ch 5.1.
SE-2840 Dr. Mark L. Hornick1 NodeJS Server-side JavaScript.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
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 versus Events CSE451 Andrew Whitaker. This Class Threads vs. events is an ongoing debate  So, neat-and-tidy answers aren’t necessarily available.
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.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Typical Program Processor utilization?
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Multithreading vs. Event Driven in Code Development of High Performance Servers.
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.
Introduction to threads
NodeJS and MEAN cs6320.
Chapter 4: Threads.
Node.Js Server Side Javascript
The Server-side JavaScript
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
NodeJS and MEAN Prof. L. Grewe.
Chapter 4: Multithreaded Programming
Process Management Presented By Aditya Gupta Assistant Professor
3 Things Everyone Knows About Node JS That You Don't
AJAX.
PHP / MySQL Introduction
Node.Js Server Side Javascript
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.
Chapter 4: Threads & Concurrency
Chapter 2: Operating-System Structures
Web Application Development Using PHP
Presentation transcript:

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

I NTRODUCTION N ODE. JS Node.js was created by Ryan Dahl starting in 2009, and its growth is sponsored by Joyent, his employer.

W HAT IS NODE. JS ? Evented I/O for JavaScript Server Side JavaScript Runs on Google's V8 JavaScript Engine

W HY U SE N ODE. JS ? Node's goal is to provide an easy way to build scalable network programs.

W HAT IS UNIQUE ABOUT N ODE. JS ? 1. 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 2. 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.

W HAT IS U NIQUE ABOUT N ODE.J S (C ON ’ T )? 3. Node.JS programs are executed by V8 Javascript engine the same used by Google chrome browser.

H OW 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."

W HAT CAN YOU DO WITH N ODE ? 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.

W HAT CAN ’ T DO WITH N ODE ? 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

T HREADS VS E VENT - DRIVEN ThreadsAsynchronous Event-driven Lock application / request with listener-workers threads only one thread, which repeatedly fetches an event Using incoming-request modelUsing 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 switchingno 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

W HY 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.

S YSTEM R EQUIREMENTS 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).

N ODE. JS VS A PACHE 1. It's fast 2. It can handle tons of concurrent requests 3. It's written in JavaScript (which means you can use the same code server side and client side ) PlatformNumber of request per second PHP ( via Apache)3187,27 Static ( via Apache )2966,51 Node.js5569,30

C ONCLUSION 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

R EFERENCE (gabriele lana : javascript/2198/ ajax/this-time-youll-learn-node-js/

R EFERENCE ( CONT ’ D ) (Cojocaru Radu, node.js vs PHP & Apache)