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

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

What's hot (20)

Getting started with HTML & CSS
Getting started with HTML & CSSGetting started with HTML & CSS
Getting started with HTML & CSS
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
My month with Ruby
My month with RubyMy month with Ruby
My month with Ruby
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
 
What I Learned at Open Hack Naperville
What I Learned at Open Hack NapervilleWhat I Learned at Open Hack Naperville
What I Learned at Open Hack Naperville
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Realtime web2012
Realtime web2012Realtime web2012
Realtime web2012
 
npm + browserify
npm + browserifynpm + browserify
npm + browserify
 
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl...
 
Building Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.jsBuilding Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.js
 
WebUSB
WebUSBWebUSB
WebUSB
 
Actum Devtalk Now
Actum Devtalk NowActum Devtalk Now
Actum Devtalk Now
 
Horizontally Scaling Node.js and WebSockets
Horizontally Scaling Node.js and WebSocketsHorizontally Scaling Node.js and WebSockets
Horizontally Scaling Node.js and WebSockets
 
Work smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph CintraWork smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph Cintra
 
Essential Node.js for Web Developers from Developer Week 2013
Essential Node.js for Web Developers from Developer Week 2013Essential Node.js for Web Developers from Developer Week 2013
Essential Node.js for Web Developers from Developer Week 2013
 
9 anti-patterns for node.js teams
9 anti-patterns for node.js teams9 anti-patterns for node.js teams
9 anti-patterns for node.js teams
 

Viewers also liked

MongoDB, Node.js, and You: PART III
MongoDB, Node.js, and You: PART IIIMongoDB, Node.js, and You: PART III
MongoDB, Node.js, and You: PART III
Mitch Pirtle
 
MongoDB, Development and You
MongoDB, Development and YouMongoDB, Development and You
MongoDB, Development and You
Mitch Pirtle
 
Cloud conference - mongodb
Cloud conference - mongodbCloud conference - mongodb
Cloud conference - mongodb
Mitch Pirtle
 
MongoDB, Node.js And You: PART II
MongoDB, Node.js And You: PART IIMongoDB, Node.js And You: PART II
MongoDB, Node.js And You: PART II
Mitch Pirtle
 
Cloudy with a chance of scale
Cloudy with a chance of scaleCloudy with a chance of scale
Cloudy with a chance of scale
Mitch Pirtle
 
Data as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDBData as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDB
Mitch Pirtle
 

Viewers also liked (6)

MongoDB, Node.js, and You: PART III
MongoDB, Node.js, and You: PART IIIMongoDB, Node.js, and You: PART III
MongoDB, Node.js, and You: PART III
 
MongoDB, Development and You
MongoDB, Development and YouMongoDB, Development and You
MongoDB, Development and You
 
Cloud conference - mongodb
Cloud conference - mongodbCloud conference - mongodb
Cloud conference - mongodb
 
MongoDB, Node.js And You: PART II
MongoDB, Node.js And You: PART IIMongoDB, Node.js And You: PART II
MongoDB, Node.js And You: PART II
 
Cloudy with a chance of scale
Cloudy with a chance of scaleCloudy with a chance of scale
Cloudy with a chance of scale
 
Data as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDBData as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDB
 

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

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

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

Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)
 
My life with MongoDB
My life with MongoDBMy life with MongoDB
My life with MongoDB
 
Linked Data: The Real Web 2.0 (from 2008)
Linked Data: The Real Web 2.0 (from 2008)Linked Data: The Real Web 2.0 (from 2008)
Linked Data: The Real Web 2.0 (from 2008)
 
The world is not black and white – Impact of decisions over the lifetime of a...
The world is not black and white – Impact of decisions over the lifetime of a...The world is not black and white – Impact of decisions over the lifetime of a...
The world is not black and white – Impact of decisions over the lifetime of a...
 
Fi fo euc 2014
Fi fo euc 2014Fi fo euc 2014
Fi fo euc 2014
 
