Mongodb, Node.js and You: PART I

Mitch Pirtle
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!
1 of 45

Recommended

PHP Cloud Deployment Toolkits by
PHP Cloud Deployment ToolkitsPHP Cloud Deployment Toolkits
PHP Cloud Deployment ToolkitsMitch Pirtle
1.9K views52 slides
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit... by
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Calvin Tan
2.9K views56 slides
When Will Drupal Die? (Keynote talk) by
When Will Drupal Die? (Keynote talk)When Will Drupal Die? (Keynote talk)
When Will Drupal Die? (Keynote talk)chrisshattuck
1.7K views39 slides
Designing a Docker Stack for Symfony apps: lessons learned by
Designing a Docker Stack  for Symfony apps: lessons learnedDesigning a Docker Stack  for Symfony apps: lessons learned
Designing a Docker Stack for Symfony apps: lessons learnedGaetano Giunta
573 views15 slides
All out on the Cloud - PloneConf 2012 by
All out on the Cloud - PloneConf 2012All out on the Cloud - PloneConf 2012
All out on the Cloud - PloneConf 2012Jan Jongboom
846 views51 slides
Node.js Getting Started &amd Best Practices by
Node.js Getting Started &amd Best PracticesNode.js Getting Started &amd Best Practices
Node.js Getting Started &amd Best Practicesbotsplash.com
367 views17 slides

More Related Content

What's hot

Getting started with HTML & CSS by
Getting started with HTML & CSSGetting started with HTML & CSS
Getting started with HTML & CSSBen Eveloff
872 views14 slides
Introduction to NodeJS by
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJSZahid Mahir
832 views12 slides
My month with Ruby by
My month with RubyMy month with Ruby
My month with Rubyalextomovski
375 views30 slides
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js by
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.jsMongoDB
78.7K views29 slides
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem by
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 EcosystemFITC
673 views29 slides
What I Learned at Open Hack Naperville by
What I Learned at Open Hack NapervilleWhat I Learned at Open Hack Naperville
What I Learned at Open Hack NapervilleKevin Davis
660 views15 slides

What's hot(20)

Getting started with HTML & CSS by Ben Eveloff
Getting started with HTML & CSSGetting started with HTML & CSS
Getting started with HTML & CSS
Ben Eveloff872 views
Introduction to NodeJS by Zahid Mahir
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
Zahid Mahir832 views
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js by MongoDB
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
MongoDB78.7K views
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem by FITC
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
FITC673 views
What I Learned at Open Hack Naperville by Kevin Davis
What I Learned at Open Hack NapervilleWhat I Learned at Open Hack Naperville
What I Learned at Open Hack Naperville
Kevin Davis660 views
Ruby is dying. What languages are cool now? by Michał Konarski
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ł Konarski2.9K views
Hybrid concurrency patterns by Kyle Drake
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
Kyle Drake15.2K views
PHP Indonesia - Nodejs Web Development by Irfan Maulana
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
Irfan Maulana1.8K views
Introduction to Node.js by Edy Segura
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Edy Segura773 views
npm + browserify by maxgfeller
npm + browserifynpm + browserify
npm + browserify
maxgfeller6.1K views
HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Pl... by Les-Tilleuls.coop
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.coop35.7K views
Building Real-Time Applications in Ember.js by Steve Kinney
Building Real-Time Applications in Ember.jsBuilding Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.js
Steve Kinney3.1K views
Horizontally Scaling Node.js and WebSockets by James Simpson
Horizontally Scaling Node.js and WebSocketsHorizontally Scaling Node.js and WebSockets
Horizontally Scaling Node.js and WebSockets
James Simpson1.5K views
Work smart with Gutenberg - Fellyph Cintra by Fellyph Cintra
Work smart with Gutenberg - Fellyph CintraWork smart with Gutenberg - Fellyph Cintra
Work smart with Gutenberg - Fellyph Cintra
Fellyph Cintra3.3K views
Essential Node.js for Web Developers from Developer Week 2013 by CA API Management
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 Management1.1K views
9 anti-patterns for node.js teams by Jeff Harrell
9 anti-patterns for node.js teams9 anti-patterns for node.js teams
9 anti-patterns for node.js teams
Jeff Harrell50.4K views

Viewers also liked

