introducing nodejs - javascript on the server

16
@drieanto

Upload: edwin-andrianto

Post on 06-May-2015

920 views

Category:

Technology


1 download

DESCRIPTION

Introducing Node JS Javascript on the server

TRANSCRIPT

Page 1: Introducing Nodejs - Javascript on the server

@drieanto

Page 2: Introducing Nodejs - Javascript on the server

Node.js is a platform built

on Chrome's JavaScript runtime for

easily building fast, scalable

network applications.

•event-driven

•non-blocking I/O model

•perfect for data-intensive real-time

applications

Page 3: Introducing Nodejs - Javascript on the server

NodeJS vs PHP

sumber : clock.co.uk

Page 4: Introducing Nodejs - Javascript on the server

/

sumber : toptal.com

Page 5: Introducing Nodejs - Javascript on the server

Examples of Where Node.js Should Be Used

CHAT

API ON TOP OF AN OBJECT DB

QUEUED INPUTS

DATA STREAMING

PROXY

SYSTEM MONITORING DASHBOARD

Page 6: Introducing Nodejs - Javascript on the server

Where Node.js Shouldn’t Be Used

SERVER-SIDE WEB APPLICATION W/ A RELATIONAL DB BEHIND

HEAVY SERVER-SIDE COMPUTATION/PROCESSING

Page 7: Introducing Nodejs - Javascript on the server

Remember: Node.js was never created to solve the compute scaling problem. It was created to solve the I/O scaling problem, which it does really well.

Page 8: Introducing Nodejs - Javascript on the server

Node.js Web Frameworks

Sinatra-like

Rails-like

MVC frameworks

•Express

•Hapi

•Flatiron

•CompoundJS

•Geddy

•Sails.js

•More..

REST API frameworks

•actionHero.js

•Frisby

•Restify

•Restmvc

•More…

Page 9: Introducing Nodejs - Javascript on the server

Getourguide?

Express + Connect + Socket.io

building single and multi-page, and hybrid web applications

middleware framework build on express

realtime apps

Page 10: Introducing Nodejs - Javascript on the server

Sample code

Install

•npm install express

•node server.js

Page 11: Introducing Nodejs - Javascript on the server

• npm install mysql• GET

Page 12: Introducing Nodejs - Javascript on the server

Unit Test

Mocha & Chai

Page 13: Introducing Nodejs - Javascript on the server

Secure API

Page 14: Introducing Nodejs - Javascript on the server

Companies Using Node

http://nodejs.org/industry/

“We use Node.js to power the back-end of our real-time collaboration software. Between its superb scalability and performance, Node is the only logical choice for our current and future applications. 

Pete Fredricks Co-Founder, CEO

Page 15: Introducing Nodejs - Javascript on the server

noSQL

•Scale•Simpler data model (less joins)•asynchronous

SQL

•Relational•normalization

Page 16: Introducing Nodejs - Javascript on the server