SlideShare a Scribd company logo
Getting Started With
Node.js and mongoDB
Grant Goodale (@ggoodale)
7/26/2010
What is                              ?
“Evented I/O for V8 Javascript” – http://nodejs.org
Application engine for “scalable network applications”
Really freaking fast:
  One process, zero* threads
  (Almost) no blocking

                           * actually, there is a thread pool. We’ll get to that.
What is                       ?

High concurrency with low overhead
No thread swapping or context switching
Applications must be designed from the ground up to
not block on I/O, CPU-intensive work, etc.
What Node.js Isn’t
 A full-stack web framework (a la Ruby on Rails)
 But! you can get there:
   ExpressJS: (http://expressjs.com/) (Web framework
   with MongoDB support built in - similar to Sinatra)
   http://github.com/senchalabs/connect (Rack-like
   middleware for Node and Express)
   haml.js: http://github.com/visionmedia/haml.js (Pure
   js implementation of HAML)
What Node.js Isn’t (cont.)
 Great at sending large static files concurrently. (use
 nginx.)
   Buffer implementation in recent versions improves
   this dramatically: http://nodejs.org/jsconf2010.pdf
 Completely non-blocking.
   CPU-intensive stuff will still block you (do it in a
   worker process).
   Some system calls (executed in a thread pool)
&




http://www.flickr.com/photos/tonyjcase/2803950283/
&

Great together! Both:
  speak Javascript
  understand JSON documents
  are freaking fast.
So, what should you build?
&

You can build: Standard n-tier web applications
Great way to learn mongoDB and Node
Go build a blog engine! (Everyone does.)
Lots of libraries to help you get started: ExpressJS,
Connect, etc.
&
You should build:
  Applications requiring high throughput and
  concurrency
  Applications with real-time needs
  Applications with long-polling connections
Real-time multiuser chat
Web or log analytics (e.g. Hummingbird)
Getting Started

 Grab the following:
 mongoDB: http://www.mongodb.org/downloads
 Node.js: http://nodejs.org/#download
 npm, a package manager for Node:
   curl http://npmjs.org/install.sh | sh
Getting Started


 Use npm to install a mongoDB driver for Node:
   npm install mongodb
   Tons of other fun stuff as well - full package list at
   http://npm.mape.me/
Evented I/O: a Primer
Before:
Evented I/O: a Primer
After:
Evented I/O: a Primer
After:
Evented I/O: a Primer
After:
A simple example: Syslog
Mongoose

http://www.learnboost.com/mongoose/
Cleans up a bit of the nested callback “fun”
Mongoose

http://www.learnboost.com/mongoose/
Cleans up a bit of the nested callback “fun”
Mongoose
Adds ORM capabilities (but doesn’t mandate them)
Other Fun Stuff:

 http://wiki.github.com/ry/node/modules (Need
 extensions? We got 'em.)
   Routers, file servers, frameworks, crypto...
 http://socket.io/: Cross-platform WebSockets
   Supports HTML5 websockets
   Falls back to Flash / AJAX in less capable browsers
Questions?
twitter: ggoodale
 email: grant@moreblinktag.com

More Related Content

What's hot

Future of NodeJS
Future of NodeJSFuture of NodeJS
Future of NodeJS
Sébastien Pertus
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Joseph de Castelnau
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
Sudar Muthu
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't
F5 Buddy
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
Hüseyin BABAL
 
Create Rest API in Nodejs
Create Rest API in Nodejs Create Rest API in Nodejs
Create Rest API in Nodejs
Irfan Maulana
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
Devang Garach
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
Fred Chien
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
Nurul Ferdous
 
Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
Arjun Sreekumar
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
 
Node js
Node jsNode js
Node js
Chirag Parmar
 
Introduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devIntroduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal dev
mcantelon
 
Node js实践
Node js实践Node js实践
Node js实践
jay li
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
Ben Lin
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
Fabien Vauchelles
 
Philly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSPhilly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJS
Ross Kukulinski
 
Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginner
Maninder Singh
 
Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming  Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming
Tom Croucher
 

What's hot (20)

Future of NodeJS
Future of NodeJSFuture of NodeJS
Future of NodeJS
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Create Rest API in Nodejs
Create Rest API in Nodejs Create Rest API in Nodejs
Create Rest API in Nodejs
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
 
Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
 
Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node js
Node jsNode js
Node js
 
Introduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devIntroduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal dev
 
Node js实践
Node js实践Node js实践
Node js实践
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Philly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSPhilly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJS
 
Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginner
 
Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming  Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming
 

Viewers also liked

머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)
홍배 김
 
