---
title: "Orleans.Lattice.Api.Data - Public API"
url: "https://nsta1.github.io/Orleans.Lattice/docs/lattice.api.abstractions/api/orleans-lattice-api-data.html"
source: "https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/docs/lattice.api.abstractions/api.md?plain=1#L971-L1214"
agent_spec: "https://nsta1.github.io/Orleans.Lattice/docs/agents/api/state.json"
package: "Orleans.Lattice.Api.Abstractions"
version: "10.5.0"
documents: "Orleans.Lattice 10.5.0 (release line 10.5)"
built: "2026-12-05"
all-pages: "https://nsta1.github.io/Orleans.Lattice/llms.txt"
bundle: "https://nsta1.github.io/Orleans.Lattice/docs/lattice.api.abstractions/llms-full.txt"
---
# `Orleans.Lattice.Api.Data`

Part of [Public API](../api.md).

Implemented by [`Orleans.Lattice.Api.Data`](../../lattice.api.data/README.md) and exposed remotely by [`Orleans.Lattice.Api.Data.Grpc`](../../lattice.api.data.grpc/README.md). 15 public types.

| Type | Kind | Summary |
|---|---|---|
| `ILatticeDataApi` | interface | Transport-agnostic read-write facade over a cluster's lattice data plane. |
| `DataApiTypeAliases` | static class | Centralised Orleans serialization alias constants for every `Orleans.Lattice.Api.Data` type that participates in the wire format. |
| `DataAtomicBatch` | sealed record | A single-tree atomic write batch: the key / value `Upserts` and the `DeleteKeys` to commit all-or-nothing on one tree, so no reader ever observes a partial application. |
| `DataEntry` | sealed record | A single key / value entry. |
| `DataEntryRejection` | sealed record | One entry a streamed write refused, as reported in `DataSetManyStreamBatch.Rejections`: where it was in the stream, its key, and why it was refused (`denied`, `schema` or `invalid`). A rejection never carries the value. |
| `DataRangeDeleteRequest` | sealed record | Request to delete every authorized key in a bounded half-open key range `[`StartInclusive`, `EndExclusive`)` on a single tree. |
| `DataRangeDeleteResult` | sealed record | Result of a `DataRangeDeleteRequest`: the tree the delete ran against and the total number of keys tombstoned across the whole range. |
| `DataRangePage` | sealed record | One page of a bounded range read: the key-ordered `Entries` and, when more entries remain beyond this page, a `ContinuationToken` to pass back on the next `DataRangeRequest` to resume. |
| `DataRangeRequest` | sealed record | Request for a single-page, bounded range read over a tree's entries in ascending key order. |
| `DataReadResult` | sealed record | Result of a point read. |
| `DataSetManyStreamBatch` | sealed record | The outcome of one batch of a streamed write (`SetManyStreamAsync`), reported as the batch completes: how many of its entries were written and which were refused. The entries a batch committed are durable once it is reported. |
| `DataSetManyStreamOptions` | sealed record | Shapes a streamed write through `SetManyStreamAsync`: how many entries each batch carries (default 256, at most 10,000) and the ordinal the stream's first entry is numbered with in the rejections it reports. |
| `DataSetManyStreamResult` | sealed record | The totals of a streamed write from `SetManyStreamAsync`: how many entries the stream carried, how many were written, how many were refused, and in how many batches. |
| `DataTreeBatch` | sealed record | One participating tree's slice of a cross-tree atomic write: the logical `TreeId` to write into, the key / value `Upserts`, and the `DeleteKeys` to commit atomically on that tree. |
| `LatticeDataCapabilities` | sealed record | The read-only result of a data-plane capability probe (`ProbeCapabilitiesAsync`): whether the current caller may write or delete in a tree, or at one key of it, evaluated through the same fail-closed access gate the real writes use but with no side effects. Every flag is default-deny; the probe is a UX affordance, not a security boundary. |

## `ILatticeDataApi`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/ILatticeDataApi.cs) (line 32).

`public interface ILatticeDataApi`

