SlideShare uma empresa Scribd logo
1 de 26
Mongoid Ate My
Homework
10 quick gotchas from using mongoid in production.
- Jude
I’m @slowjud on everything
(twitter/github)
I work at SplitIt.
We run www.betterbills.com
We run www.betterbills.com
We run www.betterbills.com
We run www.betterbills.com
Gratuitous bike porn
Now for my talk
MongoDB is not
relational
MongoDB only uses
one index per query
Nil does not unset a
field
Nil is not the opposite
of exist
BigDecimal type sorts
alphabetically
Embedded objects must
have an embedded_in
declared
Indexes don’t get created
on embedded objects
Scopes should go on
the parent object
Callbacks on embedded
objects are not run by
default
Don’t try and perform two
atomic operations on the
same field in the same call
Questions?
Gists
Slides: http://www.slideshare.net/slowjud/mongoid-ate-my-homework
The good models: https://gist.github.com/slowjud/9476959
The bad models: https://gist.github.com/slowjud/9476981
All of the queries: https://gist.github.com/slowjud/9477341
Thank You

Mais conteúdo relacionado

Destaque

De vijf punten voor een gesprek
De vijf punten voor een gesprekDe vijf punten voor een gesprek
De vijf punten voor een gesprekJos Begeman
 
หนังสืออ้างอิง
หนังสืออ้างอิงหนังสืออ้างอิง
หนังสืออ้างอิงSupaporn Khiewwan
 
SMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning ApproachSMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning ApproachReza Rahimi
 
Bloomberg Briefs - Asean's Frontier Economies
Bloomberg Briefs - Asean's Frontier EconomiesBloomberg Briefs - Asean's Frontier Economies
Bloomberg Briefs - Asean's Frontier EconomiesKrishna Ramachandra
 
INSPIRE Annual Report 2015 - 2016
INSPIRE Annual Report 2015 - 2016INSPIRE Annual Report 2015 - 2016
INSPIRE Annual Report 2015 - 2016INSPIRE_Network
 
Unleash Your Play Brain
Unleash Your Play BrainUnleash Your Play Brain
Unleash Your Play BrainPortia Tung
 
Nov 2016 - Toronto real estate market in 8 Charts
Nov 2016 - Toronto real estate market in 8 ChartsNov 2016 - Toronto real estate market in 8 Charts
Nov 2016 - Toronto real estate market in 8 ChartsScott Ingram, CPA, CA, MBA
 
Cyber Ranges: The (R)evolution in Cybersecurity Training
Cyber Ranges: The (R)evolution in Cybersecurity TrainingCyber Ranges: The (R)evolution in Cybersecurity Training
Cyber Ranges: The (R)evolution in Cybersecurity TrainingMinsait
 
Corruption in Public Construction
Corruption in Public ConstructionCorruption in Public Construction
Corruption in Public ConstructionRich Purtell
 
The Pragmatic Future of Search
The Pragmatic Future of SearchThe Pragmatic Future of Search
The Pragmatic Future of SearchMichael King
 
Cashless transactions
Cashless  transactionsCashless  transactions
Cashless transactionsKabeeranban
 
Why Skills Matter - Further Results from the Survey of Adult Skills
Why Skills Matter - Further Results from the Survey of Adult Skills Why Skills Matter - Further Results from the Survey of Adult Skills
Why Skills Matter - Further Results from the Survey of Adult Skills EduSkills OECD
 
AppHub at Open Cloud Forum by OW2, Paris
AppHub at Open Cloud Forum by OW2, ParisAppHub at Open Cloud Forum by OW2, Paris
AppHub at Open Cloud Forum by OW2, ParisAppHub
 
The Primes - How any group can solve any problem
The Primes - How any group can solve any problemThe Primes - How any group can solve any problem
The Primes - How any group can solve any problemSebastian Kamilli
 

Destaque (16)

De vijf punten voor een gesprek
De vijf punten voor een gesprekDe vijf punten voor een gesprek
De vijf punten voor een gesprek
 
Cadbury
CadburyCadbury
Cadbury
 
หนังสืออ้างอิง
หนังสืออ้างอิงหนังสืออ้างอิง
หนังสืออ้างอิง
 
SMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning ApproachSMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning Approach
 
Bloomberg Briefs - Asean's Frontier Economies
Bloomberg Briefs - Asean's Frontier EconomiesBloomberg Briefs - Asean's Frontier Economies
Bloomberg Briefs - Asean's Frontier Economies
 
INSPIRE Annual Report 2015 - 2016
INSPIRE Annual Report 2015 - 2016INSPIRE Annual Report 2015 - 2016
INSPIRE Annual Report 2015 - 2016
 
Unleash Your Play Brain
Unleash Your Play BrainUnleash Your Play Brain
Unleash Your Play Brain
 
Nov 2016 - Toronto real estate market in 8 Charts
Nov 2016 - Toronto real estate market in 8 ChartsNov 2016 - Toronto real estate market in 8 Charts
Nov 2016 - Toronto real estate market in 8 Charts
 
Cyber Ranges: The (R)evolution in Cybersecurity Training
Cyber Ranges: The (R)evolution in Cybersecurity TrainingCyber Ranges: The (R)evolution in Cybersecurity Training
Cyber Ranges: The (R)evolution in Cybersecurity Training
 
Corruption in Public Construction
Corruption in Public ConstructionCorruption in Public Construction
Corruption in Public Construction
 
The Pragmatic Future of Search
The Pragmatic Future of SearchThe Pragmatic Future of Search
The Pragmatic Future of Search
 
Cashless transactions
Cashless  transactionsCashless  transactions
Cashless transactions
 
