SlideShare una empresa de Scribd logo
1 de 59
Descargar para leer sin conexión
My Life With
MongoDB
Mitch Pirtle, Miami MongoDB User Group
February 2015
Before we get started.
Your MongoDB Fu?
Happy to show you how WiredTiger can be optimized
I got multiple apps in production with it
Currently using it in active development/projects
Hey I downloaded it at least, might even install it
Got donuts?
All righty then!
Now a little about me.
Recovering Joomla! founder
Starting companies since 1995
Big on PHP, Node, Go, cloud tools, virtualization, containers
Big on developer workflow
Coach youth sports
Proud husband, dad
Don’t even THINK about touching my BBQ
Hey Ed, how much time do I got?
In the beginning…
We needed to store data
Data needed to be kept clean
Disk space was at a premium
Same for CPU and RAM
Efficiency was the most important factor
Life was good.
- Al Gore, supposedly
“Hey boys, check it out, the
Internets!”
Number of concurrent users grew
Amount of data grew
Programming languages proliferated
Applications accessing our data proliferated
We all switched to Oracle or DB2
Hey what was that sound?
Arrival of the World Wide Web
Concurrent users jumped from 2 to 2,000,000
1,200 daily accesses turned into 20MM daily views
Throughput became the only critical element for your
apps, and therefore your data
That smoking crater in the datacenter? Yeah, that was
your DATABASE SERVER.
Something else was
happening, too.
Programming languages
Perl, Python, Ruby, Java, PHP, and more
All used objects to represent structures
All were connected to relational databases
Which required…
The Object Relational Mapper (ORM)
Models represented “things”
Each model could be linked to other models
Has many, belongs to, is a member of…
It’s ok, we got this.
Fixes for rapid data growth
Stored procedures
Foreign keys
Triggers
Here comes the World Wide Web!
No, really, we got this.
Fixes for super mega whack-
daddy growth
Sharding
Clustering
Multi-master
Read-only slaves
Replication
Flux Capacitors
Dilithium Crystals
Ok, we don’t got this.
Enter…
–Johnny Developer
“But it’s not ACID compliant!
ZOMGWTFROFLBBQ!!1!”
“Somebody wanted acid?”
– Some Sucker On The Internet
“But somebody on YouTube said it
would lose my data!”
You’re not losing me. I’m a fan favorite.
Main MongoDB goodness
Stores data as JSON documents
Sharding is built in
Clustering is built in
Slaves/replication is built in
Atomic writes, supports verified commits to disk
No JOINs
But how am I going to manage these queries that
reach across umpteen different collections?
Denormalizing your data
Simple top-level schema
Logically driven
Atomic data
Your relational data looked like this.
Your document model looks like this.
Once again, with
feeling.
Relational data.
Document data.
Relational data.
Document data.
Enough already!
User table, relational style
first_name: varchar(128)
last_name: varchar(128)
email: varchar(128)
password: varchar(128)
Seems simple enough.
Right?
Not done yet.
address_id: int (refers to address.id)
gender_id: int (refers to gender.id)
account_type_id: int (refers to account types)
See? I got this all figured out.
I have two addresses.
create_user(user)
Ok first insert the users table
create_user(user)
Ok first insert the users table
No wait, first insert the address and get address.id
create_user(user)
Ok first insert the users table
No wait, first insert the address and get address.id
No, insert users record first, then the address, then
update the users.address_id with the last_insert_id
EXAMPLE: User document
{

_id: “35b3d656-4e4b-41c0-85ab-23a9867a3e00”,

first_name: “Mitch”,

last_name: “Pirtle”,

addresses: [

address_1: “123 Tondup Glacier”,

address_2: “Second Yurt On The Left”,

region: “Lhasa”,

country: “Tibet”

]

}
Yep, that’s all JSON.
Stumbling into MongoDB
Leave your 3NF data model behind
Atomicity is at the DOCUMENT LEVEL
There are different ways of doing things (e.g.
findAndReplace)
“Scuse me while I whip this out.”
[CONSOLE]
Questions?
Thanks!
@mitchitized
http://about.me/mitchitized
http://www.slideshare.net/spacemonkeylabs
https://www.github.com/spacemonkey

Más contenido relacionado

La actualidad más candente

MongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB and the MEAN Stack
MongoDB and the MEAN Stack
MongoDB
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
Deepu S Nath
 
Building with JavaScript - write less by using the right tools
Building with JavaScript -  write less by using the right toolsBuilding with JavaScript -  write less by using the right tools
Building with JavaScript - write less by using the right tools
Christian Heilmann
 

La actualidad más candente (19)

Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 
MongoDB and the MEAN Stack
MongoDB and the MEAN StackMongoDB and the MEAN Stack
MongoDB and the MEAN Stack
 
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
 
Untangling spring week9
Untangling spring week9Untangling spring week9
Untangling spring week9
 
Node js - Enterprise Class
Node js - Enterprise ClassNode js - Enterprise Class
Node js - Enterprise Class
 
