SlideShare a Scribd company logo
1 of 25
Download to read offline
Building a Social Network with MongoDB
Brian Zambrano
MongoSV
December 3, 2010
1
Friday, December 3, 2010
Eventbrite Brand Tenets
2
Friday, December 3, 2010
Eventbrite Brand Tenets
3
Friday, December 3, 2010
Social Recommendations
4
Friday, December 3, 2010
Eventbriteʼs Social Graph
5
Friday, December 3, 2010
Eventbriteʼs Social Graph
6
Friday, December 3, 2010
Neighbors
7
Friday, December 3, 2010
Challenges
• Dynamic
• Neighbors change often
• Neighborsʼ events change often
• Flexibility
• Want to incorporate other social graphs
• Product may evolve quickly
• Performance
• We need really fast reads
• Frequent writes
8
Friday, December 3, 2010
Why MongoDB?
• Performance
• Flexible schema design
• Easy to work with
• We felt comfortable MongoDB would mature as
our needs became more demanding
9
Friday, December 3, 2010
Providing Recommendations
1. User visits http://eventbrite.com/mytickets/
2. Fetch neighbors
3. Fetch neighborsʼ events
4. Score each possible event
5. Return recommendations
10
Friday, December 3, 2010
MongoDB setup
• One non-sharded replica set
• Two DBs on Large EC2 instances
• One arbiter
• Three collections
• Users
• Events
• Orders
11
Friday, December 3, 2010
User Data in MongoDB
12
{ "_id": 4558992,
}
Unique User Id
Friday, December 3, 2010
User Data in MongoDB
13
{ "_id": 4558992,
"events" : {
"all_ids": [ 116706, 179487, 16389, 827496 ],
"curr_ids": [ 827496 ],
},
}
Past and current
attendance
Friday, December 3, 2010
User Data in MongoDB
14
{ "_id": 4558992,
"events" : {
"all_ids": [ 116706, 179487, 16389, 827496 ],
"curr_ids": [ 827496 ],
},
"nns" : [
[ 2816442, 0.2 ],
[ 1615962, 0.047619047619047616 ],
],
} Nearest neighbors
(user_id, score)
Friday, December 3, 2010
User Data in MongoDB
15
{ "_id": 4558992,
"events" : {
"all_ids": [ 116706, 179487, 16389, 827496 ],
"curr_ids": [ 827496 ],
},
"nns" : [
[ 2816442, 0.2 ],
[ 1615962, 0.047619047619047616 ],
],
"fb" : {
"_id" : 4808871,
"name" : "Brian Zambrano",
"location" : "San Francisco, California",
"friends" : [ 568876525, 569507467, 569559792 ],
},
}
Facebook data
Friday, December 3, 2010
MongoDB Indexes
16
{ "_id": 4558992,
"events" : {
"all_ids": [ 116706, 179487, 16389, 827496 ],
"curr_ids": [ 827496 ],
},
"nns" : [
[ 2816442, 0.2 ],
[ 1615962, 0.047619047619047616 ],
],
"fb" : {
"_id" : 4808871,
"name" : "Brian Zambrano",
"location" : "San Francisco, California",
"friends" : [ 568876525, 569507467, 569559792],
},
}
Friday, December 3, 2010
Events Collection
> db.events.findOne({_id: 799177})
{
"_id" : 799177,
"uid" : 2989008,
"title" : "MongoSV",
"venue" : {
"loc" : [
37.413042,
-122.071106
],
"state" : "CA",
"id" : 508093,
"city" : "Mountain View"
},
"logo" : "758915938.png",
"shortname" : "mongosv",
"start_date" : "Fri Dec 03 2010 01:00:00 GMT-0800 (PST)"
}
17
Friday, December 3, 2010
Orders Collection
> db.orders.find({_eid: 799177})
{ "_id" : 17464215, "_uid" : 1111195, "_eid" : 799177 }
{ "_id" : 17575729, "_uid" : 6970539, "_eid" : 799177 }
{ "_id" : 17582343, "_uid" : 3092687, "_eid" : 799177 }
{ "_id" : 17588693, "_uid" : 2255017, "_eid" : 799177 }
{ "_id" : 17589589, "_uid" : 6976917, "_eid" : 799177 }
{ "_id" : 17601979, "_uid" : 885441, "_eid" : 799177 }
{ "_id" : 17603085, "_uid" : 2500199, "_eid" : 799177 }
{ "_id" : 17608289, "_uid" : 6984367, "_eid" : 799177 }
{ "_id" : 17681965, "_uid" : 628459, "_eid" : 799177 }
{ "_id" : 17684489, "_uid" : 7017999, "_eid" : 799177 }
{ "_id" : 17689673, "_uid" : 7020133, "_eid" : 799177 }
{ "_id" : 17728267, "_uid" : 7036607, "_eid" : 799177 }
has more
18
Friday, December 3, 2010
Recommended Events Query
Two + n queries
1. Get neighbors
nns = db.users.find({_id : {$in : user.nn_ids}})
2. Get possible event recommendations:
db.events.find({_id : {$in : nns.events.all}})
n.For each event, get total attendee count
db.orders.find({_eid : event_id})
19
Friday, December 3, 2010
Recommended Events Query
Two + n queries
1. Get neighbors
nns = db.users.find({_id : {$in : user.nn_ids}})
2. Get possible event recommendations:
db.events.find({_id : {$in : nns.events.all}})
n.For each event, get total attendee count
db.orders.find({_eid : event_id})
20
Optimization opportunity:
Embed orders in Event records
Friday, December 3, 2010
Updating Neighbors
Two queries, one update
1. Get all orders for a userʼs past events:
uids = db.orders.find({_id : {$in : user.events.all}})
2. Get all neighbors:
nns = db.users.find({_id : {$in : uids}})
➡Score neighbors
3. Update nn_ids
db.users.update({_id : uid},
{$set : {nn_ids: nn}})
21
Friday, December 3, 2010
Facebook Friendʼs Events
Two queries
1. Get FB friends
db.users.find({fb._id : {$in : fb.friends}})
2. Get events FB friends are attending
db.events.find({_id : {$in : fb_friends_events}})
22
Friday, December 3, 2010
The Future
• Incorporate other social networks
• Iterate scoring algorithm
• Count recommendation impressions
23
Friday, December 3, 2010
Weʼre hiring!
http://www.eventbrite.com/jobs/
24
Friday, December 3, 2010
Thanks!
Brian Zambrano <brianz@eventbrite.com>
Eventbriteʼs new Facebook recommendations power
social event discovery: http://bit.ly/gRVS7I
Social Commerce: A First Look at the Numbers:
http://bit.ly/gXeg9Q
25
Friday, December 3, 2010

