SlideShare a Scribd company logo
Node.js, MongoDB
and You: Part I
Mitch Pirtle
jsDay 2014, Verona Italy - @jsdayit
First, tell me about
yourselves.
New to Node?
Come on, be honest!
New to Node?
New to MongoDB?
Does your Javascript
totally suck?
Ok my Javascript
totally sucks.
Now about me.
Mitch Pirtle
• Recovering Joomla! founder
• Mongo Master
• Starting companies since
1995
• Musician, skate punk, football
coach
• American idiot living in Turin
Important Mitch Facts
• I am not cool. However I have been called perky.
• I am not Rich. My name is Mitch. Such is life.
• I am internet famous. Just to be clear:



Internet Famous + $1.50 = $1.50
About this talk.
Ok, technically there
are three talks today.
• Session 1: All about MongoDB (this one)!
• Session 2: All about Node.js (that’s next)
• Session 3: The coolness of both together
That’s a lotta
lotta stuff to
cover
STAY ALERT
All About MongoDB
• Brief introduction to MongoDB
• CONSOLE!
• Really cool discoveries and surprises
• Shameful admissions and painful stories
In The Beginning
• We had relational databases. Back then they
were called “databases” and that’s where you
stored your data.
• Primary focus: atomicity, consistency, reliability.
• Was normal to spend 6 hours. ON ONE QUERY.
• I love vacuum tubes, keep you warm in winter.
• Life was good.
What Happened
• Hello, Internet!
• Databases became immediate source of pain for
scale, performance
• Traffic grew, along with it came bigger
expectations, infinitely more complexity, a slew
of new platforms, and Big Data™
That sure looks like a
nail to me.
Troubled Relations
• Web languages gravitated toward objects, not
3NF entites/relations
• Size of data needed to live on more than one
physical machine
• Performance requirements needed to be far
better
Along came sharding
• Can split your data across multiple machines
• Also splits your query load across multiple
machines
• Like RAID for your data, right?
What sharding brought
along for the ride
• How do you back this stuff
up?
• How do you spread a group
query across N machines
again?
• How do you run a join query
that spans a sharded table?
All those hours, spent
mastering 3NF and
procedural programming
IMPORTANT LESSON:
It is REALLY hard to scale
a relational database
engine.
The common approach pushed
logic out of the database back
into the application tier.
Then why use a
relational database
in the first place?
Then there was…
The Promises of MongoDB
• Speed - crazy whack-daddy fast
• Simplicity - JSON documents FTW
• Embedded documents
• 16MB limit
• Scale - sharding, multimaster out of the box
• Yes, I said whack-daddy.
ENOUGH TALK
BRING ON THE CONSOLE
Wait, there’s more
• Fulltext: Allows for compound indexes, supports
many languages
• Sharding: You can scale collections across N
machines
• GridFS: Simple interface to store files in your
database (CONSOLE!)
• Multimaster: Replica Sets make it possible for
read slaves, failover, redundancy
Now some cool stories
Mini Case Study: Totsy
• First ecommerce site to rely on MongoDB for all
data. Everything. Even product images and
associated media.
• I suspected it would be fast.
• I suspected we could develop quickly. 



(This was important, as they only let me hire one
guy.)
So how fast was it?
Launch story
• Went live with MongoDB on a quad-core
consumer grade el-cheapo machine, only 2GB
RAM.
• I was terrified.
• Over a million moms waiting for the launch.
• Upon launch, load was 0.05. Highest it ever got
was around 0.5.
Was development
quicker?
Development impact
• Simple models make for less code. There were
no sixteen-table joins, no ORM, one result had
all the data needed from a single query.!
• Less code makes for less bugs. No more six-
hour query debugging marathons. No more
learning why UNION was faster than JOIN…
• Less bugs leaves time for more code. Did I
mention they only let me hire one guy?
Even moar impact
• Used GridFS for all media storage.
• Allowed free MD5 checking for duplicates.
• Allowed storage of metadata per file (views,
comments, rates, whatever else we wanted).
• No need for NFS, clumsy rsync cronjobs, high
costs of NAS or iSCSI.
Now some sad stories.
The perils of schemaless
• Started prototyping quickly enough
• Made a couple changes to user model
• Made some more changes…
• WHUPS WHY FIFTEEN KINDS OF USER?!?!
Remember: Always
update existing data
when changing models.
Everything in the database!
• Backups were brutal
• Forgot to separate GridFS data from main
database
• Totally unprepared for the operational impact
Remember: Operational
impact BEFORE you
launch.
Stump the Geek™
Thanks!
• AboutMe
• @mitchitized - Twitter
• spacemonkey - GitHub
• LinkedIn - I’M AVAILABLE!

