The slides from my presentation at the Sitecore User Group Conference in The Netherlands on June 12th, 2015.
Demo source code is available at https://github.com/ParTech/SugCon2015
3. Prerequisites
• Install MongoDB
• Teach yourself some MongoDB!
http://docs.mongodb.org/manual/
• Get RoboMongo (it’s free!):
http://robomongo.org/
• Get the RoboMongo UUIDHelper:
https://github.com/mongodb/mongo-csharp-driver/blob/master/uuidhelpers.js
Sitecore User Group Conference 2015 3
4. Extending the data model
• Contacts
• Facets / Elements
• Manipulating the Contact object
Sitecore User Group Conference 2015 4
5. xDB Session State
• Private vs Shared
• InProc vs OutProc
• Contact data is loaded into a SessionContext (shared session)
• Manipulation is done in the SessionContext (shared session)
• SessionContext is flushed to MongoDB on session end
• Working directly on MongoDB is not adviced
Sitecore User Group Conference 2015 5
7. Sitecore User Group Conference 2015 7
User visits the site
Load contact from
MongoDB
Contact exists in
shared session?
Load contact from
shared session
Store contact in
shared session
false
8. Loading & saving data (during a request)
• Anonymous Contact
• Load Contact into shared session during a request
Sitecore.Analytics.Tracker.Current
.Session.Identify(uid);
• Saving occurs in session
• Session is flushed to MongoDB
Sitecore User Group Conference 2015 8
9. Loading & saving data (e.g. during import)
• Tracker.Current is null
• Load Contact directly from MongoDB (no shared session, readonly)
• Load Contact from shared session or from MongoDB into shared
session (TryLoadContact)
Sitecore User Group Conference 2015 9
10. Tips
• Start with a POC
• Create extension methods & abstractions
• Reflector is your friend
• Not discussed, but important when working with xDB:
Contact merging, Analytics index, Processing framework
• Do not underestimate the complexity
• Use SOLR for your Analytics index
Sitecore User Group Conference 2015 10
11. Time for questions
• Follow me: @BrruuD
• Mail me: ruud@partechit.nl
• Skype me: brruud
• Read my blog: http://www.partechit.nl/blog
• Demo code: https://github.com/ParTech/SugCon2015
*pssst* … Interested in indie game development? Follow @rumargaming
Sitecore User Group Conference 2015 11