Technical Radar (Chinese version) 2014-06
Technical Radar (Chinese version) 2014-06Technical Radar (Chinese version) 2014-06
Technical Radar (Chinese version) 2014-06
Freyr Lin
 
Solr At Scale For Time-Oriented Data: Presented by Brett Hoerner, Rocana
Solr At Scale For Time-Oriented Data: Presented by Brett Hoerner, RocanaSolr At Scale For Time-Oriented Data: Presented by Brett Hoerner, Rocana
Solr At Scale For Time-Oriented Data: Presented by Brett Hoerner, Rocana
Lucidworks
 
Nano Server First Step
Nano Server First StepNano Server First Step
Nano Server First Step
Kazuki Takai
 
Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011
Sylvain Wallez
 
Dataiku pig - hive - cascading
Dataiku   pig - hive - cascadingDataiku   pig - hive - cascading
Dataiku pig - hive - cascading
Dataiku
 
Graylog for open stack 3 steps to know why
Graylog for open stack    3 steps to know whyGraylog for open stack    3 steps to know why
Graylog for open stack 3 steps to know why
Mạnh Đinh
 
Azure Large Scale Deployments - Tales from the Trenches
Azure Large Scale Deployments - Tales from the TrenchesAzure Large Scale Deployments - Tales from the Trenches
Azure Large Scale Deployments - Tales from the Trenches
Aaron Saikovski
 
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin CenterDeploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
WASdev Community
 
15h00 intel - intel big data for aws summits rev3
15h00   intel - intel big data for aws summits rev315h00   intel - intel big data for aws summits rev3
15h00 intel - intel big data for aws summits rev3
infolive
 
Click or clunk
Click or clunkClick or clunk
Click or clunk
Emily Kissner
 
Introducing the Big Data Ecosystem with Caserta Concepts & Talend
Introducing the Big Data Ecosystem with Caserta Concepts & TalendIntroducing the Big Data Ecosystem with Caserta Concepts & Talend
Introducing the Big Data Ecosystem with Caserta Concepts & Talend
Caserta
 
Fracture du pied chez l'enfant
Fracture du pied chez l'enfantFracture du pied chez l'enfant
Fracture du pied chez l'enfant
Ayoub EL KADDOURI
 
Next Generation Data Center Strategies
Next Generation Data Center StrategiesNext Generation Data Center Strategies
Next Generation Data Center Strategies
Venkat Nambiyur
 
Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...
Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...
Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...
Paris Open Source Summit
 
Architecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi AccountsArchitecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi Accounts
Amazon Web Services
 
Why choose VMware vCloud Suite Standard over vSOM
Why choose VMware vCloud Suite Standard over vSOMWhy choose VMware vCloud Suite Standard over vSOM
Why choose VMware vCloud Suite Standard over vSOM
Anil Gupta (AJ) - vExpert
 
WebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination FeaturesWebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination Features
Chris Bailey
 
Pre-Con Ed: Learn What's New in CA Spectrum®
Pre-Con Ed: Learn What's New in CA Spectrum®Pre-Con Ed: Learn What's New in CA Spectrum®
Pre-Con Ed: Learn What's New in CA Spectrum®
CA Technologies
 
BVBA SOSIS van Jeroen Meus kent rustige start
BVBA SOSIS van Jeroen Meus kent rustige startBVBA SOSIS van Jeroen Meus kent rustige start
BVBA SOSIS van Jeroen Meus kent rustige start
Thierry Debels
 

Viewers also liked (20)

머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)
 
Technical Radar (Chinese version) 2014-06
Technical Radar (Chinese version) 2014-06Technical Radar (Chinese version) 2014-06
Technical Radar (Chinese version) 2014-06
 
Solr At Scale For Time-Oriented Data: Presented by Brett Hoerner, Rocana
Solr At Scale For Time-Oriented Data: Presented by Brett Hoerner, RocanaSolr At Scale For Time-Oriented Data: Presented by Brett Hoerner, Rocana
Solr At Scale For Time-Oriented Data: Presented by Brett Hoerner, Rocana
 
Nano Server First Step
Nano Server First StepNano Server First Step
Nano Server First Step
 
Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011
 
Dataiku pig - hive - cascading
Dataiku   pig - hive - cascadingDataiku   pig - hive - cascading
Dataiku pig - hive - cascading
 
Graylog for open stack 3 steps to know why
Graylog for open stack    3 steps to know whyGraylog for open stack    3 steps to know why
Graylog for open stack 3 steps to know why
 
Azure Large Scale Deployments - Tales from the Trenches
Azure Large Scale Deployments - Tales from the TrenchesAzure Large Scale Deployments - Tales from the Trenches
Azure Large Scale Deployments - Tales from the Trenches
 
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin CenterDeploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
Deploy, Monitor and Manage in Style with WebSphere Liberty Admin Center
 