Yet Another Dan Kaminsky Talk (Black Ops 2014)
Yet Another Dan Kaminsky Talk (Black Ops 2014)Yet Another Dan Kaminsky Talk (Black Ops 2014)
Yet Another Dan Kaminsky Talk (Black Ops 2014)
 
Building Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBBuilding Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDB
 
Software + Babies
Software + BabiesSoftware + Babies
Software + Babies
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu...
Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu...Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu...
Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu...
 
Is MongoDB Right For Your Project (or Organization)
Is MongoDB Right For Your Project (or Organization)Is MongoDB Right For Your Project (or Organization)
Is MongoDB Right For Your Project (or Organization)
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
 
Java in High Frequency Trading
Java in High Frequency TradingJava in High Frequency Trading
Java in High Frequency Trading
 
Scratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry PieScratching the itch, making Scratch for the Raspberry Pie
Scratching the itch, making Scratch for the Raspberry Pie
 
Silicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in productionSilicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in production
 
Introducing TensorFlow: The game changer in building "intelligent" applications
Introducing TensorFlow: The game changer in building "intelligent" applicationsIntroducing TensorFlow: The game changer in building "intelligent" applications
Introducing TensorFlow: The game changer in building "intelligent" applications
 
Rapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebRapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The Web
 
Freifunk Munich - How to scale Jitsi
Freifunk Munich - How to scale JitsiFreifunk Munich - How to scale Jitsi
Freifunk Munich - How to scale Jitsi
 
Meteor: Real-time Web Made Easy
Meteor: Real-time Web Made EasyMeteor: Real-time Web Made Easy
Meteor: Real-time Web Made Easy
 

More from Mitch Pirtle

MongoTorino 2013 Opening Keynote
MongoTorino 2013 Opening KeynoteMongoTorino 2013 Opening Keynote
MongoTorino 2013 Opening Keynote
Mitch Pirtle
 
Unified Content Model and Joomla!
Unified Content Model and Joomla!Unified Content Model and Joomla!
Unified Content Model and Joomla!
Mitch Pirtle
 
Gridfs and MongoDB
Gridfs and MongoDBGridfs and MongoDB
Gridfs and MongoDB
Mitch Pirtle
 
Joomla - an Overview
Joomla - an OverviewJoomla - an Overview
Joomla - an Overview
Mitch Pirtle
 
Operational MongoDB
Operational MongoDBOperational MongoDB
Operational MongoDB
Mitch Pirtle
 
Joomla Extreme Performance
Joomla Extreme PerformanceJoomla Extreme Performance
Joomla Extreme Performance
Mitch Pirtle
 
Joomla and MongoDB
Joomla and MongoDBJoomla and MongoDB
Joomla and MongoDB
Mitch Pirtle
 
Mongodb and Totsy: An e-commerce case study
Mongodb and Totsy: An e-commerce case studyMongodb and Totsy: An e-commerce case study
Mongodb and Totsy: An e-commerce case study
Mitch Pirtle
 
Mongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case StudyMongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case Study
Mitch Pirtle
 
PHP, Lithium and MongoDB
PHP, Lithium and MongoDBPHP, Lithium and MongoDB
PHP, Lithium and MongoDB
Mitch Pirtle
 
Content Management Systems and MongoDB
Content Management Systems and MongoDBContent Management Systems and MongoDB
Content Management Systems and MongoDB
Mitch Pirtle
 
MongoDB: Built for Speed
MongoDB: Built for SpeedMongoDB: Built for Speed
MongoDB: Built for Speed
Mitch Pirtle
 
Content Mangement Systems and MongoDB
Content Mangement Systems and MongoDBContent Mangement Systems and MongoDB
Content Mangement Systems and MongoDB
Mitch Pirtle
 
Joomla For Entrepreneurs
Joomla For EntrepreneursJoomla For Entrepreneurs
Joomla For Entrepreneurs
Mitch Pirtle
 
