SlideShare a Scribd company logo
Building a Private Social Network with MongoDB Justin Jenkins@LearnMongo
Learn Mongo (.com that is) Twitter: @LearnMongo MongoDB resources aimed at not scaring off the beginner.
Saddleback Church 21,000+ per weekend @ 10 locations.4,000 online. 4,300 “small groups” 20k – 32k people ~1 million user records 3.2 million e-mails a week Service trips to ~180 countries Food bank serving Orange County
Features, easy of use …
Project Goals Provide  a private way for groups to interact and share online. Tie into other social networks but keep group data private. Provide groups with video & audio resources for growth. Create a simple & fast user experience.
MongoDB                      SQL Server Solid, durable Years of use Very easy to query Uh Ohs Not optimized for the web Can be complex to scale Stringent schema  Flexible schema Fairly easy to scale Optimized for read / inserts Uh Ohs New, little past use Can be harder to query Different data format
Playing nice with SQL Server
Playing nice with SQL Server Keep users accounts in SQL Use the same user id’s in both SQL and MongoDB. Store app specific user data in MongoDB. Keep group data and hierarchy in SQL Extract group data from SQL when any user of the group logs in, compare. Push any changes back to SQL in the background.
ProblemSolved?
The Problems MongoDB Solved Flexible schema design  Each feed item can have totally different attributes. New features can be added quickly. Reduces impact on production SQL Server Focus server resources on internal staff. BSON to JSON Ideal for a highly AJAX / JavaScript site.
The Feed
The Feed The main feature of the site is “the feed” where the group can interact and share discussions, prayers, videos, etc. We need something very flexible … Discussions Videos Events Meetings Prayers Web Links Pictures
Schema Design Flexible Schema Less clutter. Cleaner, leaner storage. Simpler queries. JOINs largely unneeded. BSON Format Converts into JSON with very little effort to make JavaScript / AJAX centric apps happy. Move from the client to the database, back to the client easily.
{   "_id"            : "4d19fb939ac0900274000005",   "_t"             : "Discussion",   "created"        : "Tue, 28 Dec 2010 07:00:35 GMT",   "GroupID"        : 129242,   "eIndividualID"  : "22872F9",   "firstName"      : "Bill",   "lastName"       : "Finch",   "discussionBody" : "I've been not feeling well lately,                       I hope it's nothing major.",   "comments": [     {       "_id"           : "4d19fe329ac090027400000a",       "eIndividualID" : "FFE4251",       "created"       : "2010-12-28T15:11:46.6760000Z",       "firstName"     : "Robin",       "lastName"      : "Tally",       "commentText"   : "I hope that everything is OK,                          whatever it is!"     },     {       "_id"           : "4d1df3b29ac0900d64000003", ...    } ] }
Models (the pretty kind)
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Newtonsoft.Json; using MySmallGroup.Helpers.JsonConverters; namespace MySmallGroup.Models {     public abstract class Feed : IFeed, IUserCreatable     {         [JsonConverter(typeof(MongoOidConverter))]         public MongoDB.Oid Id { get; set; } public DateTime created { get; set; }         public intGroupID { get; set; }         public string eIndividualID { get; set; }         public string firstName { get; set; }         public string lastName { get; set; }         public abstract string shortDescription { get; }         public intcommentCount { get; set; }         public IList<comment> comments { get; set; }         public abstract void ReceivedJsonEncode();         public Feed Get()         {             return this;         }     }     public interface IFeed : IUserCreatable     { MongoDB.Oid Id { get; set; } intGroupID { get; set; }         string eIndividualID { get; set; }         string firstName { get; set; }         string lastName { get; set; }         string shortDescription { get; } intcommentCount { get; set; } IList<comment> comments { get; set; }         void ReceivedJsonEncode();         Feed Get();     } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using MySmallGroup.Helpers.ExtensionMethods; namespace MySmallGroup.Models {     public class Discussion : Feed     {         public string discussionBody { get; set;}         public Discussion()         { this.commentCount = new int(); this.comments = new List<comment>(); this.created = DateTime.Now;         }         public override void ReceivedJsonEncode()         { discussionBody = discussionBody.ReceivedJsonEncode();         }         public override string shortDescription         {             get { return discussionBody; }         }     } }
Live Chat & Video
Live Chat & Live Video {   "_id": "4cd261549ac0900c24000006",   "senderEIndividualID": "1B0D6E8",   "senderFirstName": "Justin",   "senderLastName": "Jenkins",   "sendDate": "Thu, 04 Nov 2010 00:31:32 GMT",   "groupID": 119420,   "message": "way faster then devtho" } {   "_id": "4cd261a69ac0900c2400000a",   "senderEIndividualID": "B656641",   "senderFirstName": "Steve",   "senderLastName": "Chen",   "sendDate": "Thu, 04 Nov 2010 00:32:54 GMT",   "groupID": 119420,   "message": "oh" }  {   "_id": "4cd2621b9ac0900c2400001f",   "senderEIndividualID": "1B0D6E8",   "senderFirstName": "Justin",   "senderLastName": "Jenkins",   "sendDate": "Thu, 04 Nov 2010 00:34:51 GMT",   "groupID": 119420,   "message": "I think it&#39;s the facebook pic reload voodoo Jeff               made" }
User Settings
User Settings {   "eIndividualID": "A0BE87A",   "_id": "4cd332389ac0900c2400001c",  "ChatTimestamps": false,   "GroupSettings": [     {       "GroupId": 119420,       "FeedNotificationEmail": false,       "CommentNotificationEmail": false     },     {       "GroupId": 128834,       "FeedNotificationEmail": true,       "CommentNotificationEmail": false     },     {       "GroupId": 125680,       "FeedNotificationEmail": true,       "CommentNotificationEmail": true     }   ] }
Email Tracking …
E-mail Tracking (the boring stuff.) Emails Sent 350,000 normal e-mails sent a week. 460,000 daily subscription e-mails sent a day. Tracking Needs Track each e-mail open, per individual. Date User Agent IP If a user opens an e-mail more than once, don’t double count but still track. Deduce how quickly users open an e-mail and how many don’t open the e-mail at all.
Email Tracking {   "EmailLogID": 14,   "EmailLogDocumentID": "4d12a55e00ae2611f8000002",   "EIndividualID": “ZZZZZZZ",   "Email": "jxxx@zzzzzzzzz.com",   "SendDate": "Wed, 22 Dec 2010 17:26:54 GMT",   "_id": "4d12a56a18bee80a7c00243d", "Opens": [ {       "OpenDate": "2010-12-23T01:59:45",       "UserAgent": "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1like Mac OS X; en-us) ...", "IP": "72.111.250.111"     }, {       "OpenDate": "2010-12-23T16:22:19",       "UserAgent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X10_6_5; en-us) ...", "IP": "70.111.66.11"     }   ] }
> db.Recipient.find({ "EmailLogID" : 32, "Opens" : { "$exists" : true } }).count(); 141762
LearnMongo.com Twitter @LearnMongo   @MongoQuestion       @JustinJenkins