- `Task SetAsync(string treeId, string key, byte[] value, CancellationToken cancellationToken = default)`
- `Task<bool> DeleteAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task<DataRangeDeleteResult> DeleteRangeAsync(DataRangeDeleteRequest request, CancellationToken cancellationToken = default)`
- `Task SetManyAtomicAsync(string treeId, DataAtomicBatch batch, string operationId, CancellationToken cancellationToken = default)`
- `Task<CrossTreeAtomicWriteOutcome> SetManyAtomicCrossTreeAsync(IReadOnlyList<DataTreeBatch> batches, string operationId, CancellationToken cancellationToken = default)`
- `Task SetManyAsync(string treeId, IReadOnlyList<DataEntry> upserts, CancellationToken cancellationToken = default)`
- `Task<DataSetManyStreamResult> SetManyStreamAsync(string treeId, IAsyncEnumerable<DataEntry> upserts, IProgress<DataSetManyStreamBatch>? progress = null, DataSetManyStreamOptions? options = null, CancellationToken cancellationToken = default)`
- `Task<DataReadResult> GetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task<DataRangePage> ReadRangeAsync(DataRangeRequest request, CancellationToken cancellationToken = default)`
- `Task<LatticeDataCapabilities> ProbeCapabilitiesAsync(string treeId, string? key = null, CancellationToken cancellationToken = default)`
- `Task CounterIncrementAsync(string treeId, string key, string replicaId, long amount, CancellationToken cancellationToken = default)`
- `Task CounterDecrementAsync(string treeId, string key, string replicaId, long amount, CancellationToken cancellationToken = default)`
- `Task<long> CounterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task SetAddAsync(string treeId, string key, byte[] element, string replicaId, CancellationToken cancellationToken = default)`
- `Task SetRemoveAsync(string treeId, string key, byte[] element, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyList<byte[]>> SetGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task OrFlagEnableAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)`
- `Task OrFlagDisableAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task<bool> OrFlagGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task RwFlagEnableAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)`
- `Task RwFlagDisableAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)`
- `Task<bool> RwFlagGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task GCounterIncrementAsync(string treeId, string key, string replicaId, long amount, CancellationToken cancellationToken = default)`
- `Task<long> GCounterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task GSetAddAsync(string treeId, string key, byte[] element, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyList<byte[]>> GSetGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task RwSetAddAsync(string treeId, string key, byte[] element, string replicaId, CancellationToken cancellationToken = default)`
- `Task RwSetRemoveAsync(string treeId, string key, byte[] element, string replicaId, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyList<byte[]>> RwSetGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task VersionVectorTickAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyDictionary<string, string>> VersionVectorGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task RegisterSetAsync(string treeId, string key, string replicaId, byte[] value, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyList<byte[]>> RegisterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task MaxRegisterSetAsync(string treeId, string key, byte[] value, CancellationToken cancellationToken = default)`
- `Task<byte[]?> MaxRegisterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task MinRegisterSetAsync(string treeId, string key, byte[] value, CancellationToken cancellationToken = default)`
- `Task<byte[]?> MinRegisterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task SequenceInsertAtAsync(string treeId, string key, int index, string replicaId, byte[] value, CancellationToken cancellationToken = default)`
- `Task SequenceRemoveAtAsync(string treeId, string key, int index, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyList<byte[]>> SequenceGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`
- `Task MapSetAsync(string treeId, string key, string field, string replicaId, byte[] value, CancellationToken cancellationToken = default)`
- `Task MapRemoveAsync(string treeId, string key, string field, CancellationToken cancellationToken = default)`
- `Task<IReadOnlyDictionary<string, IReadOnlyList<byte[]>>> MapGetAsync(string treeId, string key, CancellationToken cancellationToken = default)`

## `DataApiTypeAliases`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataApiTypeAliases.cs) (line 16).

`public static class DataApiTypeAliases`

- `public const string DataEntry`
- `public const string DataAtomicBatch`
- `public const string DataTreeBatch`
- `public const string DataRangeRequest`
- `public const string DataRangePage`
- `public const string DataReadResult`
- `public const string DataRangeDeleteRequest`
- `public const string DataRangeDeleteResult`
- `public const string LatticeDataCapabilities`
- `public const string DataEntryRejection`
- `public const string DataSetManyStreamBatch`
- `public const string DataSetManyStreamResult`

## `DataAtomicBatch`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataAtomicBatch.cs) (line 19).

`public sealed record DataAtomicBatch`

- `public List<DataEntry> Upserts { get; init; }`
- `public List<string> DeleteKeys { get; init; }`

## `DataEntry`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataEntry.cs) (line 18).

`public sealed record DataEntry`

