Saturday, November 9, 2019

Sitecore XC 9.2 - Customer data flow.

It's a very important part to understand how and were Sitecore XC stores the customer data.

Here is the high-level flow -

Step 1 -

Register a new customer in Sitecore XC.



Step 2

We can see the data in Sitecore authoring --> Business tools --> customer data section


Step 3

As per the Sitecore documentation for the customer registration data here, they have mentioned that the new registered customer data will be stored in core database.


you can run the below script to see all tables in core and web database for the customer data reference.

Declare @SearchStr nvarchar(100)

SET  @SearchStr='jitusonijk@gmail.com' BEGIN

CREATE TABLE #Results3 (ColumnName nvarchar(370), ColumnValue nvarchar(3630))

SET NOCOUNT ON

DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128),
 @SearchStr2 nvarchar(110)  SET  @TableName = ''    SET @SearchStr2 =
 QUOTENAME('%' + @SearchStr + '%','''')

WHILE @TableName IS NOT NULL    
BEGIN       
  SET @ColumnName = ''      
  SET @TableName =  (
    SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' +
    QUOTENAME(TABLE_NAME)) FROM INFORMATION_SCHEMA.TABLES 
    WHERE
    TABLE_TYPE = 'BASE TABLE'
    AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
    AND OBJECTPROPERTY(
      OBJECT_ID(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)),
        'IsMSShipped') = 0)

  WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)      
  BEGIN
    SET @ColumnName = (
      SELECT MIN(QUOTENAME(COLUMN_NAME))
      FROM INFORMATION_SCHEMA.COLUMNS
      WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
        AND TABLE_NAME = PARSENAME(@TableName, 1)
      AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
      AND QUOTENAME(COLUMN_NAME) > @ColumnName)
      IF @ColumnName IS NOT NULL            
      BEGIN
      INSERT INTO #Results3
      EXEC
      (
        'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + 
          ', 3630) FROM ' + @TableName + ' (NOLOCK) ' +
        ' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
      )             
      END       
    END     
  END


  SELECT ColumnName, ColumnValue FROM #Results3 END



Core database - Tables-

Table - [aspnet_Membership]

ApplicationId UserId Password PasswordFormat PasswordSalt MobilePIN Email LoweredEmail PasswordQuestion PasswordAnswer IsApproved IsLockedOut CreateDate LastLoginDate LastPasswordChangedDate LastLockoutDate FailedPasswordAttemptCount FailedPasswordAttemptWindowStart FailedPasswordAnswerAttemptCount FailedPasswordAnswerAttemptWindowStart Comment
D1A11AC5-63B0-40A7-9320-3C88981A590C 004A77C7-7751-423C-A21D-1A472015F4DE 7Ai3EHC83gQbeuVZQdnr6tOTBlk= 1 gFFL5GuWSj8B8nvZHRtu3g== NULL jitusonijk@gmail.com jitusonijk@gmail.com NULL NULL 1 0 2019-10-29 07:00:57.000 2019-10-29 07:00:58.910 2019-10-29 07:00:57.000 1754-01-01 00:00:00.000 0 1754-01-01 00:00:00.000 0 1754-01-01 00:00:00.000

Table [dbo].[aspnet_Users]

ApplicationId UserId UserName LoweredUserName MobileAlias IsAnonymous LastActivityDate
D1A11AC5-63B0-40A7-9320-3C88981A590C 004A77C7-7751-423C-A21D-1A472015F4DE Storefront\jitusonijk@gmail.com storefront\jitusonijk@gmail.com NULL 0 2019-11-10 06:51:30.047

Table [dbo].[EventQueue]  

Id EventType InstanceType InstanceData InstanceName RaiseLocally RaiseGlobally UserName Stamp Created

648A35AF-19C0-4C76-8FED-72D3EEE35CBD Sitecore.Eventing.Remote.UserUpdatedRemoteEvent, Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null Sitecore.Eventing.Remote.UserUpdatedRemoteEvent, Sitecore.Kernel, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null {"UserName":"Storefront\\jitusonijk@gmail.com"} sitecore-SC921sc.dev.local 0 1 Storefront\jitusonijk@gmail.com 0x0000000000047CA8 2019-11-10 06:51:28.600


I didn't see any reference in the Web database.

The minion servie should pick the update from the database and update these data in Solr CustomersScope Index.


For the initial registration, You wouldn't see data in  CustomersScope Index


and finally, how customer manages the orders. A newly registered customer will be login and the CD role authenticates the customer against the ASP.NET membership tables in the core database.

Sitecore flow -




 I'm excited to see data in Solr and what all are the OOTB option to customize the data and integration with third party customer data managment systme like Gigya.

Desc


No comments:

Post a Comment