Public API
This page documents Orleans.Lattice.Tenancy 10.5.0, in the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at api.md, and llms.txt lists every page.Orleans.Lattice.Tenancy adds tenant registry, access, quota, metering and residency services. The package guide explains the isolation model and operational limits; the declarations below are the concrete public contract, not a transport binding.
Registration and read/write boundaries
Call AddLatticeTenancy on the silo after AddLattice, membership and authorization. Registration checks those dependencies and fails immediately when one is missing. Repeated calls apply a supplied options delegate but do not duplicate the structural wiring. ConfigureLatticeTenancy configures only LatticeTenancyOptions; configure usage, observability and rate-limiter options through the service collection. See configuration.
ITenantRegistry is the durable definition-store seam. It reads and enumerates records and applies timestamped lifecycle, quota, region and access mutations. It is not a caller-facing authorization facade: applications that administer tenants on behalf of a user should use the TenantAdmin API. The store joins a caller-supplied mutation with existing state; transport replication of the serialized record is distinct from that local join.
TenantRecord carries the tenant definition and its stamped field/slot state; quota and placement values are not separate user trees. ITenantPolicyEngine exposes the current compiled policy. Residency, usage, rate and overage interfaces provide independent seams so a host can observe or replace one without treating the registry as a request-rate counter. Their exact read/write signatures appear below.
Public models and failure handling
TenantId and the core tenant-context seams are defined by the core library, not re-declared here. This package defines tenant status, region status, quota, placement, grant, usage and overage models. Concurrency failures distinguish registry, usage and overage write contention; do not retry an authorization denial as a concurrency conflict. The package guide describes retry behavior.
Use the read-only observability and usage interfaces for measurements. Their published values are sampled/convergent, not a globally synchronous reservation; see resource governance before interpreting a quota or rate setting as a strict multi-cluster ceiling.
Related
Public declaration reference
The following inventory includes directly declared public members and overloads, enum values, and record positional members. Inherited framework members and compiler-generated record equality helpers are not additional package operations. Each source link identifies the declaration that defines its signature.
Orleans.Lattice.Tenancy.CrossTenantGrant
Source (line 17).
public readonly record struct CrossTenantGrant
public string Grantee { get; init; }public TenantGranteeKind GranteeKind { get; init; }public string Scope { get; init; }public TenantGrantOperations Operations { get; init; }public TenantGrantState State { get; init; }public static CrossTenantGrant Create( string grantee, TenantGranteeKind granteeKind, string scope, TenantGrantOperations operations)public static CrossTenantGrant Create( string grantee, TenantGranteeKind granteeKind, string scope, TenantGrantOperations operations, TenantGrantState state)public string GrantId
Orleans.Lattice.Tenancy.ITenantObservabilityView
Source (line 20).
public interface ITenantObservabilityView
Task<TenantObservabilitySnapshot?> GetActiveTenantAsync(CancellationToken cancellationToken = default)IAsyncEnumerable<TenantObservabilitySnapshot> ListAsync( TenantObservabilityScope scope, CancellationToken cancellationToken = default)
Orleans.Lattice.Tenancy.ITenantOverageBilling
Source (line 16).
public interface ITenantOverageBilling
Task<TenantOverageSample> GetMeteredOverageAsync(TenantId tenant, CancellationToken cancellationToken = default)IAsyncEnumerable<TenantMeteredOverage> ListMeteredOverageAsync(CancellationToken cancellationToken = default)
Orleans.Lattice.Tenancy.ITenantPolicyEngine
Source (line 25).
public interface ITenantPolicyEngine
long CurrentEpoch { get; }IReadOnlyList<TenantId> ResolveAllowedTenants(string subjectId)TenantAccessDecision ValidateActiveTenant(string subjectId, TenantId activeTenant)IReadOnlyList<TenantId> ResolveAllowedTenants(string subjectId, IReadOnlyCollection<string> groupIds)TenantAccessDecision ValidateActiveTenant(string subjectId, IReadOnlyCollection<string> groupIds, TenantId activeTenant)TenantAccessDecision ResolveCrossTenantGrant( TenantId sourceTenant, TenantId targetTenant, string scope, TenantGrantOperations operation)
Orleans.Lattice.Tenancy.ITenantRateLimiter
Source (line 35).
public interface ITenantRateLimiter
bool TryAcquire(TenantId tenant)
Orleans.Lattice.Tenancy.ITenantRegionStatusChangeListener
Source (line 18).
public interface ITenantRegionStatusChangeListener
Task OnRegionStatusChangedAsync(TenantRegionStatusChange change, CancellationToken cancellationToken)
Orleans.Lattice.Tenancy.ITenantRegistry
Source (line 17).
public interface ITenantRegistry
Task<TenantRecord?> GetAsync(TenantId tenant, CancellationToken cancellationToken = default)Task<bool> ExistsAsync(TenantId tenant, CancellationToken cancellationToken = default)IAsyncEnumerable<TenantRecord> ListAsync(CancellationToken cancellationToken = default)Task<TenantRecord> PutAsync(TenantRecord record, CancellationToken cancellationToken = default)Task<TenantRecord> CreateAsync(TenantRecord record, CancellationToken cancellationToken = default)Task<bool> DeleteAsync(TenantId tenant, CancellationToken cancellationToken = default)
Orleans.Lattice.Tenancy.ITenantResidencyResolver
Source (line 18).
public interface ITenantResidencyResolver
bool IsActive { get; }bool IsOnlineInServingRegion(TenantId tenant)
Orleans.Lattice.Tenancy.ITenantUsageReader
Source (line 27).
public interface ITenantUsageReader
TenantEnforcementScope ResolveScope(TenantId tenant)Task<TenantUsageReading?> ReadAsync(TenantId tenant, CancellationToken cancellationToken = default)
Orleans.Lattice.Tenancy.LatticeTenancyOptions
Source (line 12).
public sealed class LatticeTenancyOptions
public HistoryRetentionMode HistoryRetentionMode { get; set; }public TimeSpan? HistoryRetentionWindow { get; set; }public bool EnableDurableHistoryView { get; set; }public bool SeedDefaultTenant { get; set; }public TimeSpan PolicySnapshotLeaseDuration { get; set; }public TimeSpan FalseDeathReinvalidationInterval { get; set; }public TimeSpan? FalseDeathHorizon { get; set; }public bool DelegatedAccessAdministrationEnabled { get; set; }
Orleans.Lattice.Tenancy.LatticeTenancyServiceCollectionExtensions
Source (line 18).
public static class LatticeTenancyServiceCollectionExtensions
public static ISiloBuilder AddLatticeTenancy( this ISiloBuilder builder, Action<LatticeTenancyOptions>? configure = null)public static ISiloBuilder ConfigureLatticeTenancy( this ISiloBuilder builder, Action<LatticeTenancyOptions> configure)
Orleans.Lattice.Tenancy.LatticeTenantMetrics
Source (line 34).
public static class LatticeTenantMetrics
public const string MeterNamepublic const string TagTenantpublic const string TenantsNamepublic const string UsageBytesNamepublic const string UsageKeysNamepublic const string UsageMemoryBytesNamepublic const string UsageTreesNamepublic const string QuotaBytesNamepublic const string QuotaKeysNamepublic const string QuotaMemoryBytesNamepublic const string QuotaTreesNamepublic const string QuotaBurstPercentNamepublic const string OverageBytesNamepublic const string OverageKeysNamepublic const string OverageMemoryBytesNamepublic const string OverageTreesNamepublic static readonly Meter Meter
Orleans.Lattice.Tenancy.LatticeTenantRateLimiterOptions
Source (line 21).
public sealed class LatticeTenantRateLimiterOptions
public static readonly TimeSpan DefaultLeaseIntervalpublic static readonly TimeSpan DefaultLeaseCycleTimeoutpublic static readonly TimeSpan DefaultMaxLeaseBackoffpublic static readonly TimeSpan DefaultRateSnapshotTtlpublic TimeSpan LeaseInterval { get; set; }public TimeSpan LeaseCycleTimeout { get; set; }public TimeSpan MaxLeaseBackoff { get; set; }public TimeSpan RateSnapshotTtl { get; set; }public TenantRateApportionmentStrategy Apportionment { get; set; }public double DemandReserveFraction { get; set; }
Orleans.Lattice.Tenancy.LocalUsageSample
Source (line 18).
public readonly record struct LocalUsageSample
public long Bytes { get; init; }public long Keys { get; init; }public long MemoryBytes { get; init; }public long TreeCount { get; init; }public static LocalUsageSample Emptypublic bool IsEmptypublic LocalUsageSample Add(LocalUsageSample other)public static LocalUsageSample RollUp(IReadOnlyCollection<TreeUsageSample> trees)
Orleans.Lattice.Tenancy.TenantAccessCaps
Source (line 23).
public static class TenantAccessCaps
public const string GroupsDimensionpublic const string MembershipEdgesDimensionpublic const string MemberSubjectsDimensionpublic const string TenantRulesDimensionpublic static void AdmitAddition(TenantId tenant, string treeId, string dimension, long currentCount, long cap)
Orleans.Lattice.Tenancy.TenantAccessDecision
Source (line 16).
public readonly struct TenantAccessDecision
public bool Allowed { get; }public string? Reason { get; }public static TenantAccessDecision Allow()public static TenantAccessDecision Deny(string reason)
Orleans.Lattice.Tenancy.TenantEnforcementScope
Source (line 13).
public enum TenantEnforcementScope
GlobalConverged = 0PerCluster = 1
Orleans.Lattice.Tenancy.TenantGrantLifecycle
Source (line 38).
public static class TenantGrantLifecycle
public static bool Authorizes(TenantGrantState state)public static bool IsTerminal(TenantGrantState state)public static bool IsLegalTransition(TenantGrantState from, TenantGrantState to)public static bool IsLegalOffer(TenantGrantState current)public static TenantGrantState Join(TenantGrantState left, TenantGrantState right)
Orleans.Lattice.Tenancy.TenantGrantOperations
Source (line 8).
public enum TenantGrantOperations
None = 0Read = 1Write = 2ReadWrite = Read | Write
Orleans.Lattice.Tenancy.TenantGrantSlot
Source (line 49).
public readonly record struct TenantGrantSlot
public CrossTenantGrant Grant { get; init; }public bool Present { get; init; }public HybridLogicalClock Clock { get; init; }public string? WriterId { get; init; }public long Generation { get; init; }public static TenantGrantSlot Merge(TenantGrantSlot left, TenantGrantSlot right)
Orleans.Lattice.Tenancy.TenantGrantState
Source (line 39).
public enum TenantGrantState
Active = 0Pending = 1Rejected = 2Revoked = 3
Orleans.Lattice.Tenancy.TenantGranteeKind
Source (line 7).
public enum TenantGranteeKind
Subject = 0Tenant = 1
Orleans.Lattice.Tenancy.TenantLwwRegister
Source (line 13).
public readonly record struct TenantLwwRegister<T>
public T Value { get; init; }public HybridLogicalClock Clock { get; init; }public string? WriterId { get; init; }public static TenantLwwRegister<T> Create(T value, HybridLogicalClock clock, string? writerId)public TenantLwwRegister<T> Set(T value, HybridLogicalClock clock, string? writerId)public static TenantLwwRegister<T> Merge(TenantLwwRegister<T> left, TenantLwwRegister<T> right)
Orleans.Lattice.Tenancy.TenantMeteredOverage
Source (line 15).
public readonly record struct TenantMeteredOverage
public TenantMeteredOverage(TenantId tenant, TenantOverageSample overage)public TenantId Tenant { get; init; }public TenantOverageSample Overage { get; init; }
Orleans.Lattice.Tenancy.TenantObservabilityOptions
Source (line 16).
public sealed class TenantObservabilityOptions
public static readonly TimeSpan DefaultPublishIntervalpublic bool PublishGauges { get; set; }public TimeSpan PublishInterval { get; set; }
Orleans.Lattice.Tenancy.TenantObservabilityScope
Source (line 27).
public readonly record struct TenantObservabilityScope
public bool IsClusterWide { get; }public LatticeSubject Subject { get; }public static TenantObservabilityScope ActiveTenant { get; }public static TenantObservabilityScope ClusterWide(LatticeSubject subject)
Orleans.Lattice.Tenancy.TenantObservabilitySnapshot
Source (line 19).
public readonly record struct TenantObservabilitySnapshot
public TenantObservabilitySnapshot( TenantId tenant, LocalUsageSample usage, TenantQuotas quotas, TenantOverageSample meteredOverage)public TenantId Tenant { get; init; }public LocalUsageSample Usage { get; init; }public TenantQuotas Quotas { get; init; }public TenantOverageSample MeteredOverage { get; init; }public TenantOverageSample InstantaneousOverage
Orleans.Lattice.Tenancy.TenantOverageConcurrencyException
Source (line 18).
public sealed class TenantOverageConcurrencyException : Exception
public TenantOverageConcurrencyException(TenantId tenant, int attempts)public TenantId Tenant { get; }public int Attempts { get; }
Orleans.Lattice.Tenancy.TenantOverageRecord
Source (line 31).
public sealed class TenantOverageRecord
public TenantId Id { get; private init; }public TenantOverageRecord()public static TenantOverageRecord Create(TenantId id)public void MeterLocal(string cluster, TenantOverageSample increment)public TenantOverageSample LocalOverage(string cluster)public TenantOverageSample Fold()public TenantOverageSample Fold(IReadOnlySet<string> residentClusters)public int ClusterCount { get; }public TenantOverageRecord Clone()public TenantOverageRecord MergeFrom(TenantOverageRecord other)public static TenantOverageRecord Merge(TenantOverageRecord left, TenantOverageRecord right)
Orleans.Lattice.Tenancy.TenantOverageSample
Source (line 22).
public readonly record struct TenantOverageSample
public long Bytes { get; init; }public long Keys { get; init; }public long MemoryBytes { get; init; }public long TreeCount { get; init; }public static TenantOverageSample Emptypublic bool IsEmptypublic TenantOverageSample Add(TenantOverageSample other)public static TenantOverageSample Above(LocalUsageSample usage, TenantQuotas quotas)
Orleans.Lattice.Tenancy.TenantPlacement
Source (line 16).
public readonly record struct TenantPlacement
public string? WalProviderName { get; init; }public string? PlacementFilter { get; init; }public bool DedicatedWal { get; init; }public static TenantPlacement Sharedpublic bool IsShared
Orleans.Lattice.Tenancy.TenantQuotas
Source (line 16).
public readonly record struct TenantQuotas
public long? MaxBytes { get; init; }public long? MaxKeys { get; init; }public long? MaxMemoryBytes { get; init; }public long? MaxTreeCount { get; init; }public long? MaxOpsPerSecond { get; init; }public int BurstPercent { get; init; }public const long DefaultMaxGroupspublic const long DefaultMaxMembershipEdgespublic const long DefaultMaxMemberSubjectspublic const long DefaultMaxTenantRulespublic long? MaxGroups { get; init; }public long? MaxMembershipEdges { get; init; }public long? MaxMemberSubjects { get; init; }public long? MaxTenantRules { get; init; }public long EffectiveMaxGroupspublic long EffectiveMaxMembershipEdgespublic long EffectiveMaxMemberSubjectspublic long EffectiveMaxTenantRulespublic static TenantQuotas Unboundedpublic bool IsUnbounded
Orleans.Lattice.Tenancy.TenantRateApportionmentStrategy
Source (line 7).
public enum TenantRateApportionmentStrategy
Demand = 0StaticEven = 1
Orleans.Lattice.Tenancy.TenantRecord
Source (line 27).
public sealed class TenantRecord
public TenantId Id { get; private init; }public TenantRecord()public TenantStatus Statuspublic TenantQuotas Quotaspublic TenantPlacement Placementpublic bool IsActivepublic bool IsSuspendedpublic static TenantRecord Create( TenantId id, TenantStatus status, TenantQuotas quotas, TenantPlacement placement, HybridLogicalClock clock, string? writerId)public static TenantRecord CreateDefault(HybridLogicalClock clock, string? writerId)public void SetStatus(TenantStatus status, HybridLogicalClock clock, string? writerId)public void SetQuotas(TenantQuotas quotas, HybridLogicalClock clock, string? writerId)public void SetPlacement(TenantPlacement placement, HybridLogicalClock clock, string? writerId)public void AddAdminSubject(string subjectId, HybridLogicalClock clock, string? writerId)public void RemoveAdminSubject(string subjectId, HybridLogicalClock clock, string? writerId)public void AddMemberSubject(string subjectId, HybridLogicalClock clock, string? writerId)public void RemoveMemberSubject(string subjectId, HybridLogicalClock clock, string? writerId)public bool HasMemberSubject(string subjectId)public bool IsAdmin(string subjectId, IReadOnlyCollection<string> groupIds)public bool IsMember(string subjectId, IReadOnlyCollection<string> groupIds)public void AddGrant(CrossTenantGrant grant, HybridLogicalClock clock, string? writerId)public void OfferGrant(CrossTenantGrant grant, HybridLogicalClock clock, string? writerId)public void TransitionGrant( string grantId, TenantGrantState state, HybridLogicalClock clock, string? writerId)public void RemoveGrant(string grantId, HybridLogicalClock clock, string? writerId)public void RemoveGrant(CrossTenantGrant grant, HybridLogicalClock clock, string? writerId)public bool HasAdminSubject(string subjectId)public bool TryGetGrant(string grantId, out CrossTenantGrant grant)public IReadOnlyList<string> AdminSubjects { get; }public int AdminSubjectCount { get; }public IReadOnlyList<string> MemberSubjects { get; }public int MemberSubjectCount { get; }public int GrantCount { get; }public IReadOnlyList<CrossTenantGrant> Grants { get; }public void AuthorizeRegion(string regionId, HybridLogicalClock clock, string? writerId)public void RevokeRegion(string regionId, HybridLogicalClock clock, string? writerId)public bool IsRegionAllowed(string regionId)public void SetRegionStatus(string regionId, TenantRegionStatus status, HybridLogicalClock clock, string? writerId)public TenantRegionStatus GetRegionStatus(string regionId)public bool TryPromoteRegionStatus(string regionId, string? writerId, out TenantRegionStatus promoted)public bool HasResidencyConfiguration { get; }public int ResidentRegionCount { get; }public IReadOnlyList<string> AllowedRegionIds { get; }public IReadOnlyList<KeyValuePair<string, TenantRegionStatus>> RegionStatusEntries { get; }public TenantRecord Clone()public TenantRecord MergeFrom(TenantRecord other)public static TenantRecord Merge(TenantRecord left, TenantRecord right)
Orleans.Lattice.Tenancy.TenantRecordNotFoundException
Source (line 17).
public sealed class TenantRecordNotFoundException : Exception
public TenantRecordNotFoundException(TenantId tenant)public TenantId Tenant { get; }
Orleans.Lattice.Tenancy.TenantRegionAllowSlot
Source (line 12).
public readonly record struct TenantRegionAllowSlot
public bool Present { get; init; }public HybridLogicalClock Clock { get; init; }public string? WriterId { get; init; }public static TenantRegionAllowSlot Merge(TenantRegionAllowSlot left, TenantRegionAllowSlot right)
Orleans.Lattice.Tenancy.TenantRegionLifecycle
Source (line 26).
public static class TenantRegionLifecycle
public static bool IsResident(TenantRegionStatus status)public static bool IsOnline(TenantRegionStatus status)public static TenantRegionStatus? NextOnAdd(TenantRegionStatus current)public static TenantRegionStatus? NextOnRemove(TenantRegionStatus current)public static bool IsLegalPromotion(TenantRegionStatus from, TenantRegionStatus to)public static bool TryNextPromotion(TenantRegionStatus current, out TenantRegionStatus next)
Orleans.Lattice.Tenancy.TenantRegionStatus
Source (line 19).
public enum TenantRegionStatus
None = 0Provisioning = 1Backfilling = 2Online = 3Draining = 4Offline = 5Removed = 6
Orleans.Lattice.Tenancy.TenantRegionStatusChange
Source (line 15).
public readonly record struct TenantRegionStatusChange( TenantId Tenant, string RegionId, TenantRegionStatus PreviousStatus, TenantRegionStatus CurrentStatus)
Primary constructor / positional members: ( TenantId Tenant, string RegionId, TenantRegionStatus PreviousStatus, TenantRegionStatus CurrentStatus)
Orleans.Lattice.Tenancy.TenantRegionStatusSlot
Source (line 13).
public readonly record struct TenantRegionStatusSlot
public TenantRegionStatus Status { get; init; }public HybridLogicalClock Clock { get; init; }public string? WriterId { get; init; }public static TenantRegionStatusSlot Merge(TenantRegionStatusSlot left, TenantRegionStatusSlot right)
Orleans.Lattice.Tenancy.TenantRegistryConcurrencyException
Source (line 18).
public sealed class TenantRegistryConcurrencyException : Exception
public TenantRegistryConcurrencyException(TenantId tenant, int attempts)public TenantId Tenant { get; }public int Attempts { get; }
Orleans.Lattice.Tenancy.TenantStatus
Source (line 9).
public enum TenantStatus
Active = 0Suspended = 1
Orleans.Lattice.Tenancy.TenantSubjectSlot
Source (line 11).
public readonly record struct TenantSubjectSlot
public bool Present { get; init; }public HybridLogicalClock Clock { get; init; }public string? WriterId { get; init; }public static TenantSubjectSlot Merge(TenantSubjectSlot left, TenantSubjectSlot right)
Orleans.Lattice.Tenancy.TenantUsageAccountingOptions
Source (line 13).
public sealed class TenantUsageAccountingOptions
public TenantEnforcementScope DefaultEnforcementScope { get; set; }public long PublishMinAbsoluteDelta { get; set; }public double PublishMinRelativeDelta { get; set; }public TimeSpan MeterInterval { get; set; }
Orleans.Lattice.Tenancy.TenantUsageConcurrencyException
Source (line 18).
public sealed class TenantUsageConcurrencyException : Exception
public TenantUsageConcurrencyException(TenantId tenant, int attempts)public TenantId Tenant { get; }public int Attempts { get; }
Orleans.Lattice.Tenancy.TenantUsageReading
Source (line 21).
public readonly record struct TenantUsageReading
public TenantUsageReading(TenantObservabilitySnapshot snapshot, TenantEnforcementScope scope)public TenantObservabilitySnapshot Snapshot { get; init; }public TenantEnforcementScope Scope { get; init; }
Orleans.Lattice.Tenancy.TenantUsageRecord
Source (line 32).
public sealed class TenantUsageRecord
public TenantId Id { get; private init; }public TenantUsageRecord()public static TenantUsageRecord Create(TenantId id)public void SetLocalSample(string cluster, LocalUsageSample sample, HybridLogicalClock clock, string? writerId)public LocalUsageSample LocalSample(string cluster)public int ClusterCountpublic LocalUsageSample Fold()public LocalUsageSample Fold(IReadOnlySet<string> residentClusters)public TenantUsageRecord Clone()public TenantUsageRecord MergeFrom(TenantUsageRecord other)public static TenantUsageRecord Merge(TenantUsageRecord left, TenantUsageRecord right)
Orleans.Lattice.Tenancy.TreeUsageSample
Source (line 17).
public readonly record struct TreeUsageSample
public TreeUsageSample(long bytes, long keys, long memoryBytes)public long Bytes { get; init; }public long Keys { get; init; }public long MemoryBytes { get; init; }