SlideShare a Scribd company logo
1 of 15
Download to read offline
Node.js and meteor
Next generation web development for the realtime web

Martin Naumann - Software Engineer
Centralway Factory AG
Submission #386
AGENDA
●
●
●
●
●
●
●
●

What is node.js?
Why do you want it?
Comparison
Quick: express.js
Even quicker: meteor.js
Meteor.js example
To node or not to node
Alternatives

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
What is node.js?
●
●
●
●
●
●

Javascript on the server
event-driven architecture
asynchronous I/O
scalable
based on V8
modular

"Yeah. Nice buzzwords. What's the point?"

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Why you want node.js?
●

One instance can handle lots of clients
○ reduced memory footprint
○ get more performance from existing resources
○ Benchmark: up to 1.600.000 concurrent requests

●

Use your frontend technology on the backend
○ you have Javascript in your application anyway
○ "Oh look, this looks familiar!"
○ You know your stuff: Callbacks, Closures, Asynchronity

●

It's modular
○ easy to connect pieces of code
○ easy to write network code
○ rapidly build complex applications
Level Two

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Comparison: "Elders of web dev" vs. node.js
●
●
●
●

●
●

HTTP is the base of all web applications
HTTP was synchronous.
Most of the web languages still are.
HTTP evolved:
○ AJAX
○ Websockets
○ Push
real-time web
Need for asynchronous technologies
○ all of which are a bit weird in PHP, Java, ASP, etc.
○ node.js is asynchronous and has ever been.

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Quick! To the web app - with express
var express = require("express");
var app = express.createServer();
app.get('/:msg', function(req, res) {
res.send(req.params.msg);
});

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
What boilerplate code is left?
●
●
●
●
●
●
●

Setup the server
Route requests
Take care of HTTP
Data sychronisation
Persist data
Write an Interface (API)
Setup server-side and client-side code

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Why not have...
●
●
●
●
●

the code separated by conventions
the server automatically deliver it
automatic persistance
automatic synchronisation
automatically compensate latency

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Quicker: meteor.js - A real-time app example
"So I heard you wanted to implement a chat app"
●
Write a server and a client
●
transmitting messages in nearly real-time
●
with multiple chatrooms
●
users can pick a nickname
●
users can create rooms
●
What do you think how many lines of code this requires?
54.
Server and client together.
7 are blank.
JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Meteor.js example: The server
var Rooms = new Meteor.Collection("rooms");
var Messages = new Meteor.Collection("messages");

Yup. That's it.

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Meteor.js example: The client I / II
Template.main.currentRoom = function (){
return Session.get("room") || false;
};
Template.rooms.availableRooms = function (){
return Rooms.find({});
};

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Meteor.js example: The client II / II
Template.room.events = {
"click #leave": function() {
if(!window.confirm("Leave this room", "Really leave?")) return;
Session.set("room", undefined);
},
"submit": function() {
Messages.insert({
"room": Session.get("room"),
"author": Session.get("name"),
"text": $("#msg").val()
});
$("#msg").val("");
}
};

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
To node or not to node - that shall be the question
●

Where node does make sense
○
real-time applications
○
processing long-running or I/O intensive tasks

●

Where it doesn't make sense
○
static web pages
○
small web applications for standard CRUD

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Alternatives
●
●
●
●
●

Ruby: EventMachine
Python: Twisted
PHP: Photon
Java: javaeventing
Perl: Mojo

JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
Thanks for listening!
Questions?

Martin Naumann - www.geekonaut.de
Centralway Factory AG - www.centralway.com
martin.naumann@centralway.com
@AVGP - github.com/AVGP

More Related Content

Viewers also liked (12)

Meteor node upnorth-bobdavies
Meteor node upnorth-bobdaviesMeteor node upnorth-bobdavies
Meteor node upnorth-bobdavies
 
Meteor Deployment Planning
Meteor Deployment PlanningMeteor Deployment Planning
Meteor Deployment Planning
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 
Deploy meteor in production
Deploy meteor in productionDeploy meteor in production
Deploy meteor in production
 
Offience's Node showcase
Offience's Node showcaseOffience's Node showcase
Offience's Node showcase
 
Meteor js
Meteor jsMeteor js
Meteor js
 
Intro To Meteor (Las Vegas Ruby User Group Talk)
Intro To Meteor (Las Vegas Ruby User Group Talk)Intro To Meteor (Las Vegas Ruby User Group Talk)
Intro To Meteor (Las Vegas Ruby User Group Talk)
 
Why meteor
Why meteorWhy meteor
Why meteor
 
Meteor
MeteorMeteor
Meteor
 
The End of Dinosaurs happened because of [a] Meteor
The End of Dinosaurs happened because of [a] MeteorThe End of Dinosaurs happened because of [a] Meteor
The End of Dinosaurs happened because of [a] Meteor
 
Meteor JS News
Meteor JS NewsMeteor JS News
Meteor JS News
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 

Similar to Next generation web development with node.js and meteor

Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
codebits
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
rajivmordani
 