More Related Content

What's hot

HTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implicationsHTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implications
Priyanka Aash
 
Cookies & Session
Cookies & SessionCookies & Session
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NETShingalaKrupa
 
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...Frédéric Harper
 
Sessions and cookies
Sessions and cookiesSessions and cookies
Sessions and cookies
www.netgains.org
 
برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...
برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...
برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...
Abdulrazak Zakieh
 
MongoMapper lightning talk
MongoMapper lightning talkMongoMapper lightning talk
MongoMapper lightning talk
Kerry Buckley
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessionsUdaAs PaNchi
 
Bitcoin
BitcoinBitcoin
Distributed Identities with OpenID
Distributed Identities with OpenIDDistributed Identities with OpenID
Distributed Identities with OpenID
Bastian Hofmann
 
Windows Azure Storage
Windows Azure StorageWindows Azure Storage
Windows Azure Storage
goodfriday
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
Kamal Acharya
 
Sso every where
Sso every whereSso every where
Sso every where
Paul Seiler
 

What's hot (13)

HTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implicationsHTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implications
 
Cookies & Session
Cookies & SessionCookies & Session
Cookies & Session
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NET
 
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...Prairie Dev Con West -  2012-03-14 - Webmatrix, see what the matrix can do fo...
Prairie Dev Con West - 2012-03-14 - Webmatrix, see what the matrix can do fo...
 