More Related Content

What's hot (20)

PPTX
Getting started with HTML & CSS
Ben Eveloff
 
PPTX
Introduction to NodeJS
Zahid Mahir
 
PPTX
My month with Ruby
alextomovski
 
PPT
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
MongoDB
 
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
PPTX
What I Learned at Open Hack Naperville
Kevin Davis
 
PDF
Ruby is dying. What languages are cool now?
Michał Konarski
 
KEY
Hybrid concurrency patterns
Kyle Drake
 
PPTX
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
PPTX
Introduction to Node.js
Edy Segura
 
PPTX
Realtime web2012
Timothy Fitz
 
PDF
npm + browserify
maxgfeller
 
PDF
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
Les-Tilleuls.coop
 
PDF
Building Real-Time Applications in Ember.js
Steve Kinney
 
PPTX
WebUSB
Suz Hinton
 
PDF
Actum Devtalk Now
Michal Sänger
 
PDF
Horizontally Scaling Node.js and WebSockets
James Simpson
 
PDF
Work smart with Gutenberg - Fellyph Cintra
Fellyph Cintra
 
PDF
Essential Node.js for Web Developers from Developer Week 2013
CA API Management
 
PDF
9 anti-patterns for node.js teams
Jeff Harrell
 
Getting started with HTML & CSS
Ben Eveloff
 
Introduction to NodeJS
Zahid Mahir
 
My month with Ruby
alextomovski
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
MongoDB
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
What I Learned at Open Hack Naperville
Kevin Davis
 
Ruby is dying. What languages are cool now?
Michał Konarski
 
Hybrid concurrency patterns
Kyle Drake
 
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
Introduction to Node.js
Edy Segura
 
Realtime web2012
Timothy Fitz
 
npm + browserify
maxgfeller
 
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
Les-Tilleuls.coop
 
Building Real-Time Applications in Ember.js
Steve Kinney
 
WebUSB
Suz Hinton
 
Actum Devtalk Now
Michal Sänger
 
Horizontally Scaling Node.js and WebSockets
James Simpson
 
Work smart with Gutenberg - Fellyph Cintra
Fellyph Cintra
 
Essential Node.js for Web Developers from Developer Week 2013
CA API Management
 
9 anti-patterns for node.js teams
Jeff Harrell
 

Viewers also liked (6)

PDF
MongoDB, Node.js, and You: PART III
Mitch Pirtle
 
PDF
MongoDB, Development and You
Mitch Pirtle
 
PDF
Cloud conference - mongodb
Mitch Pirtle
 
PDF
MongoDB, Node.js And You: PART II
Mitch Pirtle
 
PDF
Cloudy with a chance of scale
Mitch Pirtle
 
PDF
Data as Documents: Overview and intro to MongoDB
Mitch Pirtle
 
MongoDB, Node.js, and You: PART III
Mitch Pirtle
 
MongoDB, Development and You
Mitch Pirtle
 
Cloud conference - mongodb
Mitch Pirtle
 
MongoDB, Node.js And You: PART II
Mitch Pirtle
 
Cloudy with a chance of scale
Mitch Pirtle
 
Data as Documents: Overview and intro to MongoDB
Mitch Pirtle
 
Ad

Similar to Mongodb, Node.js and You: PART I (20)

PDF
Joyent circa 2006 (Scale with Rails)
bcantrill
 
PDF
My life with MongoDB
Mitch Pirtle
 
PDF
Linked Data: The Real Web 2.0 (from 2008)
Uche Ogbuji
 
PPTX
The world is not black and white – Impact of decisions over the lifetime of a...
Eric Reiche
 
PDF
Fi fo euc 2014
Licenser
 
PPTX
Yet Another Dan Kaminsky Talk (Black Ops 2014)
Dan Kaminsky
 
PDF
Building Social IRC Bots with Node.js and MongoDB
MongoDB
 
PDF
Software + Babies
ArangoDB Database
 
PDF
Monorepo at Pinterest
Suman Karumuri
 
PDF
Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu...
Loadzen
 
KEY
Is MongoDB Right For Your Project (or Organization)
Tony Bibbs
 
PDF
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
PDF
Tech Thursdays: Building Products
Hayden Bleasel
 
PDF
Java in High Frequency Trading
Viktor Sovietov
 
