Ama.CRDT.Partitioning.Streams
3.1.260406-ci1209
See the version list below for details.
dotnet add package Ama.CRDT.Partitioning.Streams --version 3.1.260406-ci1209
NuGet\Install-Package Ama.CRDT.Partitioning.Streams -Version 3.1.260406-ci1209
<PackageReference Include="Ama.CRDT.Partitioning.Streams" Version="3.1.260406-ci1209" />
<PackageVersion Include="Ama.CRDT.Partitioning.Streams" Version="3.1.260406-ci1209" />
<PackageReference Include="Ama.CRDT.Partitioning.Streams" />
paket add Ama.CRDT.Partitioning.Streams --version 3.1.260406-ci1209
#r "nuget: Ama.CRDT.Partitioning.Streams, 3.1.260406-ci1209"
#:package Ama.CRDT.Partitioning.Streams@3.1.260406-ci1209
#addin nuget:?package=Ama.CRDT.Partitioning.Streams&version=3.1.260406-ci1209&prerelease
#tool nuget:?package=Ama.CRDT.Partitioning.Streams&version=3.1.260406-ci1209&prerelease
Ama.CRDT.Partitioning.Streams
A .NET library for implementing Conflict-free Replicated Data Types (CRDTs) for larger-than-memory streams using B+ Trees.
This package is an extension to the Ama.CRDT core library, decoupling the stream-based partitioning logic into its own reusable module.
Features
- B+ Tree Indexing: Efficiently indexes CRDT partitions to scale documents beyond system memory.
- Stream-Based Storage: Supports persisting partitions using any stream provider (e.g., File streams, Azure Blob Storage, AWS S3).
- Space Allocation: Includes an internal mechanism to reuse freed blocks and manage in-place stream updates.
- Polymorphic Serialization: Leverages robust serialization mechanisms for dynamic CRDT payloads out of the box.
Installation
Install via NuGet:
dotnet add package Ama.CRDT.Partitioning.Streams
Getting Started
To use stream-based partitioning, you need to implement the IPartitionStreamProvider interface to define where your data and index streams are stored.
1. Implement a Stream Provider
using Ama.CRDT.Services.Partitioning.Streams;
using System;
using System.IO;
using System.Threading.Tasks;
public class FileSystemStreamProvider : IPartitionStreamProvider
{
public Task<Stream> GetPropertyIndexStreamAsync(string propertyName)
{
// Implement logic to return your stream (e.g., new FileStream(...))
throw new NotImplementedException();
}
public Task<Stream> GetPropertyDataStreamAsync(IComparable logicalKey, string propertyName)
{
// Implement logic to return your stream
throw new NotImplementedException();
}
public Task<Stream> GetHeaderIndexStreamAsync()
{
// Implement logic to return your stream
throw new NotImplementedException();
}
public Task<Stream> GetHeaderDataStreamAsync(IComparable logicalKey)
{
// Implement logic to return your stream
throw new NotImplementedException();
}
}
2. Configure Dependency Injection
Register the stream partitioning services in your DI container using the provided extension method. This should be chained after the core .AddCrdt() registration.
using Ama.CRDT.Extensions; // Includes the AddCrdtStreamPartitioning extension
using Ama.CRDT.Models;
using Ama.CRDT.Services.Decorators;
var builder = WebApplication.CreateBuilder(args);
// Add core CRDT services and register the partitioning decorator
builder.Services.AddCrdt()
.AddCrdtApplicatorDecorator<PartitioningApplicatorDecorator>(DecoratorBehavior.Complex)
// Add the stream partitioning services with your custom provider
.AddCrdtStreamPartitioning<FileSystemStreamProvider>();
var app = builder.Build();
3. Usage
Once registered, the IPartitionManager<T> (from the core Ama.CRDT library) will automatically resolve the IPartitionStorageService provided by this package, allowing you to transparently manage large partitioned documents.
4. Performance Counters
To see the performance counters when debugging you can use one of the following in a command prompt:
dotnet-counters monitor --name Ama.CRDT.ShowCase.LargerThanMemory --counters "Ama.CRDT.BPlusTree" --maxHistograms 30
Or use powershell if you prefer:
$p = Get-Process -Name "Ama.CRDT.ShowCase.LargerThanMemory" -ErrorAction SilentlyContinue; if ($p) { dotnet-counters monitor --process-id $p[0].Id --counters "Ama.CRDT.Partitioning.Streams" --maxHistograms 30 } else { Write-Warning "Process not found" }
License
The code is licensed under MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Ama.CRDT (>= 3.1.260406-ci1209)
- Ama.CRDT.Project.Analyzers (>= 3.1.260406-ci1209)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
-
net8.0
- Ama.CRDT (>= 3.1.260406-ci1209)
- Ama.CRDT.Project.Analyzers (>= 3.1.260406-ci1209)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- System.Collections.Immutable (>= 10.0.5)
-
net9.0
- Ama.CRDT (>= 3.1.260406-ci1209)
- Ama.CRDT.Project.Analyzers (>= 3.1.260406-ci1209)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- System.Collections.Immutable (>= 10.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.260412-ci0758 | 26 | 4/12/2026 |
| 3.1.260412-ci0728 | 25 | 4/12/2026 |
| 3.1.260409-ci0958 | 67 | 4/9/2026 |
| 3.1.260406-ci1209 | 83 | 4/6/2026 |
| 3.1.260406-ci1202 | 84 | 4/6/2026 |
| 3.1.260406-ci0820 | 83 | 4/6/2026 |
| 3.0.260405-ci1932 | 74 | 4/5/2026 |
| 3.0.260405-ci1925 | 79 | 4/5/2026 |
| 3.0.260405-ci1203 | 84 | 4/5/2026 |
| 3.0.260405-ci0909 | 81 | 4/5/2026 |
| 3.0.260405-ci0733 | 83 | 4/5/2026 |
| 3.0.260404-ci1533 | 82 | 4/4/2026 |
| 3.0.260404-ci0922 | 83 | 4/4/2026 |
| 3.0.260404-ci0907 | 82 | 4/4/2026 |
| 3.0.260403-ci1849 | 79 | 4/3/2026 |
| 3.0.260402-ci0914 | 78 | 4/2/2026 |
| 3.0.260402-ci0831 | 75 | 4/2/2026 |
| 3.0.260401-ci1724 | 79 | 4/1/2026 |
| 3.0.260401-ci1612 | 76 | 4/1/2026 |
| 3.0.0 | 78 | 4/5/2026 |