More Related Content

What's hot

system requirements for android projects
system requirements for android projectssystem requirements for android projects
system requirements for android projectsparry prabhu
 
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)Heungsub Lee
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platformSreenivas Kappala
 
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...Amazon Web Services Korea
 
Mobile app development ppt
Mobile app development pptMobile app development ppt
Mobile app development pptEmbark Software
 
Mongoose: MongoDB object modelling for Node.js
Mongoose: MongoDB object modelling for Node.jsMongoose: MongoDB object modelling for Node.js
Mongoose: MongoDB object modelling for Node.jsYuriy Bogomolov
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema DesignMongoDB
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android StudioSuyash Srijan
 
MongoDB- Crud Operation
MongoDB- Crud OperationMongoDB- Crud Operation
MongoDB- Crud OperationEdureka!
 
A JAVA project on Marriage bureau management system
A JAVA project on Marriage bureau management systemA JAVA project on Marriage bureau management system
A JAVA project on Marriage bureau management systemsvrohith 9
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulatorguru472
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patternsjoergreichert
 
Airline reservation system project report (1)
Airline reservation system project report (1)Airline reservation system project report (1)
Airline reservation system project report (1)MostafaMorsyMohamed
 
Android simple calculator
Android simple calculatorAndroid simple calculator
Android simple calculatorKATHEESKUMAR S
 
Event managementsystem
Event managementsystemEvent managementsystem
Event managementsystemPraveen Jha
 
Multiplayer Online Gaming
Multiplayer Online GamingMultiplayer Online Gaming
Multiplayer Online Gamingchetnamistry
 

What's hot (20)

system requirements for android projects
system requirements for android projectssystem requirements for android projects
system requirements for android projects
 
Profiling PL/pgSQL
Profiling PL/pgSQLProfiling PL/pgSQL
Profiling PL/pgSQL
 
Http session (Java)
Http session (Java)Http session (Java)
Http session (Java)
 
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
 