PDF
Scratching the itch, making Scratch for the Raspberry Pie
ESUG
 
PDF
Silicon Valley Code Camp 2016 - MongoDB in production
Daniel Coupal
 
PDF
Introducing TensorFlow: The game changer in building "intelligent" applications
Rokesh Jankie
 
PDF
Rapid Evolution of Web Dev? aka Talking About The Web
PINT Inc
 
PDF
Freifunk Munich - How to scale Jitsi
Annika Wickert
 
PPTX
Meteor: Real-time Web Made Easy
rwillmer
 
Joyent circa 2006 (Scale with Rails)
bcantrill
 
My life with MongoDB
Mitch Pirtle
 
Linked Data: The Real Web 2.0 (from 2008)
Uche Ogbuji
 
The world is not black and white – Impact of decisions over the lifetime of a...
Eric Reiche
 
Fi fo euc 2014
Licenser
 
Yet Another Dan Kaminsky Talk (Black Ops 2014)
Dan Kaminsky
 
Building Social IRC Bots with Node.js and MongoDB
MongoDB
 
Software + Babies
ArangoDB Database
 
Monorepo at Pinterest
Suman Karumuri
 
Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu...
Loadzen
 
Is MongoDB Right For Your Project (or Organization)
Tony Bibbs
 
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
Tech Thursdays: Building Products
Hayden Bleasel
 
Java in High Frequency Trading
Viktor Sovietov
 
Scratching the itch, making Scratch for the Raspberry Pie
ESUG
 
Silicon Valley Code Camp 2016 - MongoDB in production
Daniel Coupal
 
Introducing TensorFlow: The game changer in building "intelligent" applications
Rokesh Jankie
 
Rapid Evolution of Web Dev? aka Talking About The Web
PINT Inc
 
Freifunk Munich - How to scale Jitsi
Annika Wickert
 
Meteor: Real-time Web Made Easy
rwillmer
 
Ad

More from Mitch Pirtle (17)

PDF
MongoTorino 2013 Opening Keynote
Mitch Pirtle
 
KEY
Unified Content Model and Joomla!
Mitch Pirtle
 
KEY
Gridfs and MongoDB
Mitch Pirtle
 
KEY
Joomla - an Overview
Mitch Pirtle
 
KEY
Operational MongoDB
Mitch Pirtle
 
KEY
Joomla Extreme Performance
Mitch Pirtle
 
KEY
Joomla and MongoDB
Mitch Pirtle
 
PDF
Mongodb and Totsy: An e-commerce case study
Mitch Pirtle
 
KEY
Mongodb and Totsy - E-commerce Case Study
Mitch Pirtle
 
KEY
PHP, Lithium and MongoDB
Mitch Pirtle
 
KEY
Content Management Systems and MongoDB
Mitch Pirtle
 
KEY
MongoDB: Built for Speed
Mitch Pirtle
 
KEY
Content Mangement Systems and MongoDB
Mitch Pirtle
 
KEY
Joomla For Entrepreneurs
Mitch Pirtle
 
KEY
Thin Server Architecture
Mitch Pirtle
 
KEY
Developing Joomla! 1.5 Extensions, Explained
Mitch Pirtle
 
KEY
Kickapps Social Media
Mitch Pirtle
 
MongoTorino 2013 Opening Keynote
Mitch Pirtle
 
Unified Content Model and Joomla!
Mitch Pirtle
 
Gridfs and MongoDB
Mitch Pirtle
 
Joomla - an Overview
Mitch Pirtle
 
Operational MongoDB
Mitch Pirtle
 
Joomla Extreme Performance
Mitch Pirtle
 
Joomla and MongoDB
Mitch Pirtle
 
Mongodb and Totsy: An e-commerce case study
Mitch Pirtle
 
Mongodb and Totsy - E-commerce Case Study
Mitch Pirtle
 
PHP, Lithium and MongoDB
Mitch Pirtle
 
Content Management Systems and MongoDB
Mitch Pirtle
 
MongoDB: Built for Speed
Mitch Pirtle
 
Content Mangement Systems and MongoDB
Mitch Pirtle
 
Joomla For Entrepreneurs
Mitch Pirtle
 
Thin Server Architecture
Mitch Pirtle
 
Developing Joomla! 1.5 Extensions, Explained
Mitch Pirtle
 
Kickapps Social Media
Mitch Pirtle
 

Recently uploaded (20)

PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
PDF
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Digital Circuits, important subject in CS
contactparinay1
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 