Thin Server Architecture
Thin Server ArchitectureThin Server Architecture
Thin Server Architecture
Mitch Pirtle
 
Developing Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, ExplainedDeveloping Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, Explained
Mitch Pirtle
 
Kickapps Social Media
Kickapps Social MediaKickapps Social Media
Kickapps Social Media
Mitch Pirtle
 

More from Mitch Pirtle (17)

MongoTorino 2013 Opening Keynote
MongoTorino 2013 Opening KeynoteMongoTorino 2013 Opening Keynote
MongoTorino 2013 Opening Keynote
 
Unified Content Model and Joomla!
Unified Content Model and Joomla!Unified Content Model and Joomla!
Unified Content Model and Joomla!
 
Gridfs and MongoDB
Gridfs and MongoDBGridfs and MongoDB
Gridfs and MongoDB
 
Joomla - an Overview
Joomla - an OverviewJoomla - an Overview
Joomla - an Overview
 
Operational MongoDB
Operational MongoDBOperational MongoDB
Operational MongoDB
 
Joomla Extreme Performance
Joomla Extreme PerformanceJoomla Extreme Performance
Joomla Extreme Performance
 
Joomla and MongoDB
Joomla and MongoDBJoomla and MongoDB
Joomla and MongoDB
 
Mongodb and Totsy: An e-commerce case study
Mongodb and Totsy: An e-commerce case studyMongodb and Totsy: An e-commerce case study
Mongodb and Totsy: An e-commerce case study
 
Mongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case StudyMongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case Study
 
PHP, Lithium and MongoDB
PHP, Lithium and MongoDBPHP, Lithium and MongoDB
PHP, Lithium and MongoDB
 
Content Management Systems and MongoDB
Content Management Systems and MongoDBContent Management Systems and MongoDB
Content Management Systems and MongoDB
 
MongoDB: Built for Speed
MongoDB: Built for SpeedMongoDB: Built for Speed
MongoDB: Built for Speed
 
Content Mangement Systems and MongoDB
Content Mangement Systems and MongoDBContent Mangement Systems and MongoDB
Content Mangement Systems and MongoDB
 
Joomla For Entrepreneurs
Joomla For EntrepreneursJoomla For Entrepreneurs
Joomla For Entrepreneurs
 
Thin Server Architecture
Thin Server ArchitectureThin Server Architecture
Thin Server Architecture
 
Developing Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, ExplainedDeveloping Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, Explained
 
Kickapps Social Media
Kickapps Social MediaKickapps Social Media
Kickapps Social Media
 

Recently uploaded

(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
Priyanka Aash
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
BrainSell Technologies
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
The Role of Technology in Payroll Statutory Compliance (1).pdf
The Role of Technology in Payroll Statutory Compliance (1).pdfThe Role of Technology in Payroll Statutory Compliance (1).pdf
The Role of Technology in Payroll Statutory Compliance (1).pdf
paysquare consultancy
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
The Evolution of Remote Server Management
The Evolution of Remote Server ManagementThe Evolution of Remote Server Management
The Evolution of Remote Server Management
Bert Blevins
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Kunal Gupta
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
SynapseIndia
 
Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024
aakash malhotra
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
Edge AI and Vision Alliance
 

Recently uploaded (20)

(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
The Role of Technology in Payroll Statutory Compliance (1).pdf
The Role of Technology in Payroll Statutory Compliance (1).pdfThe Role of Technology in Payroll Statutory Compliance (1).pdf
The Role of Technology in Payroll Statutory Compliance (1).pdf
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
The Evolution of Remote Server Management
The Evolution of Remote Server ManagementThe Evolution of Remote Server Management
The Evolution of Remote Server Management
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
 
Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024Three New Criminal Laws in India 1 July 2024
Three New Criminal Laws in India 1 July 2024
 
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
 

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!