SAP Customer Data Cloud Series – Part 4 – Schema
In SAP Customer Data Cloud overview series, we have already published three blogs named as SAP CDC overview, Console Overview and Site Administration. Now we are posting our fourth blog I.e. SAP Customer Data Cloud – Schema.
SAP Customer Data Cloud Schema is an integral part of our Customer Identity (RaaS) platform. Schema is a cloud hosted solution for storing all your user’s data. SAP CDC Schema is a structure which is used to store the data about users. SAP CDC schema can support up to 1000 additional custom fields beyond the default schema, and all these fields may be customized to validate user input as necessary. SAP CDC schema is divided two parts i.e. Account Store and Data Store.
Account Store is a cloud hosted database that store user’s data from various sources into single profile. User accounts are automatically created in the SAP CDC identity store after Registration or Social Login. Account store splits data into 5 different categories mentioned as below: –
- Profile: Profile object stores users’ key information like first name, last name, date of birth etc. It’s basically, combined data came from different social profiles and from site information. Profile part of schema has a standard set of fields therefore addition and deletion of fields or any other kind of update in field structure is not allowed.
- Identities: An Array of objects that represents the user’s social identities. Each identity object contains imported data from corresponding social networks link Facebook, LinkedIn etc.
- Subscriptions: Subscription object is used to pass information regarding a user’s subscription status to a specific newsletter or service.
- Custom Data: Custom data object contains up to 1000 fields. It contains user related data which is not a part of profile data. Custom data has very flexible and dynamic structure.
- System: System object contains data regarding creation of any user data or profile in the CDC system. It contains data provided by the platform regarding account creations, login times etc.
We can edit the SAP CDC schema using Schema editor tool available in SAP CDC console under RaaS functionalities. Schema Editor is very interactive tool which make schema update task quite easy which saves lots of time to update the schema structure and make it more efficient. Schema editor helps to enhance the Custom data Object by adding up to 1000 fields which is quite sufficient to store any kind of data. If we feel need to update the present schema of any site, we can do it very easily by using schema editor tool available in SAP CDC and these new changes will be reflecting immediately for use once we are done with the changes.
We can also use few APIs to edit the SAP CDC schema if users have necessary console permissions to use APIs. Some important API are following: –
Below are few screenshots for adding a new field in custom data object of schema:
- Schema editor tool comes under RaaS functionality.
- Click the Create Field button on the top-right of the editor.
- Once we click on “Create Field” button below, “Create field” popup window will get open. In this step, we need to choose whether we have to create a field in Account schema or in Data Store schema. Then, we need to define the type of field and field name.
- Once we click on Create in above screen, The below screen shows new field is available in the left hand panel of the screen and right side panel of the screen is used to configure the properties of the field. By clicking “Remove Data field” button we can also delete any custom field from the schema as well.
SAP CDC Data Store (DS) is a flexible, fully indexed cloud database with a dynamic schema, that is designed to store generic data objects. Its flexibility includes the ability to configure the way data is stored by setting the default behavior. Simple SQL-like queries are used when searching the DS. The DS service is delivered through a set of REST APIs.
The DS stores JSON data objects, including full support for embedded objects and arrays. Different objects may contain completely different data fields. Each object has a unique Object ID (OID), you may retrieve an object by specifying its OID. This value can be defined by your application and if there is no requirement around it then it can be set to “Auto” to have SAP CDC generate a value. Objects are grouped by type for easier look-up and logical separation. Object Types do not impose a schema, they are just for logical separation of the data. If the data that we are storing is directly linked to user, then we can also define a UID value to create the relation. Data Store JSON objects are limited to a maximum of 512K of data.
The following are the Object Data related API methods:
- ds.store – stores an object in the DS.
- ds.get – retrieves an object from the DS.
- ds.delete – deletes an object from the DS.
- ds.search – uses an SQL-like query to search and retrieve data from the DS.
- ds.setSchema – Allows specifying a schema for a data type in Data Store.
- ds.getSchema – Retrieves the schema of a specified data type in Data Store.
Data Store is mainly used to store Large data (Data too big to persist across the whole user journey. Or if it has the potential to grow.) and Non-Essential data (Unlike the “Accounts” objects that will be accessible through the session duration and is needed to provide a proper experience, this data can be fetched independently when needed). For example Transactional Data: Tracking history for an e-commerce website, Behavioral data : Tracking activities and behaviors of users i.e. watching videos on web etc.
That’s all about the overview of SAP CDC schema. Please share your comment, feedback, suggestion.
Thanks & Regards,
Hi Harnish Sharma ,
But we cant Find Communication and Preferences related data under schema?
e.g. isConsentGranted like flags or isSubscribed like flags for custom consent and subscriptions.
Which is the right place to get information of preferences? because Select * from accounts return some basic information about user profile. Not all.
Please correct me if I am wrong.
if there are multiple sites created with one CDC user ID, then is the schema created under this one CDC user ID is shared among all the sites?