Datamart replication
Stream every ingested change to your own cloud: a message queue, or a data warehouse.
Your goal
Mirror the data the platform ingests into your own cloud, continuously, so your systems can react to changes without polling the API.
Expected outcome
An active replication delivering one message per update or delete operation, for the object types you selected.
The destination families
A replication has a type, and the type decides both where the data goes and the shape it arrives in.
Message queues
Google Pub/Sub, Microsoft Azure Event Hubs (Alpha)
One message per operation, straight to the topic.
This page.
Data warehouses
Google BigQuery, Snowflake
Files written to a cloud storage bucket, read into log and state tables.
The rest of this page describes the replication object itself, which both families share, and the message format of the message-queue family.
What is replicated
Replication mirrors the update and delete operations on your datamart for these objects:
UserPointUserAgent- for datamarts with auser_point_system_versionbeforev202205UserDevicePoint,UserDeviceTechnicalId- forv202205UserActivityUserSegmentUserProfileUserAccountUserEmailUser computed field, and user ML function values
Parent UserPoint, when UserPoints merge
The exact list depends on the family: a warehouse replication carries user events rather than the UserPoint and parent-UserPoint operations. See Data warehouse export.
Create a replication
Versions
Version 1 (legacy)
JSON
Google Pub/Sub, Microsoft Azure Event Hubs
Version 2
Avro binary
Google Pub/Sub
Any new Google Pub/Sub replication is created in Version 2.
You cannot upgrade a replication from Version 1 to Version 2.
The legacy JSON format was designed for a streaming architecture - Dataflow, Databricks - and has limitations with tools that need a schema, such as BigQuery. Version 2 introduces a schema to make integration easier.
The message format
This is the format of a message queue replication. A warehouse replication writes Avro records instead, described in Data warehouse export.
Operations are converted to a standardised shape:
ts
UNIX timestamp in ms
The mutation date.
All
doc_type
Enumeration
The object type: UserActivity, UserProfile, UserSegment, UserAgent, UserAccount, UserEmail, UserPoint, UserPointParent, UserComputedField, or MlFunction.
All
ctx_id
UUID
The UserPoint ID.
Version 2
doc_id
String
The object's unique ID. The format varies per doc_type.
All
op
String
UPDATE or DELETE.
All
value
JSON object
The object value. The format varies per doc_type.
All
Messages carry metadata to help you filter the topic - attributes in Pub/Sub, properties in Event Hubs - with the key doc_type holding the message's document type.
Identifiers and values per object type
doc_type
doc_id
value
UserPoint
{{user_point_id}}
Empty - the ID is already in doc_id.
UserAgent
{{user_point_id}}:{{vector_id}}
Browser and device info.
UserDevicePoint
{{user_point_id}}:{{user_device_point_id}}
Browser and device info.
UserDeviceTechnicalId
{{user_point_id}}:{{user_device_point_id}}:{{user_device_technical_id}}
Empty.
UserActivity
{{user_point_id}}:{{user_activity_id}}
The detailed activity.
UserSegment
{{user_point_id}}:{{segment_id}}
Segment info.
UserProfile
{{user_point_id}}:{{compartment_id}}:{{user_account_id}}
The detailed profile.
UserAccount
{{user_point_id}}:{{compartment_id}}:{{user_account_id}}
Empty.
UserEmail
{{user_point_id}}:{{email_hash}}
The user's email hash.
UserPointParent
The ID of the UserPoint merged into the oldest one - the one kept.
A message stating <current_user_point_id> merged with <the_kept_user_point_id>.
UserComputedField
{{user_point_id}}:{{plugin_instance_id}}
The computed field value.
MlFunction
{{user_point_id}}:{{ml_function_id}}:{{field_type_name}}
The ML function value.
Replication status
ACTIVE
All data processed by your datamart is replicated to your external solution.
PAUSED
No data is replicated.
ERROR
The system can no longer replicate messages. Check your external solution - expired instance, invalid credentials. If nothing is wrong there, contact your Account Manager.
Initial synchronisation
An initial synchronisation replicates all existing documents selected in the replication and already stored in the platform into your cloud environment. It can be run for one or several ACTIVE replications, and not more than once a week.
Find the replication in the list.
Click the caret-down icon and select New Initial Synchronization.
Click the New Initial Synchronization button.
Select the replications to synchronise.
Click Execute Initial Synchronization(s).
Every selected replication receives a set of UPDATE operations representing all existing elements - every UserProfile, for example.
Verify
The replication status is ACTIVE.
Messages arrive in the topic for the object types you selected, and only those.
doc_typemetadata is present, so your consumers can filter.Your consumer handles
UserPointParentmessages, so merges are reflected on your side.After an initial synchronisation, the message count is in the order of magnitude you expected.
Related pages
Last updated
Was this helpful?