Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
meeteor-mongodb.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Brandon Hilkert
April 11, 2012
360
0
Share
meeteor-mongodb.pdf
Brandon Hilkert
April 11, 2012
More Decks by Brandon Hilkert
See All by Brandon Hilkert
A Path to Services
brandonhilkert
2
950
The Magic Sauce is Open Source
brandonhilkert
0
280
Info Products are Products Too
brandonhilkert
3
220
Build a Ruby Gem
brandonhilkert
0
660
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
5.5k
RailsConf 2023
tenderlove
30
1.4k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
190
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Skip the Path - Find Your Career Trail
mkilby
1
120
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
What's in a price? How to price your products and services
michaelherold
247
13k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Transcript
how uses Wednesday, April 11, 12
Brandon Hilkert @brandonhilkert http://meeteor.com Wednesday, April 11, 12
http://meeteor.com what is Wednesday, April 11, 12
EASY FAST and Wednesday, April 11, 12
we’re PRODUCT people, not SERVER people Wednesday, April 11, 12
Rails Nginx EC2 MySQL RDS platform Wednesday, April 11, 12
2 pain points Wednesday, April 11, 12
1 user signup Avg. 50 sec. Wednesday, April 11, 12
1 user signup FAST? Avg. 50 sec. Wednesday, April 11,
12
2 matching guru Wednesday, April 11, 12
Wednesday, April 11, 12
join spaghetti Wednesday, April 11, 12
DISCLAIMER! DISCLAIMER! DISCLAIMER! DISCLAIMER! DISCLAIMER! Wednesday, April 11, 12
FASTER! Need to get Wednesday, April 11, 12
SQL vs. NoSQL early 2011 Wednesday, April 11, 12
flame wars are not always a BAD THING? Wednesday, April
11, 12
1 awareness Wednesday, April 11, 12
2 o.s.s. Wednesday, April 11, 12
who CAREs? Wednesday, April 11, 12
Wednesday, April 11, 12
industries industries employers employers interests interests skills skills Wednesday, April
11, 12
document store great for comparisons if attributes are contained no
more joins...sort of Wednesday, April 11, 12
mongoDB vs. couchDB Wednesday, April 11, 12
mongoDB winner! Wednesday, April 11, 12
data types Users id name email location 3 “Brandon” “
[email protected]
”
“Philly” User_Interests id user_id interest_id 1 3 4 Interests id name 4 “HTML” mysql many-to-many Wednesday, April 11, 12
data types Users id name email location interests 3 “Brandon”
“
[email protected]
” “Philly” [“Ruby”, “MongoDB”] mongodb more NATURAL? User.all(interests: “MongoDB”) array Wednesday, April 11, 12
embedded documents Users id name email location 3 “Brandon” “
[email protected]
”
“Philly” User_Jobs id user_id job_id 1 3 4 Jobs id employer_id position description 4 7 “Developer” “Web” many-to-many Employers id name location industry 7 “Meeteor” “Philly” “Internet” mysql Wednesday, April 11, 12
embedded documents mongodb class User include MongoMapper::Document key :first_name, String
key :last_name, String key :headline, String key :email, String many :jobs end class Job include MongoMapper::EmbeddedDocument key :employer, String key :position, String key :description, String key :industry, String end Wednesday, April 11, 12
embedded documents mongodb Users id name email location jobs user.jobs.first.employer
=> “Meeteor” 3 “Brandon” “
[email protected]
” “Philly” [{:_id => BSON::ObjectId('4e4efad0d052fc3ea0009a7a'), :employer => “Meeteor”, :position => “Founder”, :description => “Create networking application”, :industry => “Internet” }] embedded document Wednesday, April 11, 12
conversion? ~ 40 hours of which ~20 hours tinkering Wednesday,
April 11, 12
RESULTS user signup 50 sec. 3 sec. Wednesday, April 11,
12
RESULTS matching guru 2 queries with a crap load of
joins 2 SIMPLE queries Wednesday, April 11, 12
Rails Heroku MongoDB MongoHQ platform revised we’re PRODUCT people, remember?
Wednesday, April 11, 12
how to not make life miserable after converting... slow queries
indexing db.system.profile.find({millis:{$gt:2000}}).sort({$natural:-1}) User.ensure_index(:interests) User.ensure_index("jobs.employer") AnalyticLog.ensure_index([[:user_id, 1], [:type, 1]]) Wednesday, April 11, 12
questions? Brandon Hilkert @brandonhilkert Wednesday, April 11, 12