introducing nodejs - javascript on the server
DESCRIPTION
Introducing Node JS Javascript on the serverTRANSCRIPT
@drieanto
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
NodeJS vs PHP
sumber : clock.co.uk
/
sumber : toptal.com
Examples of Where Node.js Should Be Used
CHAT
API ON TOP OF AN OBJECT DB
QUEUED INPUTS
DATA STREAMING
PROXY
SYSTEM MONITORING DASHBOARD
Where Node.js Shouldn’t Be Used
SERVER-SIDE WEB APPLICATION W/ A RELATIONAL DB BEHIND
HEAVY SERVER-SIDE COMPUTATION/PROCESSING
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.
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…
Getourguide?
Express + Connect + Socket.io
building single and multi-page, and hybrid web applications
middleware framework build on express
realtime apps
Sample code
Install
•npm install express
•node server.js
• npm install mysql• GET
Unit Test
Mocha & Chai
Secure API
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
noSQL
•Scale•Simpler data model (less joins)•asynchronous
SQL
•Relational•normalization