Keryhe.Almandine.Core 1.0.0-preview.1

This is a prerelease version of Keryhe.Almandine.Core.
dotnet add package Keryhe.Almandine.Core --version 1.0.0-preview.1
                    
NuGet\Install-Package Keryhe.Almandine.Core -Version 1.0.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Keryhe.Almandine.Core" Version="1.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Keryhe.Almandine.Core" Version="1.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Keryhe.Almandine.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Keryhe.Almandine.Core --version 1.0.0-preview.1
                    
#r "nuget: Keryhe.Almandine.Core, 1.0.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Keryhe.Almandine.Core@1.0.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Keryhe.Almandine.Core&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Keryhe.Almandine.Core&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

Keryhe.Almandine.Core

Core hosting library for the Almandine write-behind cache tier. Hosts a Garnet server with custom Redis-compatible commands (DB_GET/DB_SET/DB_DEL + batch variants) implementing cache-aside reads and asynchronous write-behind persistence, backed by a RabbitMQ queue, a Polly circuit breaker, and OpenTelemetry instrumentation.

Install

dotnet add package Keryhe.Almandine.Core

You'll also want Keryhe.Almandine.Abstractions to implement your entity handlers.

Setup

Register a concrete IDatabaseService before calling AddAlmandine() — typically HandlerDatabaseService backed by a TypeHandlerRegistry of your ITypeHandler implementations:

builder.Services.AddSingleton<TypeHandlerRegistry>(sp =>
{
    var registry = new TypeHandlerRegistry(sp.GetRequiredService<ILoggerFactory>()
        .CreateLogger<TypeHandlerRegistry>());
    registry.Register("customer:", new CustomerHandler(connectionString));
    registry.Register("order:",    new OrderHandler(connectionString));
    return registry;
});
builder.Services.AddSingleton<IDatabaseService, HandlerDatabaseService>();

builder.AddAlmandine(args);
builder.AddAlmandineOpenTelemetry(); // must come after AddAlmandine()

await builder.Build().RunAsync();

AddAlmandine() registers the Redis connection, options, RabbitMQ topology, circuit breaker, write-behind queue, and hosted services (Garnet server, queue consumer, DB health poller, metrics). It's safe to call more than once — later calls are no-ops.

Configuration

Bound from configuration sections of the same name:

Section Options
Redis:ConnectionString Garnet/Redis connection string (default 127.0.0.1:6379,abortConnect=false)
RabbitMq Broker connection + exchange/queue names (RabbitMqOptions)
RabbitMqQueue Replay rate, max replay attempts, drain batch size (RabbitMqQueueOptions)
RetryOptions Write-behind retry policy (RetryOptions)
CircuitBreaker Break duration, sampling window, health-check interval (CircuitBreakerOptions)
Otlp OTLP export endpoint/headers, console exporter toggle (OtlpOptions)

The Garnet server itself reads garnet.conf (memory limit, AOF, port) from the working directory — copy it to your host project's output directory.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0-preview.1 88 8/30/2026