ASP.NET-Web Programming - Sessions and Cookies
ASP.NET-Web Programming - Sessions and CookiesASP.NET-Web Programming - Sessions and Cookies
ASP.NET-Web Programming - Sessions and Cookies
 
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
 
Mobile app development ppt
Mobile app development pptMobile app development ppt
Mobile app development ppt
 
Mongoose: MongoDB object modelling for Node.js
Mongoose: MongoDB object modelling for Node.jsMongoose: MongoDB object modelling for Node.js
Mongoose: MongoDB object modelling for Node.js
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Expressjs
ExpressjsExpressjs
Expressjs
 
MongoDB- Crud Operation
MongoDB- Crud OperationMongoDB- Crud Operation
MongoDB- Crud Operation
 
A JAVA project on Marriage bureau management system
A JAVA project on Marriage bureau management systemA JAVA project on Marriage bureau management system
A JAVA project on Marriage bureau management system
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulator
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patterns
 
Airline reservation system project report (1)
Airline reservation system project report (1)Airline reservation system project report (1)
Airline reservation system project report (1)
 
Android simple calculator
Android simple calculatorAndroid simple calculator
Android simple calculator
 
Event managementsystem
Event managementsystemEvent managementsystem
Event managementsystem
 
Multiplayer Online Gaming
Multiplayer Online GamingMultiplayer Online Gaming
Multiplayer Online Gaming
 

Viewers also liked

1 Page Salary Negotiation Cheat Sheet
1 Page Salary Negotiation Cheat Sheet1 Page Salary Negotiation Cheat Sheet
1 Page Salary Negotiation Cheat SheetLewis Lin 🦊
 
Statistics to Know for Case Interview
Statistics to Know for Case InterviewStatistics to Know for Case Interview
Statistics to Know for Case InterviewLewis Lin 🦊
 
PM interview questions book pdf
PM interview questions book pdfPM interview questions book pdf
PM interview questions book pdfLewis Lin 🦊
 
Google Product Manager Interview Cheat Sheet
Google Product Manager Interview Cheat SheetGoogle Product Manager Interview Cheat Sheet
Google Product Manager Interview Cheat SheetLewis Lin 🦊
 
Salary Negotiation Cheat Sheet
Salary Negotiation Cheat SheetSalary Negotiation Cheat Sheet
Salary Negotiation Cheat SheetLewis Lin 🦊
 
What Game Developers Look for in a New Graduate: Interviews and Surveys at On...
What Game Developers Look for in a New Graduate: Interviews and Surveys at On...What Game Developers Look for in a New Graduate: Interviews and Surveys at On...
What Game Developers Look for in a New Graduate: Interviews and Surveys at On...Lewis Lin 🦊
 
A gentle introduction to algorithm complexity analysis
A gentle introduction to algorithm complexity analysisA gentle introduction to algorithm complexity analysis
A gentle introduction to algorithm complexity analysisLewis Lin 🦊
 
Creating social features at BranchOut using MongoDB
Creating social features at BranchOut using MongoDBCreating social features at BranchOut using MongoDB
Creating social features at BranchOut using MongoDBLewis Lin 🦊
 
Book Summary: Secrets of the Product Manager Interview
Book Summary: Secrets of the Product Manager InterviewBook Summary: Secrets of the Product Manager Interview
Book Summary: Secrets of the Product Manager InterviewLewis Lin 🦊
 
MongoDB Best Practices
MongoDB Best PracticesMongoDB Best Practices
MongoDB Best PracticesLewis Lin 🦊
 
MongoDB Schema Design and its Performance Implications
MongoDB Schema Design and its Performance ImplicationsMongoDB Schema Design and its Performance Implications
MongoDB Schema Design and its Performance ImplicationsLewis Lin 🦊
 
Amazon Product Manager Interview Cheat Sheet
Amazon Product Manager Interview Cheat SheetAmazon Product Manager Interview Cheat Sheet
Amazon Product Manager Interview Cheat SheetLewis Lin 🦊
 
Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...
Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...
Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...Lewis Lin 🦊
 
How to Ace the Product Management Interview, Product Camp Seattle Oct 2013
How to Ace the Product Management Interview, Product Camp Seattle Oct 2013How to Ace the Product Management Interview, Product Camp Seattle Oct 2013
How to Ace the Product Management Interview, Product Camp Seattle Oct 2013Lewis Lin 🦊
 
