Share via


ReadConsistencyStrategy Enum

  • java.lang.Object
    • java.lang.Enum
      • com.azure.cosmos.ReadConsistencyStrategy

public enum ReadConsistencyStrategy
extends Enum<ReadConsistencyStrategy>

Represents the read consistency strategies supported by the Azure Cosmos DB service.

The requested read consistency strategy can be chosen independent of the consistency level provisioned for the database account.

The ReadConsistencyStrategy setting will override whatever ConsistencyLevel is chosen in RequestOptions, CosmosClient or the default consistency level for an account unless ReadConsistencyStrategy `DEFAULT` is used.

NOTE: The ReadConsistencyStrategy is currently only working when using direct mode

Fields

DEFAULT

Use the default read behavior for the consistency level applied to the operation, the client or the account

EVENTUAL

Eventual Consistency guarantees that reads will return a subset of writes.

GLOBAL_STRONG

Will read the latest version - since replication with global strong consistency is synchronous this read consistency strategy ensures that the latest successfully written version across regions is returned.

LATEST_COMMITTED

Will read the latest committed version from the region in preferred order (which means the read region might have stale data) but this read strategy will return the latest committed version of that region

SESSION

Session Consistency guarantees monotonic reads (you never read old data, then new, then old again), monotonic writes (writes are ordered) and read your writes (your writes are immediately visible to your reads) within any single session.

Methods inherited from java.lang.Enum

Methods inherited from java.lang.Object

Methods

toString()

public String toString()

Returns

Overrides
java.lang.Enum.toString()

valueOf(String name)

public static ReadConsistencyStrategy valueOf(String name)

Parameters

name
String

Returns

values()

public static ReadConsistencyStrategy[] values()

Returns

Applies to