Sessions and cookies
Sessions and cookiesSessions and cookies
Sessions and cookies
 
برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...
برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...
برنامج محادثة باستخدام الاستدعاء العكسي في استدعاء الطرق البعيدة بلغة الجافا ...
 
MongoMapper lightning talk
MongoMapper lightning talkMongoMapper lightning talk
MongoMapper lightning talk
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Distributed Identities with OpenID
Distributed Identities with OpenIDDistributed Identities with OpenID
Distributed Identities with OpenID
 
Windows Azure Storage
Windows Azure StorageWindows Azure Storage
Windows Azure Storage
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
 
Sso every where
Sso every whereSso every where
Sso every where
 

Similar to Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log millions of e-mails too.)

Building search app with ElasticSearch
Building search app with ElasticSearchBuilding search app with ElasticSearch
Building search app with ElasticSearch
Lukas Vlcek
 
Google Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialGoogle Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocial
Patrick Chanezon
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
Schema design short
Schema design shortSchema design short
Schema design shortMongoDB
 
Lessons Learned - Building YDN
Lessons Learned - Building YDNLessons Learned - Building YDN
Lessons Learned - Building YDN
Dan Theurer
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
Anatoly Sharifulin
 
Sps mad2019 es el momento, empieza a desarrollar para microsoft teams
Sps mad2019   es el momento, empieza a desarrollar para microsoft teams Sps mad2019   es el momento, empieza a desarrollar para microsoft teams
Sps mad2019 es el momento, empieza a desarrollar para microsoft teams
Ruben Ramos
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
jemond
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScript
Mark Casias
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
MongoDB
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
Jaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social WebJaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social Web
Patrick Chanezon
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
MongoDB
 
Presentasi Kelompok 25 PW A+B
Presentasi Kelompok 25 PW A+BPresentasi Kelompok 25 PW A+B
Presentasi Kelompok 25 PW A+B
Hapsoro Permana
 
Tugas pw [kelompok 25]
Tugas pw [kelompok 25]Tugas pw [kelompok 25]
Tugas pw [kelompok 25]
guest0ad6a0
 
How we build Vox
How we build VoxHow we build Vox
How we build Vox
Tatsuhiko Miyagawa
 
Konsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman webKonsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman web
Ahmad Faizar
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQueryDoncho Minkov
 

Similar to Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log millions of e-mails too.) (20)

Building search app with ElasticSearch
Building search app with ElasticSearchBuilding search app with ElasticSearch
Building search app with ElasticSearch
 
Google Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocialGoogle Devfest Singapore - OpenSocial
Google Devfest Singapore - OpenSocial
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
Schema design short
Schema design shortSchema design short
Schema design short
 
Lessons Learned - Building YDN
Lessons Learned - Building YDNLessons Learned - Building YDN
Lessons Learned - Building YDN
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
Sps mad2019 es el momento, empieza a desarrollar para microsoft teams
Sps mad2019   es el momento, empieza a desarrollar para microsoft teams Sps mad2019   es el momento, empieza a desarrollar para microsoft teams
Sps mad2019 es el momento, empieza a desarrollar para microsoft teams
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScript
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Jaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social WebJaoo - Open Social A Standard For The Social Web
Jaoo - Open Social A Standard For The Social Web
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Presentasi Kelompok 25 PW A+B
Presentasi Kelompok 25 PW A+BPresentasi Kelompok 25 PW A+B
Presentasi Kelompok 25 PW A+B
 
