introducing nodejs - javascript on the server
DESCRIPTION
Introducing Node JS Javascript on the serverTRANSCRIPT
![Page 1: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/1.jpg)
@drieanto
![Page 2: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/2.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/3.jpg)
NodeJS vs PHP
sumber : clock.co.uk
![Page 4: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/4.jpg)
/
sumber : toptal.com
![Page 5: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/5.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/6.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/7.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/8.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/9.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/10.jpg)
Sample code
Install
•npm install express
•node server.js
![Page 11: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/11.jpg)
• npm install mysql• GET
![Page 12: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/12.jpg)
Unit Test
Mocha & Chai
![Page 13: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/13.jpg)
Secure API
![Page 14: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/14.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/15.jpg)
noSQL
•Scale•Simpler data model (less joins)•asynchronous
SQL
•Relational•normalization
![Page 16: Introducing Nodejs - Javascript on the server](https://reader035.vdocument.in/reader035/viewer/2022062702/554a43f3b4c90582328b53f3/html5/thumbnails/16.jpg)