- `public required string Key { get; init; }`
- `public byte[] Value { get; init; }`
- `public LatticeMergeMode? MergeMode { get; init; }`
- `public bool Raw { get; init; }`
- `public bool Equals(DataEntry? other)`
- `public override int GetHashCode()`

## `DataEntryRejection`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataEntryRejection.cs) (line 11).

`public sealed record DataEntryRejection`

- `public const string DeniedCode`
- `public const string SchemaCode`
- `public const string InvalidCode`
- `public required long Ordinal { get; init; }`
- `public required string Key { get; init; }`
- `public required string Code { get; init; }`
- `public required string Reason { get; init; }`

## `DataRangeDeleteRequest`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataRangeDeleteRequest.cs) (line 20).

`public sealed record DataRangeDeleteRequest`

- `public required string TreeId { get; init; }`
- `public required string StartInclusive { get; init; }`
- `public required string EndExclusive { get; init; }`

## `DataRangeDeleteResult`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataRangeDeleteResult.cs) (line 15).

`public sealed record DataRangeDeleteResult`

- `public required string TreeId { get; init; }`
- `public required int DeletedCount { get; init; }`

## `DataRangePage`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataRangePage.cs) (line 12).

`public sealed record DataRangePage`

- `public required string TreeId { get; init; }`
- `public IReadOnlyList<DataEntry> Entries { get; init; }`
- `public string? ContinuationToken { get; init; }`
- `public LatticeRangeReadGateCoverage? GateCoverage { get; init; }`

## `DataRangeRequest`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataRangeRequest.cs) (line 19).

`public sealed record DataRangeRequest`

- `public required string TreeId { get; init; }`
- `public string? StartInclusive { get; init; }`
- `public string? EndExclusive { get; init; }`
- `public int PageSize { get; init; }`
- `public string? ContinuationToken { get; init; }`
- `public bool IncludeGateCoverage { get; init; }`

## `DataReadResult`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataReadResult.cs) (line 12).

`public sealed record DataReadResult`

- `public required string TreeId { get; init; }`
- `public required string Key { get; init; }`
- `public bool Found { get; init; }`
- `public byte[] Value { get; init; }`
- `public LatticeMergeMode? MergeMode { get; init; }`
- `public bool Raw { get; init; }`
- `public bool Equals(DataReadResult? other)`
- `public override int GetHashCode()`

## `DataSetManyStreamBatch`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataSetManyStreamBatch.cs) (line 11).

`public sealed record DataSetManyStreamBatch`

- `public required string TreeId { get; init; }`
- `public required long BatchIndex { get; init; }`
- `public required long FirstOrdinal { get; init; }`
- `public required int EntryCount { get; init; }`
- `public required int CommittedCount { get; init; }`
- `public IReadOnlyList<DataEntryRejection> Rejections { get; init; }`

## `DataSetManyStreamOptions`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataSetManyStreamOptions.cs) (line 8).

`public sealed record DataSetManyStreamOptions`

- `public const int DefaultBatchSize`
- `public const int MaxBatchSize`
- `public static DataSetManyStreamOptions Default { get; }`
- `public int BatchSize { get; init; }`
- `public long FirstOrdinal { get; init; }`
- `public void Validate()`

## `DataSetManyStreamResult`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataSetManyStreamResult.cs) (line 11).

`public sealed record DataSetManyStreamResult`

- `public required string TreeId { get; init; }`
- `public required long EntryCount { get; init; }`
- `public required long CommittedCount { get; init; }`
- `public required long RejectedCount { get; init; }`
- `public required long BatchCount { get; init; }`

## `DataTreeBatch`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/DataTreeBatch.cs) (line 19).

`public sealed record DataTreeBatch`

- `public required string TreeId { get; init; }`
- `public List<DataEntry> Upserts { get; init; }`
- `public List<string> DeleteKeys { get; init; }`

## `LatticeDataCapabilities`

[Source](https://github.com/NSTA1/Orleans.Lattice/blob/release/10.5/src/lattice.api.abstractions/Data/Model/LatticeDataCapabilities.cs) (line 27).

`public sealed record LatticeDataCapabilities`

- `public required string TreeId { get; init; }`
- `public string? Key { get; init; }`
- `public bool CanWrite { get; init; }`
- `public bool CanDelete { get; init; }`

Previous: [Orleans.Lattice.Api.State](orleans-lattice-api-state.md). Next: [Orleans.Lattice.Api.Auth](orleans-lattice-api-auth.md). Contents: [Public API](../api.md).