MongoDB, Node.js, and You: PART III by
MongoDB, Node.js, and You: PART IIIMongoDB, Node.js, and You: PART III
MongoDB, Node.js, and You: PART IIIMitch Pirtle
1.2K views22 slides
MongoDB, Development and You by
MongoDB, Development and YouMongoDB, Development and You
MongoDB, Development and YouMitch Pirtle
2.4K views53 slides
Cloud conference - mongodb by
Cloud conference - mongodbCloud conference - mongodb
Cloud conference - mongodbMitch Pirtle
1.6K views101 slides
MongoDB, Node.js And You: PART II by
MongoDB, Node.js And You: PART IIMongoDB, Node.js And You: PART II
MongoDB, Node.js And You: PART IIMitch Pirtle
1.1K views29 slides
Cloudy with a chance of scale by
Cloudy with a chance of scaleCloudy with a chance of scale
Cloudy with a chance of scaleMitch Pirtle
366 views24 slides
Data as Documents: Overview and intro to MongoDB by
Data as Documents: Overview and intro to MongoDBData as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDBMitch Pirtle
2.8K views65 slides

Viewers also liked(6)

MongoDB, Node.js, and You: PART III by Mitch Pirtle
MongoDB, Node.js, and You: PART IIIMongoDB, Node.js, and You: PART III
MongoDB, Node.js, and You: PART III
Mitch Pirtle1.2K views
MongoDB, Development and You by Mitch Pirtle
MongoDB, Development and YouMongoDB, Development and You
MongoDB, Development and You
Mitch Pirtle2.4K views
Cloud conference - mongodb by Mitch Pirtle
Cloud conference - mongodbCloud conference - mongodb
Cloud conference - mongodb
Mitch Pirtle1.6K views
MongoDB, Node.js And You: PART II by Mitch Pirtle
MongoDB, Node.js And You: PART IIMongoDB, Node.js And You: PART II
MongoDB, Node.js And You: PART II
Mitch Pirtle1.1K views
Cloudy with a chance of scale by Mitch Pirtle
Cloudy with a chance of scaleCloudy with a chance of scale
Cloudy with a chance of scale
Mitch Pirtle366 views
Data as Documents: Overview and intro to MongoDB by Mitch Pirtle
Data as Documents: Overview and intro to MongoDBData as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDB
Mitch Pirtle2.8K views

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

Joyent circa 2006 (Scale with Rails) by
Joyent circa 2006 (Scale with Rails)Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)bcantrill
4.1K views75 slides
My life with MongoDB by
My life with MongoDBMy life with MongoDB
My life with MongoDBMitch Pirtle
983 views59 slides
Linked Data: The Real Web 2.0 (from 2008) by
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
789 views57 slides
The world is not black and white – Impact of decisions over the lifetime of a... by
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
974 views40 slides
Fi fo euc 2014 by
Fi fo euc 2014Fi fo euc 2014
Fi fo euc 2014Licenser
1.3K views30 slides
Yet Another Dan Kaminsky Talk (Black Ops 2014) by
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
12.7K views80 slides

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

Joyent circa 2006 (Scale with Rails) by bcantrill
Joyent circa 2006 (Scale with Rails)Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)
bcantrill4.1K views
My life with MongoDB by Mitch Pirtle
My life with MongoDBMy life with MongoDB
My life with MongoDB
Mitch Pirtle983 views
Linked Data: The Real Web 2.0 (from 2008) by Uche Ogbuji
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 Ogbuji789 views
The world is not black and white – Impact of decisions over the lifetime of a... by Eric Reiche
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 Reiche974 views
Fi fo euc 2014 by Licenser
Fi fo euc 2014Fi fo euc 2014
Fi fo euc 2014
Licenser1.3K views
Yet Another Dan Kaminsky Talk (Black Ops 2014) by Dan Kaminsky
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 Kaminsky12.7K views
Building Social IRC Bots with Node.js and MongoDB by 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
MongoDB2.5K views
Load testing, Lessons learnt and Loadzen - Martin Buhr at DevTank - 31st Janu... by Loadzen
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...
Loadzen1.1K views
Is MongoDB Right For Your Project (or Organization) by Tony Bibbs
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 Bibbs1.1K views
Big Data! Great! Now What? #SymfonyCon 2014 by Ricard Clau
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau23.4K views
Tech Thursdays: Building Products by Hayden Bleasel
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
Hayden Bleasel733 views
Java in High Frequency Trading by Viktor Sovietov
Java in High Frequency TradingJava in High Frequency Trading
Java in High Frequency Trading
Viktor Sovietov2.1K views
Scratching the itch, making Scratch for the Raspberry Pie by ESUG
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
ESUG856 views
Silicon Valley Code Camp 2016 - MongoDB in production by Daniel Coupal
Silicon Valley Code Camp 2016 - MongoDB in productionSilicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in production
Daniel Coupal544 views
Introducing TensorFlow: The game changer in building "intelligent" applications by Rokesh Jankie
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 Jankie1.7K views
Rapid Evolution of Web Dev? aka Talking About The Web by PINT Inc
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 Inc1.1K views
Freifunk Munich - How to scale Jitsi by Annika Wickert
Freifunk Munich - How to scale JitsiFreifunk Munich - How to scale Jitsi
Freifunk Munich - How to scale Jitsi
Annika Wickert4.6K views
Meteor: Real-time Web Made Easy by rwillmer
Meteor: Real-time Web Made EasyMeteor: Real-time Web Made Easy
Meteor: Real-time Web Made Easy
rwillmer343 views