web 2. 0 performance testing - Dave chadwick
web 2. 0 performance testing - Dave chadwickweb 2. 0 performance testing - Dave chadwick
web 2. 0 performance testing - Dave chadwick
Roopa Nadkarni
 

Similar to Next generation web development with node.js and meteor (20)

Node.js Test
Node.js TestNode.js Test
Node.js Test
 
Node js
Node jsNode js
Node js
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
Nodejs
NodejsNodejs
Nodejs
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
 
WebDev Simplified React.js.pptx
WebDev Simplified React.js.pptxWebDev Simplified React.js.pptx
WebDev Simplified React.js.pptx
 
Meteor - The next generation software stack
Meteor - The next generation software stackMeteor - The next generation software stack
Meteor - The next generation software stack
 
The Next Generation Software Stack: Meteor
The Next Generation Software Stack: MeteorThe Next Generation Software Stack: Meteor
The Next Generation Software Stack: Meteor
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
"Node.js vs workers — A comparison of two JavaScript runtimes", James M Snell
 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
 
Globant Week Cali - Entendiendo el desarrollo Front-end del mundo moderno.
Globant Week Cali - Entendiendo el desarrollo Front-end del mundo moderno.Globant Week Cali - Entendiendo el desarrollo Front-end del mundo moderno.
Globant Week Cali - Entendiendo el desarrollo Front-end del mundo moderno.
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js Presentation
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
web 2. 0 performance testing - Dave chadwick
web 2. 0 performance testing - Dave chadwickweb 2. 0 performance testing - Dave chadwick
web 2. 0 performance testing - Dave chadwick
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 

Next generation web development with node.js and meteor

  • 1. Node.js and meteor Next generation web development for the realtime web Martin Naumann - Software Engineer Centralway Factory AG Submission #386
  • 2. AGENDA ● ● ● ● ● ● ● ● What is node.js? Why do you want it? Comparison Quick: express.js Even quicker: meteor.js Meteor.js example To node or not to node Alternatives JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 3. What is node.js? ● ● ● ● ● ● Javascript on the server event-driven architecture asynchronous I/O scalable based on V8 modular "Yeah. Nice buzzwords. What's the point?" JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 4. Why you want node.js? ● One instance can handle lots of clients ○ reduced memory footprint ○ get more performance from existing resources ○ Benchmark: up to 1.600.000 concurrent requests ● Use your frontend technology on the backend ○ you have Javascript in your application anyway ○ "Oh look, this looks familiar!" ○ You know your stuff: Callbacks, Closures, Asynchronity ● It's modular ○ easy to connect pieces of code ○ easy to write network code ○ rapidly build complex applications Level Two JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 5. Comparison: "Elders of web dev" vs. node.js ● ● ● ● ● ● HTTP is the base of all web applications HTTP was synchronous. Most of the web languages still are. HTTP evolved: ○ AJAX ○ Websockets ○ Push real-time web Need for asynchronous technologies ○ all of which are a bit weird in PHP, Java, ASP, etc. ○ node.js is asynchronous and has ever been. JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 6. Quick! To the web app - with express var express = require("express"); var app = express.createServer(); app.get('/:msg', function(req, res) { res.send(req.params.msg); }); JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 7. What boilerplate code is left? ● ● ● ● ● ● ● Setup the server Route requests Take care of HTTP Data sychronisation Persist data Write an Interface (API) Setup server-side and client-side code JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 8. Why not have... ● ● ● ● ● the code separated by conventions the server automatically deliver it automatic persistance automatic synchronisation automatically compensate latency JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 9. Quicker: meteor.js - A real-time app example "So I heard you wanted to implement a chat app" ● Write a server and a client ● transmitting messages in nearly real-time ● with multiple chatrooms ● users can pick a nickname ● users can create rooms ● What do you think how many lines of code this requires? 54. Server and client together. 7 are blank. JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 10. Meteor.js example: The server var Rooms = new Meteor.Collection("rooms"); var Messages = new Meteor.Collection("messages"); Yup. That's it. JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 11. Meteor.js example: The client I / II Template.main.currentRoom = function (){ return Session.get("room") || false; }; Template.rooms.availableRooms = function (){ return Rooms.find({}); }; JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 12. Meteor.js example: The client II / II Template.room.events = { "click #leave": function() { if(!window.confirm("Leave this room", "Really leave?")) return; Session.set("room", undefined); }, "submit": function() { Messages.insert({ "room": Session.get("room"), "author": Session.get("name"), "text": $("#msg").val() }); $("#msg").val(""); } }; JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 13. To node or not to node - that shall be the question ● Where node does make sense ○ real-time applications ○ processing long-running or I/O intensive tasks ● Where it doesn't make sense ○ static web pages ○ small web applications for standard CRUD JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 14. Alternatives ● ● ● ● ● Ruby: EventMachine Python: Twisted PHP: Photon Java: javaeventing Perl: Mojo JAZOON’12: Rookie Award, Next generation web development, Martin Naumann
  • 15. Thanks for listening! Questions? Martin Naumann - www.geekonaut.de Centralway Factory AG - www.centralway.com martin.naumann@centralway.com @AVGP - github.com/AVGP