Book Summary: Decode and Conquer by Lewis C. Lin
Book Summary: Decode and Conquer by Lewis C. LinBook Summary: Decode and Conquer by Lewis C. Lin
Book Summary: Decode and Conquer by Lewis C. LinLewis Lin 🦊
 
Facebook Product Manager Interview Cheat Sheet
Facebook Product Manager Interview Cheat SheetFacebook Product Manager Interview Cheat Sheet
Facebook Product Manager Interview Cheat SheetLewis Lin 🦊
 
Google product manager interview questions answers
Google product manager interview questions answersGoogle product manager interview questions answers
Google product manager interview questions answersSweta Singh
 
100 product management interview questions and answers pdf
100 product management interview questions and answers pdf100 product management interview questions and answers pdf
100 product management interview questions and answers pdfProductManager88
 
Cracking the Product Manager Interview
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager InterviewGayle McDowell
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesLewis Lin 🦊
 

Viewers also liked (20)

1 Page Salary Negotiation Cheat Sheet
1 Page Salary Negotiation Cheat Sheet1 Page Salary Negotiation Cheat Sheet
1 Page Salary Negotiation Cheat Sheet
 
Statistics to Know for Case Interview
Statistics to Know for Case InterviewStatistics to Know for Case Interview
Statistics to Know for Case Interview
 
PM interview questions book pdf
PM interview questions book pdfPM interview questions book pdf
PM interview questions book pdf
 
Google Product Manager Interview Cheat Sheet
Google Product Manager Interview Cheat SheetGoogle Product Manager Interview Cheat Sheet
Google Product Manager Interview Cheat Sheet
 
Salary Negotiation Cheat Sheet
Salary Negotiation Cheat SheetSalary Negotiation Cheat Sheet
Salary Negotiation Cheat Sheet
 
What Game Developers Look for in a New Graduate: Interviews and Surveys at On...
What Game Developers Look for in a New Graduate: Interviews and Surveys at On...What Game Developers Look for in a New Graduate: Interviews and Surveys at On...
What Game Developers Look for in a New Graduate: Interviews and Surveys at On...
 
A gentle introduction to algorithm complexity analysis
A gentle introduction to algorithm complexity analysisA gentle introduction to algorithm complexity analysis
A gentle introduction to algorithm complexity analysis
 
Creating social features at BranchOut using MongoDB
Creating social features at BranchOut using MongoDBCreating social features at BranchOut using MongoDB
Creating social features at BranchOut using MongoDB
 
Book Summary: Secrets of the Product Manager Interview
Book Summary: Secrets of the Product Manager InterviewBook Summary: Secrets of the Product Manager Interview
Book Summary: Secrets of the Product Manager Interview
 
MongoDB Best Practices
MongoDB Best PracticesMongoDB Best Practices
MongoDB Best Practices
 
MongoDB Schema Design and its Performance Implications
MongoDB Schema Design and its Performance ImplicationsMongoDB Schema Design and its Performance Implications
MongoDB Schema Design and its Performance Implications
 
Amazon Product Manager Interview Cheat Sheet
Amazon Product Manager Interview Cheat SheetAmazon Product Manager Interview Cheat Sheet
Amazon Product Manager Interview Cheat Sheet
 
Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...
Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...
Facebook Rotational Product Manager Interview: Jewel Lim's Tips on Getting an...
 
How to Ace the Product Management Interview, Product Camp Seattle Oct 2013
How to Ace the Product Management Interview, Product Camp Seattle Oct 2013How to Ace the Product Management Interview, Product Camp Seattle Oct 2013
How to Ace the Product Management Interview, Product Camp Seattle Oct 2013
 
Book Summary: Decode and Conquer by Lewis C. Lin
Book Summary: Decode and Conquer by Lewis C. LinBook Summary: Decode and Conquer by Lewis C. Lin
Book Summary: Decode and Conquer by Lewis C. Lin
 
Facebook Product Manager Interview Cheat Sheet
Facebook Product Manager Interview Cheat SheetFacebook Product Manager Interview Cheat Sheet
Facebook Product Manager Interview Cheat Sheet
 
Google product manager interview questions answers
Google product manager interview questions answersGoogle product manager interview questions answers
Google product manager interview questions answers
 
100 product management interview questions and answers pdf
100 product management interview questions and answers pdf100 product management interview questions and answers pdf
100 product management interview questions and answers pdf
 