15h00 intel - intel big data for aws summits rev3
15h00   intel - intel big data for aws summits rev315h00   intel - intel big data for aws summits rev3
15h00 intel - intel big data for aws summits rev3
 
Click or clunk
Click or clunkClick or clunk
Click or clunk
 
Introducing the Big Data Ecosystem with Caserta Concepts & Talend
Introducing the Big Data Ecosystem with Caserta Concepts & TalendIntroducing the Big Data Ecosystem with Caserta Concepts & Talend
Introducing the Big Data Ecosystem with Caserta Concepts & Talend
 
Fracture du pied chez l'enfant
Fracture du pied chez l'enfantFracture du pied chez l'enfant
Fracture du pied chez l'enfant
 
Next Generation Data Center Strategies
Next Generation Data Center StrategiesNext Generation Data Center Strategies
Next Generation Data Center Strategies
 
Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...
Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...
Keynote #Enterprise - L'ouverture du Cloud Microsoft, transformation open sou...
 
Architecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi AccountsArchitecting Security and Governance Across Multi Accounts
Architecting Security and Governance Across Multi Accounts
 
Why choose VMware vCloud Suite Standard over vSOM
Why choose VMware vCloud Suite Standard over vSOMWhy choose VMware vCloud Suite Standard over vSOM
Why choose VMware vCloud Suite Standard over vSOM
 
WebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination FeaturesWebSphere Technical University: Top WebSphere Problem Determination Features
WebSphere Technical University: Top WebSphere Problem Determination Features
 
Pre-Con Ed: Learn What's New in CA Spectrum®
Pre-Con Ed: Learn What's New in CA Spectrum®Pre-Con Ed: Learn What's New in CA Spectrum®
Pre-Con Ed: Learn What's New in CA Spectrum®
 
BVBA SOSIS van Jeroen Meus kent rustige start
BVBA SOSIS van Jeroen Meus kent rustige startBVBA SOSIS van Jeroen Meus kent rustige start
BVBA SOSIS van Jeroen Meus kent rustige start
 

Similar to Getting Started with MongoDB and Node.js

Nodejs
NodejsNodejs
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
Chris Cowan
 
Nodejs
NodejsNodejs
Nodejs
dssprakash
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Aaron Rosenberg
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
Victor Reyes Heitmann
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
Bhargav Anadkat
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
Felix Geisendörfer
 
Proposal
ProposalProposal
World of Node.JS
World of Node.JSWorld of Node.JS
World of Node.JS
Alexander Shtuchkin
 
Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)
Tekno Paul
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
async_io
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
Ahmed Elbassel
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
valuebound
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
Enoch Joshua
 
Nodejs
NodejsNodejs

Similar to Getting Started with MongoDB and Node.js (20)

Nodejs
NodejsNodejs
Nodejs
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Nodejs
NodejsNodejs
Nodejs
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
Proposal
ProposalProposal
Proposal
 
World of Node.JS
World of Node.JSWorld of Node.JS
World of Node.JS
 
Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Nodejs
NodejsNodejs
Nodejs
 

More from Grant Goodale

Catan world and Churchill
Catan world and ChurchillCatan world and Churchill
Catan world and Churchill
Grant Goodale
 
Seattle javascript game development - Overview
Seattle javascript game development - OverviewSeattle javascript game development - Overview
Seattle javascript game development - Overview
Grant Goodale
 
Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)
Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)
Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)
Grant Goodale
 
Geospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGeospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDB
Grant Goodale
 
Building for Real Time
Building for Real TimeBuilding for Real Time
Building for Real Time
Grant Goodale
 
Scrabbly GTUG presentation
Scrabbly GTUG presentationScrabbly GTUG presentation
Scrabbly GTUG presentation
Grant Goodale
 

More from Grant Goodale (6)

Catan world and Churchill
Catan world and ChurchillCatan world and Churchill
Catan world and Churchill
 
Seattle javascript game development - Overview
Seattle javascript game development - OverviewSeattle javascript game development - Overview
Seattle javascript game development - Overview
 
Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)
Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)
Mapping Flatland: Using MongoDB for an MMO Crossword Game (GDC Online 2011)
 
Geospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGeospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDB
 
Building for Real Time
Building for Real TimeBuilding for Real Time
Building for Real Time
 
Scrabbly GTUG presentation
Scrabbly GTUG presentationScrabbly GTUG presentation
Scrabbly GTUG presentation
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 