More from Mitch Pirtle

MongoTorino 2013 Opening Keynote by
MongoTorino 2013 Opening KeynoteMongoTorino 2013 Opening Keynote
MongoTorino 2013 Opening KeynoteMitch Pirtle
1.5K views27 slides
Unified Content Model and Joomla! by
Unified Content Model and Joomla!Unified Content Model and Joomla!
Unified Content Model and Joomla!Mitch Pirtle
3.7K views44 slides
Gridfs and MongoDB by
Gridfs and MongoDBGridfs and MongoDB
Gridfs and MongoDBMitch Pirtle
10K views62 slides
Joomla - an Overview by
Joomla - an OverviewJoomla - an Overview
Joomla - an OverviewMitch Pirtle
812 views105 slides
Operational MongoDB by
Operational MongoDBOperational MongoDB
Operational MongoDBMitch Pirtle
2.4K views54 slides
Joomla Extreme Performance by
Joomla Extreme PerformanceJoomla Extreme Performance
Joomla Extreme PerformanceMitch Pirtle
1.5K views64 slides

More from Mitch Pirtle(17)

MongoTorino 2013 Opening Keynote by Mitch Pirtle
MongoTorino 2013 Opening KeynoteMongoTorino 2013 Opening Keynote
MongoTorino 2013 Opening Keynote
Mitch Pirtle1.5K views
Unified Content Model and Joomla! by Mitch Pirtle
Unified Content Model and Joomla!Unified Content Model and Joomla!
Unified Content Model and Joomla!
Mitch Pirtle3.7K views
Joomla - an Overview by Mitch Pirtle
Joomla - an OverviewJoomla - an Overview
Joomla - an Overview
Mitch Pirtle812 views
Operational MongoDB by Mitch Pirtle
Operational MongoDBOperational MongoDB
Operational MongoDB
Mitch Pirtle2.4K views
Joomla Extreme Performance by Mitch Pirtle
Joomla Extreme PerformanceJoomla Extreme Performance
Joomla Extreme Performance
Mitch Pirtle1.5K views
Joomla and MongoDB by Mitch Pirtle
Joomla and MongoDBJoomla and MongoDB
Joomla and MongoDB
Mitch Pirtle8.7K views
Mongodb and Totsy: An e-commerce case study by Mitch Pirtle
Mongodb and Totsy: An e-commerce case studyMongodb and Totsy: An e-commerce case study
Mongodb and Totsy: An e-commerce case study
Mitch Pirtle4.4K views
Mongodb and Totsy - E-commerce Case Study by Mitch Pirtle
Mongodb and Totsy - E-commerce Case StudyMongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case Study
Mitch Pirtle1.6K views
PHP, Lithium and MongoDB by Mitch Pirtle
PHP, Lithium and MongoDBPHP, Lithium and MongoDB
PHP, Lithium and MongoDB
Mitch Pirtle4.7K views
Content Management Systems and MongoDB by Mitch Pirtle
Content Management Systems and MongoDBContent Management Systems and MongoDB
Content Management Systems and MongoDB
Mitch Pirtle5.1K views
MongoDB: Built for Speed by Mitch Pirtle
MongoDB: Built for SpeedMongoDB: Built for Speed
MongoDB: Built for Speed
Mitch Pirtle3.2K views
Content Mangement Systems and MongoDB by Mitch Pirtle
Content Mangement Systems and MongoDBContent Mangement Systems and MongoDB
Content Mangement Systems and MongoDB
Mitch Pirtle3.9K views
Joomla For Entrepreneurs by Mitch Pirtle
Joomla For EntrepreneursJoomla For Entrepreneurs
Joomla For Entrepreneurs
Mitch Pirtle1.1K views
Thin Server Architecture by Mitch Pirtle
Thin Server ArchitectureThin Server Architecture
Thin Server Architecture
Mitch Pirtle6.5K views
Developing Joomla! 1.5 Extensions, Explained by Mitch Pirtle
Developing Joomla! 1.5 Extensions, ExplainedDeveloping Joomla! 1.5 Extensions, Explained
Developing Joomla! 1.5 Extensions, Explained
Mitch Pirtle1.8K views
Kickapps Social Media by Mitch Pirtle
Kickapps Social MediaKickapps Social Media
Kickapps Social Media
Mitch Pirtle919 views