Tugas pw [kelompok 25]
Tugas pw [kelompok 25]Tugas pw [kelompok 25]
Tugas pw [kelompok 25]
 
How we build Vox
How we build VoxHow we build Vox
How we build Vox
 
Konsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman webKonsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman web
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
 
Client-Server
Client-ServerClient-Server
Client-Server
 

Recently uploaded

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

Beyond Logging: Using MongoDB to Power a Private Social Network (Oh, and log millions of e-mails too.)

  • 1. Building a Private Social Network with MongoDB Justin Jenkins@LearnMongo
  • 2. Learn Mongo (.com that is) Twitter: @LearnMongo MongoDB resources aimed at not scaring off the beginner.
  • 3. Saddleback Church 21,000+ per weekend @ 10 locations.4,000 online. 4,300 “small groups” 20k – 32k people ~1 million user records 3.2 million e-mails a week Service trips to ~180 countries Food bank serving Orange County
  • 5. Project Goals Provide a private way for groups to interact and share online. Tie into other social networks but keep group data private. Provide groups with video & audio resources for growth. Create a simple & fast user experience.
  • 6. MongoDB SQL Server Solid, durable Years of use Very easy to query Uh Ohs Not optimized for the web Can be complex to scale Stringent schema Flexible schema Fairly easy to scale Optimized for read / inserts Uh Ohs New, little past use Can be harder to query Different data format
  • 7. Playing nice with SQL Server
  • 8. Playing nice with SQL Server Keep users accounts in SQL Use the same user id’s in both SQL and MongoDB. Store app specific user data in MongoDB. Keep group data and hierarchy in SQL Extract group data from SQL when any user of the group logs in, compare. Push any changes back to SQL in the background.
  • 10. The Problems MongoDB Solved Flexible schema design Each feed item can have totally different attributes. New features can be added quickly. Reduces impact on production SQL Server Focus server resources on internal staff. BSON to JSON Ideal for a highly AJAX / JavaScript site.
  • 12.
  • 13. The Feed The main feature of the site is “the feed” where the group can interact and share discussions, prayers, videos, etc. We need something very flexible … Discussions Videos Events Meetings Prayers Web Links Pictures
  • 14. Schema Design Flexible Schema Less clutter. Cleaner, leaner storage. Simpler queries. JOINs largely unneeded. BSON Format Converts into JSON with very little effort to make JavaScript / AJAX centric apps happy. Move from the client to the database, back to the client easily.
  • 15. { "_id" : "4d19fb939ac0900274000005", "_t" : "Discussion", "created" : "Tue, 28 Dec 2010 07:00:35 GMT", "GroupID" : 129242, "eIndividualID" : "22872F9", "firstName" : "Bill", "lastName" : "Finch", "discussionBody" : "I've been not feeling well lately, I hope it's nothing major.", "comments": [ { "_id" : "4d19fe329ac090027400000a", "eIndividualID" : "FFE4251", "created" : "2010-12-28T15:11:46.6760000Z", "firstName" : "Robin", "lastName" : "Tally", "commentText" : "I hope that everything is OK, whatever it is!" }, { "_id" : "4d1df3b29ac0900d64000003", ... } ] }
  • 17. using System; using System.Collections.Generic; using System.Linq; using System.Web; using Newtonsoft.Json; using MySmallGroup.Helpers.JsonConverters; namespace MySmallGroup.Models { public abstract class Feed : IFeed, IUserCreatable { [JsonConverter(typeof(MongoOidConverter))] public MongoDB.Oid Id { get; set; } public DateTime created { get; set; } public intGroupID { get; set; } public string eIndividualID { get; set; } public string firstName { get; set; } public string lastName { get; set; } public abstract string shortDescription { get; } public intcommentCount { get; set; } public IList<comment> comments { get; set; } public abstract void ReceivedJsonEncode(); public Feed Get() { return this; } } public interface IFeed : IUserCreatable { MongoDB.Oid Id { get; set; } intGroupID { get; set; } string eIndividualID { get; set; } string firstName { get; set; } string lastName { get; set; } string shortDescription { get; } intcommentCount { get; set; } IList<comment> comments { get; set; } void ReceivedJsonEncode(); Feed Get(); } }
  • 18. using System; using System.Collections.Generic; using System.Linq; using System.Web; using MySmallGroup.Helpers.ExtensionMethods; namespace MySmallGroup.Models { public class Discussion : Feed { public string discussionBody { get; set;} public Discussion() { this.commentCount = new int(); this.comments = new List<comment>(); this.created = DateTime.Now; } public override void ReceivedJsonEncode() { discussionBody = discussionBody.ReceivedJsonEncode(); } public override string shortDescription { get { return discussionBody; } } } }
  • 19. Live Chat & Video
  • 20.
  • 21. Live Chat & Live Video { "_id": "4cd261549ac0900c24000006", "senderEIndividualID": "1B0D6E8", "senderFirstName": "Justin", "senderLastName": "Jenkins", "sendDate": "Thu, 04 Nov 2010 00:31:32 GMT", "groupID": 119420, "message": "way faster then devtho" } { "_id": "4cd261a69ac0900c2400000a", "senderEIndividualID": "B656641", "senderFirstName": "Steve", "senderLastName": "Chen", "sendDate": "Thu, 04 Nov 2010 00:32:54 GMT", "groupID": 119420, "message": "oh" } { "_id": "4cd2621b9ac0900c2400001f", "senderEIndividualID": "1B0D6E8", "senderFirstName": "Justin", "senderLastName": "Jenkins", "sendDate": "Thu, 04 Nov 2010 00:34:51 GMT", "groupID": 119420, "message": "I think it&#39;s the facebook pic reload voodoo Jeff made" }
  • 23. User Settings { "eIndividualID": "A0BE87A", "_id": "4cd332389ac0900c2400001c", "ChatTimestamps": false, "GroupSettings": [ { "GroupId": 119420, "FeedNotificationEmail": false, "CommentNotificationEmail": false }, { "GroupId": 128834, "FeedNotificationEmail": true, "CommentNotificationEmail": false }, { "GroupId": 125680, "FeedNotificationEmail": true, "CommentNotificationEmail": true } ] }
  • 25. E-mail Tracking (the boring stuff.) Emails Sent 350,000 normal e-mails sent a week. 460,000 daily subscription e-mails sent a day. Tracking Needs Track each e-mail open, per individual. Date User Agent IP If a user opens an e-mail more than once, don’t double count but still track. Deduce how quickly users open an e-mail and how many don’t open the e-mail at all.
  • 26. Email Tracking { "EmailLogID": 14, "EmailLogDocumentID": "4d12a55e00ae2611f8000002", "EIndividualID": “ZZZZZZZ", "Email": "jxxx@zzzzzzzzz.com", "SendDate": "Wed, 22 Dec 2010 17:26:54 GMT", "_id": "4d12a56a18bee80a7c00243d", "Opens": [ { "OpenDate": "2010-12-23T01:59:45", "UserAgent": "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1like Mac OS X; en-us) ...", "IP": "72.111.250.111" }, { "OpenDate": "2010-12-23T16:22:19", "UserAgent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X10_6_5; en-us) ...", "IP": "70.111.66.11" } ] }
  • 27. > db.Recipient.find({ "EmailLogID" : 32, "Opens" : { "$exists" : true } }).count(); 141762
  • 28. LearnMongo.com Twitter @LearnMongo @MongoQuestion @JustinJenkins