Cervantes rodriguez-a.san-antonio-tx
Cervantes rodriguez-a.san-antonio-txCervantes rodriguez-a.san-antonio-tx
Cervantes rodriguez-a.san-antonio-tx
 
Why Skills Matter - Further Results from the Survey of Adult Skills
Why Skills Matter - Further Results from the Survey of Adult Skills Why Skills Matter - Further Results from the Survey of Adult Skills
Why Skills Matter - Further Results from the Survey of Adult Skills
 
AppHub at Open Cloud Forum by OW2, Paris
AppHub at Open Cloud Forum by OW2, ParisAppHub at Open Cloud Forum by OW2, Paris
AppHub at Open Cloud Forum by OW2, Paris
 
The Primes - How any group can solve any problem
The Primes - How any group can solve any problemThe Primes - How any group can solve any problem
The Primes - How any group can solve any problem
 

Semelhante a Mongoid ate my homework

Remote and Open: How GitLab functions (presentation at Landing.careers)
Remote and Open: How GitLab functions (presentation at Landing.careers)Remote and Open: How GitLab functions (presentation at Landing.careers)
Remote and Open: How GitLab functions (presentation at Landing.careers)🌍 Job van der Voort
 
Ruby object model
Ruby object modelRuby object model
Ruby object modelmbeizer
 
Zope is dead - Long live Zope
Zope is dead - Long live ZopeZope is dead - Long live Zope
Zope is dead - Long live ZopeLennart Regebro
 
Writing Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjectsWriting Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjectsMichael Denomy
 
Storyboards - Pros & Cons
Storyboards - Pros & ConsStoryboards - Pros & Cons
Storyboards - Pros & Consdasdom
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web componentsbtopro
 
What we can learn from hackers (about the definition of work)
What we can learn from hackers (about the definition of work)What we can learn from hackers (about the definition of work)
What we can learn from hackers (about the definition of work)🌍 Job van der Voort
 
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB
 
Git your Jekyll on - WebCamp Ljubljana 2015
Git your Jekyll on - WebCamp Ljubljana 2015Git your Jekyll on - WebCamp Ljubljana 2015
Git your Jekyll on - WebCamp Ljubljana 2015Alja Isakovic
 
How to get your first job at the Israeli high tech industry
How to get your first job at the Israeli high tech industryHow to get your first job at the Israeli high tech industry
How to get your first job at the Israeli high tech industryRan Bar-Zik
 
Feelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java WorldFeelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java WorldKen Kousen
 
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsTrunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsPerforce
 
BathCamp #32 - CMS Smackdown! - Plone
BathCamp #32 - CMS Smackdown! - PloneBathCamp #32 - CMS Smackdown! - Plone
BathCamp #32 - CMS Smackdown! - PloneMatt Hamilton
 
The patterns guide to the selenium
The patterns guide to the seleniumThe patterns guide to the selenium
The patterns guide to the seleniumGlobalLogic Ukraine
 
For a Social Local and Mobile Drupal
For a Social Local and Mobile DrupalFor a Social Local and Mobile Drupal
For a Social Local and Mobile DrupalAdyax
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongTim Boudreau
 

Semelhante a Mongoid ate my homework (18)

Remote and Open: How GitLab functions (presentation at Landing.careers)
Remote and Open: How GitLab functions (presentation at Landing.careers)Remote and Open: How GitLab functions (presentation at Landing.careers)
Remote and Open: How GitLab functions (presentation at Landing.careers)
 
Ruby object model
Ruby object modelRuby object model
Ruby object model
 
Zope is dead - Long live Zope
Zope is dead - Long live ZopeZope is dead - Long live Zope
Zope is dead - Long live Zope
 
Writing Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjectsWriting Maintainable Tests with PageObjects
Writing Maintainable Tests with PageObjects
 
Storyboards - Pros & Cons
Storyboards - Pros & ConsStoryboards - Pros & Cons
Storyboards - Pros & Cons
 
Future proofing design work with Web components
Future proofing design work with Web componentsFuture proofing design work with Web components
Future proofing design work with Web components
 
What we can learn from hackers (about the definition of work)
What we can learn from hackers (about the definition of work)What we can learn from hackers (about the definition of work)
What we can learn from hackers (about the definition of work)
 
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
 
Git your Jekyll on - WebCamp Ljubljana 2015
Git your Jekyll on - WebCamp Ljubljana 2015Git your Jekyll on - WebCamp Ljubljana 2015
Git your Jekyll on - WebCamp Ljubljana 2015
 
How to get your first job at the Israeli high tech industry
How to get your first job at the Israeli high tech industryHow to get your first job at the Israeli high tech industry
How to get your first job at the Israeli high tech industry
 
TDD patterns
TDD patternsTDD patterns
TDD patterns
 
Feelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java WorldFeelin' Groovy: A Groovy Developer in the Java World
Feelin' Groovy: A Groovy Developer in the Java World
 
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsTrunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and Economics
 
BathCamp #32 - CMS Smackdown! - Plone
BathCamp #32 - CMS Smackdown! - PloneBathCamp #32 - CMS Smackdown! - Plone
BathCamp #32 - CMS Smackdown! - Plone
 
The patterns guide to the selenium
The patterns guide to the seleniumThe patterns guide to the selenium
The patterns guide to the selenium
 
For a Social Local and Mobile Drupal
For a Social Local and Mobile DrupalFor a Social Local and Mobile Drupal
For a Social Local and Mobile Drupal
 
Untangling4
Untangling4Untangling4
Untangling4
 
Everything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is WrongEverything You Were Taught About Java Is Wrong
Everything You Were Taught About Java Is Wrong
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

Mongoid ate my homework