Getting Started with MongoDB and Node.js

  • 1. Getting Started With Node.js and mongoDB Grant Goodale (@ggoodale) 7/26/2010
  • 2. What is ? “Evented I/O for V8 Javascript” – http://nodejs.org Application engine for “scalable network applications” Really freaking fast: One process, zero* threads (Almost) no blocking * actually, there is a thread pool. We’ll get to that.
  • 3. What is ? High concurrency with low overhead No thread swapping or context switching Applications must be designed from the ground up to not block on I/O, CPU-intensive work, etc.
  • 4. What Node.js Isn’t A full-stack web framework (a la Ruby on Rails) But! you can get there: ExpressJS: (http://expressjs.com/) (Web framework with MongoDB support built in - similar to Sinatra) http://github.com/senchalabs/connect (Rack-like middleware for Node and Express) haml.js: http://github.com/visionmedia/haml.js (Pure js implementation of HAML)
  • 5. What Node.js Isn’t (cont.) Great at sending large static files concurrently. (use nginx.) Buffer implementation in recent versions improves this dramatically: http://nodejs.org/jsconf2010.pdf Completely non-blocking. CPU-intensive stuff will still block you (do it in a worker process). Some system calls (executed in a thread pool)
  • 7. & Great together! Both: speak Javascript understand JSON documents are freaking fast. So, what should you build?
  • 8. & You can build: Standard n-tier web applications Great way to learn mongoDB and Node Go build a blog engine! (Everyone does.) Lots of libraries to help you get started: ExpressJS, Connect, etc.
  • 9. & You should build: Applications requiring high throughput and concurrency Applications with real-time needs Applications with long-polling connections Real-time multiuser chat Web or log analytics (e.g. Hummingbird)
  • 10. Getting Started Grab the following: mongoDB: http://www.mongodb.org/downloads Node.js: http://nodejs.org/#download npm, a package manager for Node: curl http://npmjs.org/install.sh | sh
  • 11. Getting Started Use npm to install a mongoDB driver for Node: npm install mongodb Tons of other fun stuff as well - full package list at http://npm.mape.me/
  • 12. Evented I/O: a Primer Before:
  • 13. Evented I/O: a Primer After:
  • 14. Evented I/O: a Primer After:
  • 15. Evented I/O: a Primer After:
  • 17. Mongoose http://www.learnboost.com/mongoose/ Cleans up a bit of the nested callback “fun”
  • 18. Mongoose http://www.learnboost.com/mongoose/ Cleans up a bit of the nested callback “fun”
  • 19. Mongoose Adds ORM capabilities (but doesn’t mandate them)
  • 20. Other Fun Stuff: http://wiki.github.com/ry/node/modules (Need extensions? We got 'em.) Routers, file servers, frameworks, crypto... http://socket.io/: Cross-platform WebSockets Supports HTML5 websockets Falls back to Flash / AJAX in less capable browsers
  • 21. Questions? twitter: ggoodale email: grant@moreblinktag.com

Editor's Notes

  1. How many people have used Node.js? In production? Start with V8: http://code.google.com/p/v8/ Chrome’s javascript engine (Fast, aggressively developed) Add Evented I/O, system calls, HTTP libraries First created by Ryan Dahl @ Joyent “Scalable network applications”: tens of thousands of simultaneous connections on a single box
  2. High concurrency apps are likely to encounter the C10k problem: http://www.kegel.com/c10k.html Overhead per connection: An order of magnitude smaller than most libraries’ thread stack allocations. Builds on the approaches used by libasync, twisted, evenmachine, etc. Use kernel level event notification (kqueue, epoll, etc.) to notify when files, network connections etc. are ready to be used. App can do other work rather than blocking.
  3. Node shares more with Twisted than Rails
  4. nginx is amazing at handling static content. Buffers are the suggested way for handling binary data, large data, etc. The Buffer API is detailed here: http://nodejs.org/api.html#buffers-2
  5. Mongo’s shell is javascript, can execute javascript in process You can actually write your entire application in javascript - front end and back!
  6. In fact, there are several blog engines already. Try Wheat.
  7. Of course, building your UI on top of Node.js isn’t a bad idea if the rest of your app fits as well - no need to run a Rails app next to your Node app just for a GUI. (cf. Hummingbird).
  8. The current js driver supports master and slave connections, atomic operations, map/reduce...
  9. Chained execution of callbacks is how most every Node program will work.
  10. Recent builds of Node support udp sockets. Mongo’s great at storing semi-structured data quickly
  11. As much fun as quadruply-nested callbacks are.
  12. As much fun as quadruply-nested callbacks are.
  13. Hydrating documents loaded from the db converts them into instances of our models. Looks almost like Rails...