Cracking the Product Manager Interview
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 

Similar to Building a Social Network with MongoDB

Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDBFred Chu
 
User Data Management with MongoDB
User Data Management with MongoDB User Data Management with MongoDB
User Data Management with MongoDB MongoDB
 
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
Big Data Analytics 1: Driving Personalized Experiences Using Customer ProfilesBig Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
Big Data Analytics 1: Driving Personalized Experiences Using Customer ProfilesMongoDB
 
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...MongoDB
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in DocumentsMongoDB
 
Back to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsBack to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsJoe Drumgoole
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema DesignMongoDB
 
Creating a Single View Part 1: Overview and Data Analysis
Creating a Single View Part 1: Overview and Data AnalysisCreating a Single View Part 1: Overview and Data Analysis
Creating a Single View Part 1: Overview and Data AnalysisMongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB
 
6 things to expect when you are visualizing
6 things to expect when you are visualizing6 things to expect when you are visualizing
6 things to expect when you are visualizingKrist Wongsuphasawat
 
Dev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesDev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesMongoDB
 
First app online conf
First app   online confFirst app   online conf
First app online confMongoDB
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling rogerbodamer
 
Systems of engagement
Systems of engagementSystems of engagement
Systems of engagementBryan Reinero
 
Schema Design in MongoDB - TriMug Meetup North Carolina
Schema Design in MongoDB - TriMug Meetup North CarolinaSchema Design in MongoDB - TriMug Meetup North Carolina
Schema Design in MongoDB - TriMug Meetup North CarolinaRandall Hunt
 
Data Visualization for Big Data: Experience from the Front Line
Data Visualization for Big Data: Experience from the Front LineData Visualization for Big Data: Experience from the Front Line
Data Visualization for Big Data: Experience from the Front LineRosa Romero Gómez, PhD
 

Similar to Building a Social Network with MongoDB (20)

Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
 
User Data Management with MongoDB
User Data Management with MongoDB User Data Management with MongoDB
User Data Management with MongoDB
 
Awesome Tools 2017
Awesome Tools 2017Awesome Tools 2017
Awesome Tools 2017
 
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
Big Data Analytics 1: Driving Personalized Experiences Using Customer ProfilesBig Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
Big Data Analytics 1: Driving Personalized Experiences Using Customer Profiles
 
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
MongoDB .local Chicago 2019: Best Practices for Working with IoT and Time-ser...
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
Back to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsBack to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in Documents
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema Design
 
Creating a Single View Part 1: Overview and Data Analysis
Creating a Single View Part 1: Overview and Data AnalysisCreating a Single View Part 1: Overview and Data Analysis
Creating a Single View Part 1: Overview and Data Analysis
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
 
MongoDB
MongoDBMongoDB
MongoDB
 
6 things to expect when you are visualizing
6 things to expect when you are visualizing6 things to expect when you are visualizing
6 things to expect when you are visualizing
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
Dev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesDev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best Practices
 
First app online conf
First app   online confFirst app   online conf
First app online conf
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling
 
Systems of engagement
Systems of engagementSystems of engagement
Systems of engagement
 
Schema Design in MongoDB - TriMug Meetup North Carolina
Schema Design in MongoDB - TriMug Meetup North CarolinaSchema Design in MongoDB - TriMug Meetup North Carolina
Schema Design in MongoDB - TriMug Meetup North Carolina
 
Data Visualization for Big Data: Experience from the Front Line
Data Visualization for Big Data: Experience from the Front LineData Visualization for Big Data: Experience from the Front Line
Data Visualization for Big Data: Experience from the Front Line
 

More from Lewis Lin 🦊

Gaskins' memo pitching PowerPoint
Gaskins' memo pitching PowerPointGaskins' memo pitching PowerPoint
Gaskins' memo pitching PowerPointLewis Lin 🦊
 
P&G Memo: Creating Modern Day Brand Management
P&G Memo: Creating Modern Day Brand ManagementP&G Memo: Creating Modern Day Brand Management
P&G Memo: Creating Modern Day Brand ManagementLewis Lin 🦊
 
Jeffrey Katzenberg on Disney Studios
Jeffrey Katzenberg on Disney StudiosJeffrey Katzenberg on Disney Studios
Jeffrey Katzenberg on Disney StudiosLewis Lin 🦊
 