Recently uploaded

Understanding GenAI/LLM and What is Google Offering - Felix Goh by
Understanding GenAI/LLM and What is Google Offering - Felix GohUnderstanding GenAI/LLM and What is Google Offering - Felix Goh
Understanding GenAI/LLM and What is Google Offering - Felix GohNUS-ISS
39 views33 slides
Microchip: CXL Use Cases and Enabling Ecosystem by
Microchip: CXL Use Cases and Enabling EcosystemMicrochip: CXL Use Cases and Enabling Ecosystem
Microchip: CXL Use Cases and Enabling EcosystemCXL Forum
129 views12 slides
AMD: 4th Generation EPYC CXL Demo by
AMD: 4th Generation EPYC CXL DemoAMD: 4th Generation EPYC CXL Demo
AMD: 4th Generation EPYC CXL DemoCXL Forum
126 views6 slides
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV by
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTVSplunk
86 views20 slides
[2023] Putting the R! in R&D.pdf by
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdfEleanor McHugh
38 views127 slides

Recently uploaded(20)

Understanding GenAI/LLM and What is Google Offering - Felix Goh by NUS-ISS
Understanding GenAI/LLM and What is Google Offering - Felix GohUnderstanding GenAI/LLM and What is Google Offering - Felix Goh
Understanding GenAI/LLM and What is Google Offering - Felix Goh
NUS-ISS39 views
Microchip: CXL Use Cases and Enabling Ecosystem by CXL Forum
Microchip: CXL Use Cases and Enabling EcosystemMicrochip: CXL Use Cases and Enabling Ecosystem
Microchip: CXL Use Cases and Enabling Ecosystem
CXL Forum129 views
AMD: 4th Generation EPYC CXL Demo by CXL Forum
AMD: 4th Generation EPYC CXL DemoAMD: 4th Generation EPYC CXL Demo
AMD: 4th Generation EPYC CXL Demo
CXL Forum126 views
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV by Splunk
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
Splunk86 views
[2023] Putting the R! in R&D.pdf by Eleanor McHugh
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh38 views
Future of Learning - Yap Aye Wee.pdf by NUS-ISS
Future of Learning - Yap Aye Wee.pdfFuture of Learning - Yap Aye Wee.pdf
Future of Learning - Yap Aye Wee.pdf
NUS-ISS38 views
MemVerge: Gismo (Global IO-free Shared Memory Objects) by CXL Forum
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)
CXL Forum112 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang35 views
Liqid: Composable CXL Preview by CXL Forum
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum121 views
TE Connectivity: Card Edge Interconnects by CXL Forum
TE Connectivity: Card Edge InterconnectsTE Connectivity: Card Edge Interconnects
TE Connectivity: Card Edge Interconnects
CXL Forum96 views
Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum... by NUS-ISS
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
Beyond the Hype: What Generative AI Means for the Future of Work - Damien Cum...
NUS-ISS28 views
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu... by NUS-ISS
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
NUS-ISS32 views
"Fast Start to Building on AWS", Igor Ivaniuk by Fwdays
"Fast Start to Building on AWS", Igor Ivaniuk"Fast Start to Building on AWS", Igor Ivaniuk
"Fast Start to Building on AWS", Igor Ivaniuk
Fwdays36 views
.conf Go 2023 - Data analysis as a routine by Splunk
.conf Go 2023 - Data analysis as a routine.conf Go 2023 - Data analysis as a routine
.conf Go 2023 - Data analysis as a routine
Splunk90 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin70 views
Future of Learning - Khoong Chan Meng by NUS-ISS
Future of Learning - Khoong Chan MengFuture of Learning - Khoong Chan Meng
Future of Learning - Khoong Chan Meng
NUS-ISS31 views
Photowave Presentation Slides - 11.8.23.pptx by CXL Forum
Photowave Presentation Slides - 11.8.23.pptxPhotowave Presentation Slides - 11.8.23.pptx
Photowave Presentation Slides - 11.8.23.pptx
CXL Forum126 views

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!