Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MongoDB Philly: MongoDB at Meeteor

mongodb
April 10, 2012
250

MongoDB Philly: MongoDB at Meeteor

Meeteor makes networking easier than ever by using your LinkedIn and Facebook data to help you discover the right people to meet. Founder and CTO Brandon Hilkert, will go through Meeteor's stack and showcase how MongoDB powers this professional recommendation engine.

mongodb

April 10, 2012
Tweet

Transcript

  1. document store great for comparisons if attributes are contained no

    more joins...sort of Tuesday, April 10, 12
  2. 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” m ysql many-to- many Tuesday, April 10, 12
  3. data types Users id name email location interests 3 “Brandon”

    [email protected]” “Philly” [“Ruby”, “MongoDB”] m ongo db more NATURAL? User.all(interests: “MongoDB”) array Tuesday, April 10, 12
  4. 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” m ysql Tuesday, April 10, 12
  5. embedded documents m ongo db 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 Tuesday, April 10, 12
  6. embedded documents m ongo db User 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 Tuesday, April 10, 12
  7. RESUL TS matching guru 2 queries with a crap load

    of joins 2 SIMPLE queries Tuesday, April 10, 12
  8. 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]]) Tuesday, April 10, 12