managing your user data with sitecore xdb

12
Managing your user data with xDB Ruud van Falier ParTech IT [email protected] / @BrruuD Sitecore User Group Conference 2015 1

Upload: ruud-van-falier

Post on 28-Jul-2015

286 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 1

Managing your user data with xDB

Ruud van Falier

ParTech IT

[email protected] /

@BrruuD

Page 2: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 2

Topics

• Prerequisites

• Extending the data model

• xDB Session State

• Loading & saving data

Page 3: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 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

Page 4: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 4

Extending the data model

• Contacts

• Facets / Elements

• Manipulating the Contact object

Page 5: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 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

Page 6: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 6

Page 7: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 7

User visits the site

Load contact from MongoDB

Contact exists inshared session?

Load contact fromshared session

Store contact inshared session

false

Page 8: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 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

Page 9: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 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)

Page 10: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 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

Page 11: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 11

Time for questions

• Follow me: @BrruuD

• Mail me: [email protected]

• 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

Page 12: Managing your user data with Sitecore xDB

Sitecore User Group Conference 2015 12

Thank you