SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
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!

Contenu connexe

Tendances

Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
Zahid Mahir
 
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
 

Tendances (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
 

En vedette

En vedette (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
 

Similaire à Mongodb, Node.js and You: PART I

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
 

Similaire à 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
 

Plus de Mitch Pirtle

Plus de 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
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

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!