Carnegie Mellon MS PM Internships 2020
Carnegie Mellon MS PM Internships 2020Carnegie Mellon MS PM Internships 2020
Carnegie Mellon MS PM Internships 2020Lewis Lin 🦊
 
Gallup's Notes on Reinventing Performance Management
Gallup's Notes on Reinventing Performance ManagementGallup's Notes on Reinventing Performance Management
Gallup's Notes on Reinventing Performance ManagementLewis Lin 🦊
 
Twitter Job Opportunities for Students
Twitter Job Opportunities for StudentsTwitter Job Opportunities for Students
Twitter Job Opportunities for StudentsLewis Lin 🦊
 
Facebook's Official Guide to Technical Program Management Candidates
Facebook's Official Guide to Technical Program Management CandidatesFacebook's Official Guide to Technical Program Management Candidates
Facebook's Official Guide to Technical Program Management CandidatesLewis Lin 🦊
 
Performance Management at Google
Performance Management at GooglePerformance Management at Google
Performance Management at GoogleLewis Lin 🦊
 
Google Interview Prep Guide Software Engineer
Google Interview Prep Guide Software EngineerGoogle Interview Prep Guide Software Engineer
Google Interview Prep Guide Software EngineerLewis Lin 🦊
 
Google Interview Prep Guide Product Manager
Google Interview Prep Guide Product ManagerGoogle Interview Prep Guide Product Manager
Google Interview Prep Guide Product ManagerLewis Lin 🦊
 
Skills Assessment Offering by Lewis C. Lin
Skills Assessment Offering by Lewis C. LinSkills Assessment Offering by Lewis C. Lin
Skills Assessment Offering by Lewis C. LinLewis Lin 🦊
 
How Men and Women Differ Across Leadership Traits
How Men and Women Differ Across Leadership TraitsHow Men and Women Differ Across Leadership Traits
How Men and Women Differ Across Leadership TraitsLewis Lin 🦊
 
Product Manager Skills Survey
Product Manager Skills SurveyProduct Manager Skills Survey
Product Manager Skills SurveyLewis Lin 🦊
 
Uxpin Why Build a Design System
Uxpin Why Build a Design SystemUxpin Why Build a Design System
Uxpin Why Build a Design SystemLewis Lin 🦊
 
30-Day Google PM Interview Study Guide
30-Day Google PM Interview Study Guide30-Day Google PM Interview Study Guide
30-Day Google PM Interview Study GuideLewis Lin 🦊
 
30-Day Facebook PM Interview Study Guide
30-Day Facebook PM Interview Study Guide30-Day Facebook PM Interview Study Guide
30-Day Facebook PM Interview Study GuideLewis Lin 🦊
 
36-Day Amazon PM Interview Study Guide
36-Day Amazon PM Interview Study Guide36-Day Amazon PM Interview Study Guide
36-Day Amazon PM Interview Study GuideLewis Lin 🦊
 
McKinsey's Assessment on PM Careers
McKinsey's Assessment on PM CareersMcKinsey's Assessment on PM Careers
McKinsey's Assessment on PM CareersLewis Lin 🦊
 
Five Traits of Great Product Managers
Five Traits of Great Product ManagersFive Traits of Great Product Managers
Five Traits of Great Product ManagersLewis Lin 🦊
 

More from Lewis Lin 🦊 (20)

Gaskins' memo pitching PowerPoint
Gaskins' memo pitching PowerPointGaskins' memo pitching PowerPoint
Gaskins' memo pitching PowerPoint
 
P&G Memo: Creating Modern Day Brand Management
P&G Memo: Creating Modern Day Brand ManagementP&G Memo: Creating Modern Day Brand Management
P&G Memo: Creating Modern Day Brand Management
 
Jeffrey Katzenberg on Disney Studios
Jeffrey Katzenberg on Disney StudiosJeffrey Katzenberg on Disney Studios
Jeffrey Katzenberg on Disney Studios
 
Carnegie Mellon MS PM Internships 2020
Carnegie Mellon MS PM Internships 2020Carnegie Mellon MS PM Internships 2020
Carnegie Mellon MS PM Internships 2020
 
Gallup's Notes on Reinventing Performance Management
Gallup's Notes on Reinventing Performance ManagementGallup's Notes on Reinventing Performance Management
Gallup's Notes on Reinventing Performance Management
 
