Materialised view options
This page is part of the documentation for Orleans.Lattice 9.9.0 (release line 9.9), built 2026-10-04. It is also published as markdown, with every table and list, at materialised-view-options.md, and llms.txt lists every page.Part of Configuration.
Materialised views are configured per view name on a separate options type,
LatticeViewOptions, not on LatticeOptions. Set a per-view override with
ConfigureLatticeView(viewName, ...). There is no no-name overload: each view
resolves its options by its view name, so a default for every view goes through
the standard options API as siloBuilder.Services.ConfigureAll<LatticeViewOptions>(...)
(a plain Configure<LatticeViewOptions>(...) reaches only the unnamed instance):
siloBuilder.ConfigureLatticeView("adults", options =>
{
options.BatchSize = 512;
options.CoalesceWindow = TimeSpan.FromMilliseconds(100);
});
| Option | Default | Meaning |
|---|---|---|
BatchSize |
256 | Maximum WAL entries read from each source partition per drain pass. Must be positive. |
CoalesceWindow |
50 ms | Period of the background drain timer. Must be greater than zero and at most 0xFFFFFFFE milliseconds (about 49.7 days), the longest period a grain timer accepts. |
SourceIdentityBackstopInterval |
30 s | Safety-net interval after which the maintainer re-resolves its source tree's physical identity from the registry when no alias-change notification has arrived. In steady state the source binding is event-driven, so this backstop only covers a missed push. Must be greater than zero. |
AggregationFanout |
1 | Aggregation views only: shards each group's accumulator into this many sub-accumulators hashed on the source key, merged at read. Must be at least 1. |
AggregationMaxGroupEntries |
0 | Aggregation views only: when greater than zero, bounds each Min / Max / SetUnion group shard (approximate mode). 0 keeps every group exact. Must not be negative. |
MaxStagedTransactions |
1024 | Maximum in-flight atomic-write transactions buffered before the backstop forces a rebuild. Must be at least 1. |
MaxStagedBytes |
64 MiB | Maximum buffered prepared-entry payload before the backstop forces a rebuild. Must be at least 1. |
ReadHandleCacheTtl |
1 s | How long an ILatticeView handle caches the resolved live view tree id. Bounds the post-swap read-staleness window. Must be greater than zero. |
OldGenerationReclaimGrace |
5 s | How long a swapped-out view tree is retained before reclamation. Must exceed ReadHandleCacheTtl. |
CrossTreeReadinessTimeout |
5 s | Cross-tree atomic visibility only: how long a completed cross-tree batch waits for every present participant view before degrading to per-tree atomicity. Must be greater than zero. |
ReplicationMode |
DeriveLocally |
How the view tree is made available across clusters. ShipView requires the replication package. |
ShipViewProducerClusterId |
null |
Required only when ShipView replicates both source and view trees. The stable, case-sensitive replication cluster id of the single producer. When set it must be non-empty and ReplicationMode must be ShipView (enforced by the options validator); the replication topology guards also reject a value on a view whose source tree is not replicated. |
MaxLagBudget |
0 | Maximum committed-but-unapplied source entries before the view is force-evicted (WAL unpinned and rebuilt). 0 disables eviction. Must not be negative. |
LagEvictionCooldown |
30 s | Minimum interval between two lag-budget evictions of the same view. Has no effect when MaxLagBudget is 0. |
ObeySourceBackpressure |
true |
Whether the maintainer throttles its own drain when the source tree's WAL is under saturation back-pressure (smaller batch + deferred ticks). The maintainer reads the signal under the source tree id the view was declared with, while the signal is sampled under the id of the write-ahead log the source's writes land in, so on an aliased source tree (after a resize, a shadow-cutover restore, a schema remediation or an operator-set alias) it never sees back-pressure and drains at full rate (see Resolution and scope). Set to false to always drain at full rate. |
ThrottledBatchRatio |
0.5 | Fraction of BatchSize drained per pass while the source is Throttled. Must be within [0, 1] (enforced by the options validator); the effective batch is clamped to [1, BatchSize]. |
ThrottledPauseMs |
50 | Milliseconds background drain ticks are skipped after a pass that saw a Throttled source. <= 0 disables the deferral. |
SaturatedBatchSize |
16 | Drip-feed batch drained per pass while the source is Saturated. Must be at least 1 (enforced by the options validator); the effective batch is clamped to BatchSize. |
SaturatedPauseMs |
500 | Milliseconds background drain ticks are skipped after a pass that saw a Saturated source. <= 0 disables the deferral. |
HistoryHybridFullValueWindow |
5 minutes | Durable history views under HistoryRetentionMode.Hybrid only: the maximum apply-time age of a revision for which full LWW value bytes are kept; an older revision (drained from a backlog or a catch-up replay) is shaped to metadata only. A non-positive value degrades hybrid to metadata-only. See History views. |
See Materialised views for the full behaviour of each
option, including what registrations a view needs (AddLattice +
AddLatticeViews, the latter folding in AddWalCursorRegistry).