Introduction to the MEAN stack
Introduction to the MEAN stackIntroduction to the MEAN stack
Introduction to the MEAN stack
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Migrating Edmunds.com to AWS (re:Invent 2013 DMG205)
Migrating Edmunds.com to AWS (re:Invent 2013 DMG205)Migrating Edmunds.com to AWS (re:Invent 2013 DMG205)
Migrating Edmunds.com to AWS (re:Invent 2013 DMG205)
 
[Blibli Brown Bag] Nodejs - The Other Side of Javascript
[Blibli Brown Bag] Nodejs - The Other Side of Javascript[Blibli Brown Bag] Nodejs - The Other Side of Javascript
[Blibli Brown Bag] Nodejs - The Other Side of Javascript
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 
Real World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScriptReal World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScript
 
BCS Open Source Talk
BCS Open Source TalkBCS Open Source Talk
BCS Open Source Talk
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Build the mobile web you want
Build the mobile web you wantBuild the mobile web you want
Build the mobile web you want
 
GDI WordPress 1 January 2012
GDI WordPress 1 January 2012GDI WordPress 1 January 2012
GDI WordPress 1 January 2012
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
Building with JavaScript - write less by using the right tools
Building with JavaScript -  write less by using the right toolsBuilding with JavaScript -  write less by using the right tools
Building with JavaScript - write less by using the right tools
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 

Similar a My life with MongoDB

MongoDC - Ikanow April 2012 Meetup
MongoDC - Ikanow April 2012 MeetupMongoDC - Ikanow April 2012 Meetup
MongoDC - Ikanow April 2012 Meetup
ikanow
 
RedMonk Analytics: Why, How and What
RedMonk Analytics: Why, How and WhatRedMonk Analytics: Why, How and What
RedMonk Analytics: Why, How and What
sogrady
 

Similar a My life with MongoDB (20)

Big Data made easy in the era of the Cloud - Demi Ben-Ari
Big Data made easy in the era of the Cloud - Demi Ben-AriBig Data made easy in the era of the Cloud - Demi Ben-Ari
Big Data made easy in the era of the Cloud - Demi Ben-Ari
 
Lessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistLessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at Craigslist
 
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)
 
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
 
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDBBreaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
 
Orchard Harvest Keynote 2015 - the CMS of the future
Orchard Harvest Keynote 2015 - the CMS of the futureOrchard Harvest Keynote 2015 - the CMS of the future
Orchard Harvest Keynote 2015 - the CMS of the future
 
MyLifeBits van Microsoft
MyLifeBits van MicrosoftMyLifeBits van Microsoft
MyLifeBits van Microsoft
 
Finding harmony in web development
Finding harmony in web developmentFinding harmony in web development
Finding harmony in web development
 
Evolution of applications - from Enterprise to Cloud
Evolution of applications - from Enterprise to CloudEvolution of applications - from Enterprise to Cloud
Evolution of applications - from Enterprise to Cloud
 
Hofstra University - Overview of Big Data
Hofstra University - Overview of Big DataHofstra University - Overview of Big Data
Hofstra University - Overview of Big Data
 
Wassup with Web 2.0
Wassup with Web 2.0Wassup with Web 2.0
Wassup with Web 2.0
 
Performance Tuning Web Apps - The Need For Speed
Performance Tuning Web Apps - The Need For SpeedPerformance Tuning Web Apps - The Need For Speed
Performance Tuning Web Apps - The Need For Speed
 
HTML5 - Moving from hacks to solutions
HTML5 - Moving from hacks to solutionsHTML5 - Moving from hacks to solutions
HTML5 - Moving from hacks to solutions
 
MongoDC - Ikanow April 2012 Meetup
MongoDC - Ikanow April 2012 MeetupMongoDC - Ikanow April 2012 Meetup
MongoDC - Ikanow April 2012 Meetup
 
RedMonk Analytics: Why, How and What
RedMonk Analytics: Why, How and WhatRedMonk Analytics: Why, How and What
RedMonk Analytics: Why, How and What
 
Thin Server Architecture
Thin Server ArchitectureThin Server Architecture
Thin Server Architecture
 
Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011
 
Software that eats the world! - PerformDay Brussels
Software that eats the world! - PerformDay BrusselsSoftware that eats the world! - PerformDay Brussels
Software that eats the world! - PerformDay Brussels
 
Measure All the Things! - Austin Data Day 2014
Measure All the Things! - Austin Data Day 2014Measure All the Things! - Austin Data Day 2014
Measure All the Things! - Austin Data Day 2014
 
No More SQL
No More SQLNo More SQL
No More SQL
 

Más de Mitch Pirtle

Más de Mitch Pirtle (19)

Cloudy with a chance of scale
Cloudy with a chance of scaleCloudy with a chance of scale
Cloudy with a chance of scale
 
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, 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
 
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
 
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
 
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
 
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
 

Último

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
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
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 Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

My life with MongoDB