Twitter Job Opportunities for Students
Twitter Job Opportunities for StudentsTwitter Job Opportunities for Students
Twitter Job Opportunities for Students
 
Facebook's Official Guide to Technical Program Management Candidates
Facebook's Official Guide to Technical Program Management CandidatesFacebook's Official Guide to Technical Program Management Candidates
Facebook's Official Guide to Technical Program Management Candidates
 
Performance Management at Google
Performance Management at GooglePerformance Management at Google
Performance Management at Google
 
Google Interview Prep Guide Software Engineer
Google Interview Prep Guide Software EngineerGoogle Interview Prep Guide Software Engineer
Google Interview Prep Guide Software Engineer
 
Google Interview Prep Guide Product Manager
Google Interview Prep Guide Product ManagerGoogle Interview Prep Guide Product Manager
Google Interview Prep Guide Product Manager
 
Skills Assessment Offering by Lewis C. Lin
Skills Assessment Offering by Lewis C. LinSkills Assessment Offering by Lewis C. Lin
Skills Assessment Offering by Lewis C. Lin
 
How Men and Women Differ Across Leadership Traits
How Men and Women Differ Across Leadership TraitsHow Men and Women Differ Across Leadership Traits
How Men and Women Differ Across Leadership Traits
 
Product Manager Skills Survey
Product Manager Skills SurveyProduct Manager Skills Survey
Product Manager Skills Survey
 
Uxpin Why Build a Design System
Uxpin Why Build a Design SystemUxpin Why Build a Design System
Uxpin Why Build a Design System
 
Sourcing on GitHub
Sourcing on GitHubSourcing on GitHub
Sourcing on GitHub
 
30-Day Google PM Interview Study Guide
30-Day Google PM Interview Study Guide30-Day Google PM Interview Study Guide
30-Day Google PM Interview Study Guide
 
30-Day Facebook PM Interview Study Guide
30-Day Facebook PM Interview Study Guide30-Day Facebook PM Interview Study Guide
30-Day Facebook PM Interview Study Guide
 
36-Day Amazon PM Interview Study Guide
36-Day Amazon PM Interview Study Guide36-Day Amazon PM Interview Study Guide
36-Day Amazon PM Interview Study Guide
 
McKinsey's Assessment on PM Careers
McKinsey's Assessment on PM CareersMcKinsey's Assessment on PM Careers
McKinsey's Assessment on PM Careers
 
Five Traits of Great Product Managers
Five Traits of Great Product ManagersFive Traits of Great Product Managers
Five Traits of Great Product Managers
 

Recently uploaded

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 

Recently uploaded (20)

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 

