xConnect Client API read preferences

Version: 10.4

The xConnect Client API supports the ability to specify an explicit read preference option for any Get or data extraction operation:

Option

Description

Default

The default read preference. It means that whenever the EnableScalableReads setting is enabled, the read operations with the Default option are analyzed one-by-one and automatically routed to the Primary or Secondary node based on the preconfigured configurators in the service plugin ConfigureScalableReadsPlugin.

(For example, automatically route all the data extraction operations with Default options to the secondary replica.)

AllowStaleData

Defines the preference to read stale data. When AllowStaleData is specified, you accept some delay in data replication. Typically, there is no replication latency for SQL On-Prem, the replication latency between Primary and Secondary in SQL Azure is low, and this situation is rare.

AlwaysLatestData

Defines the preference to read the most actual data from the primary replica.

The following is an example to specify ReadPreference.AllowStaleData for the GetContactsAsync operation:

RequestResponse
Contact contact = await _client.GetContactAsync(contactId, new ContactExecutionOptions
{
    ReadPreference = ReadPreference.AllowStaleData
});

Do you have some feedback for us?

If you have suggestions for improving this article,