Mongodb, Node.js and You: PART I

  • 1. Node.js, MongoDB and You: Part I Mitch Pirtle jsDay 2014, Verona Italy - @jsdayit
  • 2. First, tell me about yourselves.
  • 4. Come on, be honest!
  • 10. Mitch Pirtle • Recovering Joomla! founder • Mongo Master • Starting companies since 1995 • Musician, skate punk, football coach • American idiot living in Turin
  • 11. Important Mitch Facts • I am not cool. However I have been called perky. • I am not Rich. My name is Mitch. Such is life. • I am internet famous. Just to be clear:
 
 Internet Famous + $1.50 = $1.50
  • 13. Ok, technically there are three talks today.
  • 14. • Session 1: All about MongoDB (this one)! • Session 2: All about Node.js (that’s next) • Session 3: The coolness of both together
  • 15. That’s a lotta lotta stuff to cover STAY ALERT
  • 16. All About MongoDB • Brief introduction to MongoDB • CONSOLE! • Really cool discoveries and surprises • Shameful admissions and painful stories
  • 17. In The Beginning • We had relational databases. Back then they were called “databases” and that’s where you stored your data. • Primary focus: atomicity, consistency, reliability. • Was normal to spend 6 hours. ON ONE QUERY. • I love vacuum tubes, keep you warm in winter. • Life was good.
  • 18. What Happened • Hello, Internet! • Databases became immediate source of pain for scale, performance • Traffic grew, along with it came bigger expectations, infinitely more complexity, a slew of new platforms, and Big Data™
  • 19. That sure looks like a nail to me.
  • 20. Troubled Relations • Web languages gravitated toward objects, not 3NF entites/relations • Size of data needed to live on more than one physical machine • Performance requirements needed to be far better
  • 21. Along came sharding • Can split your data across multiple machines • Also splits your query load across multiple machines • Like RAID for your data, right?
  • 22. What sharding brought along for the ride • How do you back this stuff up? • How do you spread a group query across N machines again? • How do you run a join query that spans a sharded table?
  • 23. All those hours, spent mastering 3NF and procedural programming
  • 25. It is REALLY hard to scale a relational database engine.
  • 26. The common approach pushed logic out of the database back into the application tier.
  • 27. Then why use a relational database in the first place?
  • 29. The Promises of MongoDB • Speed - crazy whack-daddy fast • Simplicity - JSON documents FTW • Embedded documents • 16MB limit • Scale - sharding, multimaster out of the box • Yes, I said whack-daddy.
  • 30. ENOUGH TALK BRING ON THE CONSOLE
  • 31. Wait, there’s more • Fulltext: Allows for compound indexes, supports many languages • Sharding: You can scale collections across N machines • GridFS: Simple interface to store files in your database (CONSOLE!) • Multimaster: Replica Sets make it possible for read slaves, failover, redundancy
  • 32. Now some cool stories
  • 33. Mini Case Study: Totsy • First ecommerce site to rely on MongoDB for all data. Everything. Even product images and associated media. • I suspected it would be fast. • I suspected we could develop quickly. 
 
 (This was important, as they only let me hire one guy.)
  • 34. So how fast was it?
  • 35. Launch story • Went live with MongoDB on a quad-core consumer grade el-cheapo machine, only 2GB RAM. • I was terrified. • Over a million moms waiting for the launch. • Upon launch, load was 0.05. Highest it ever got was around 0.5.
  • 37. Development impact • Simple models make for less code. There were no sixteen-table joins, no ORM, one result had all the data needed from a single query.! • Less code makes for less bugs. No more six- hour query debugging marathons. No more learning why UNION was faster than JOIN… • Less bugs leaves time for more code. Did I mention they only let me hire one guy?
  • 38. Even moar impact • Used GridFS for all media storage. • Allowed free MD5 checking for duplicates. • Allowed storage of metadata per file (views, comments, rates, whatever else we wanted). • No need for NFS, clumsy rsync cronjobs, high costs of NAS or iSCSI.
  • 39. Now some sad stories.
  • 40. The perils of schemaless • Started prototyping quickly enough • Made a couple changes to user model • Made some more changes… • WHUPS WHY FIFTEEN KINDS OF USER?!?!
  • 41. Remember: Always update existing data when changing models.
  • 42. Everything in the database! • Backups were brutal • Forgot to separate GridFS data from main database • Totally unprepared for the operational impact
  • 45. Thanks! • AboutMe • @mitchitized - Twitter • spacemonkey - GitHub • LinkedIn - I’M AVAILABLE!