Building a Social Network with MongoDB

  • 1. Building a Social Network with MongoDB Brian Zambrano MongoSV December 3, 2010 1 Friday, December 3, 2010
  • 8. Challenges • Dynamic • Neighbors change often • Neighborsʼ events change often • Flexibility • Want to incorporate other social graphs • Product may evolve quickly • Performance • We need really fast reads • Frequent writes 8 Friday, December 3, 2010
  • 9. Why MongoDB? • Performance • Flexible schema design • Easy to work with • We felt comfortable MongoDB would mature as our needs became more demanding 9 Friday, December 3, 2010
  • 10. Providing Recommendations 1. User visits http://eventbrite.com/mytickets/ 2. Fetch neighbors 3. Fetch neighborsʼ events 4. Score each possible event 5. Return recommendations 10 Friday, December 3, 2010
  • 11. MongoDB setup • One non-sharded replica set • Two DBs on Large EC2 instances • One arbiter • Three collections • Users • Events • Orders 11 Friday, December 3, 2010
  • 12. User Data in MongoDB 12 { "_id": 4558992, } Unique User Id Friday, December 3, 2010
  • 13. User Data in MongoDB 13 { "_id": 4558992, "events" : { "all_ids": [ 116706, 179487, 16389, 827496 ], "curr_ids": [ 827496 ], }, } Past and current attendance Friday, December 3, 2010
  • 14. User Data in MongoDB 14 { "_id": 4558992, "events" : { "all_ids": [ 116706, 179487, 16389, 827496 ], "curr_ids": [ 827496 ], }, "nns" : [ [ 2816442, 0.2 ], [ 1615962, 0.047619047619047616 ], ], } Nearest neighbors (user_id, score) Friday, December 3, 2010
  • 15. User Data in MongoDB 15 { "_id": 4558992, "events" : { "all_ids": [ 116706, 179487, 16389, 827496 ], "curr_ids": [ 827496 ], }, "nns" : [ [ 2816442, 0.2 ], [ 1615962, 0.047619047619047616 ], ], "fb" : { "_id" : 4808871, "name" : "Brian Zambrano", "location" : "San Francisco, California", "friends" : [ 568876525, 569507467, 569559792 ], }, } Facebook data Friday, December 3, 2010
  • 16. MongoDB Indexes 16 { "_id": 4558992, "events" : { "all_ids": [ 116706, 179487, 16389, 827496 ], "curr_ids": [ 827496 ], }, "nns" : [ [ 2816442, 0.2 ], [ 1615962, 0.047619047619047616 ], ], "fb" : { "_id" : 4808871, "name" : "Brian Zambrano", "location" : "San Francisco, California", "friends" : [ 568876525, 569507467, 569559792], }, } Friday, December 3, 2010
  • 17. Events Collection > db.events.findOne({_id: 799177}) { "_id" : 799177, "uid" : 2989008, "title" : "MongoSV", "venue" : { "loc" : [ 37.413042, -122.071106 ], "state" : "CA", "id" : 508093, "city" : "Mountain View" }, "logo" : "758915938.png", "shortname" : "mongosv", "start_date" : "Fri Dec 03 2010 01:00:00 GMT-0800 (PST)" } 17 Friday, December 3, 2010
  • 18. Orders Collection > db.orders.find({_eid: 799177}) { "_id" : 17464215, "_uid" : 1111195, "_eid" : 799177 } { "_id" : 17575729, "_uid" : 6970539, "_eid" : 799177 } { "_id" : 17582343, "_uid" : 3092687, "_eid" : 799177 } { "_id" : 17588693, "_uid" : 2255017, "_eid" : 799177 } { "_id" : 17589589, "_uid" : 6976917, "_eid" : 799177 } { "_id" : 17601979, "_uid" : 885441, "_eid" : 799177 } { "_id" : 17603085, "_uid" : 2500199, "_eid" : 799177 } { "_id" : 17608289, "_uid" : 6984367, "_eid" : 799177 } { "_id" : 17681965, "_uid" : 628459, "_eid" : 799177 } { "_id" : 17684489, "_uid" : 7017999, "_eid" : 799177 } { "_id" : 17689673, "_uid" : 7020133, "_eid" : 799177 } { "_id" : 17728267, "_uid" : 7036607, "_eid" : 799177 } has more 18 Friday, December 3, 2010
  • 19. Recommended Events Query Two + n queries 1. Get neighbors nns = db.users.find({_id : {$in : user.nn_ids}}) 2. Get possible event recommendations: db.events.find({_id : {$in : nns.events.all}}) n.For each event, get total attendee count db.orders.find({_eid : event_id}) 19 Friday, December 3, 2010
  • 20. Recommended Events Query Two + n queries 1. Get neighbors nns = db.users.find({_id : {$in : user.nn_ids}}) 2. Get possible event recommendations: db.events.find({_id : {$in : nns.events.all}}) n.For each event, get total attendee count db.orders.find({_eid : event_id}) 20 Optimization opportunity: Embed orders in Event records Friday, December 3, 2010
  • 21. Updating Neighbors Two queries, one update 1. Get all orders for a userʼs past events: uids = db.orders.find({_id : {$in : user.events.all}}) 2. Get all neighbors: nns = db.users.find({_id : {$in : uids}}) ➡Score neighbors 3. Update nn_ids db.users.update({_id : uid}, {$set : {nn_ids: nn}}) 21 Friday, December 3, 2010
  • 22. Facebook Friendʼs Events Two queries 1. Get FB friends db.users.find({fb._id : {$in : fb.friends}}) 2. Get events FB friends are attending db.events.find({_id : {$in : fb_friends_events}}) 22 Friday, December 3, 2010
  • 23. The Future • Incorporate other social networks • Iterate scoring algorithm • Count recommendation impressions 23 Friday, December 3, 2010
  • 25. Thanks! Brian Zambrano <brianz@eventbrite.com> Eventbriteʼs new Facebook recommendations power social event discovery: http://bit.ly/gRVS7I Social Commerce: A First Look at the Numbers: http://bit.ly/gXeg9Q 25 Friday, December 3, 2010