CoreSystem.Redis 1.1.0

dotnet add package CoreSystem.Redis --version 1.1.0
                    
NuGet\Install-Package CoreSystem.Redis -Version 1.1.0
                    
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="CoreSystem.Redis" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreSystem.Redis" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreSystem.Redis" />
                    
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 CoreSystem.Redis --version 1.1.0
                    
#r "nuget: CoreSystem.Redis, 1.1.0"
                    
#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 CoreSystem.Redis@1.1.0
                    
#: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=CoreSystem.Redis&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreSystem.Redis&version=1.1.0
                    
Install as a Cake Tool

⚡ CoreSystem.Redis

Redis infrastructure and distributed locking for .NET 8, 9 and 10.

CoreSystem.Redis is a lightweight Redis infrastructure library built on StackExchange.Redis. It provides reusable components for connection management and distributed synchronization, so cloud-native applications and shared libraries coordinate reliably across nodes.

NuGet Downloads License .NET


✨ Features

  • ✅ Redis connection factory with production-ready defaults
  • ✅ Distributed lock provider
  • ✅ Configurable ConfigurationOptions
  • ✅ Dependency Injection integration
  • ✅ Built on StackExchange.Redis
  • ✅ Reusable across multiple libraries

📦 Installation

dotnet add package CoreSystem.Redis

🚀 Quick Start

Register the services:

builder.Services.AddCoreRedis(options =>
{
    options.LockDuration = TimeSpan.FromSeconds(30);
    options.RetryDelay = TimeSpan.FromMilliseconds(50);
    options.MaxWaitTime = TimeSpan.FromSeconds(5);
});

Create a connection multiplexer:

builder.Services.AddSingleton<IConnectionMultiplexer>(sp =>
{
    var factory = sp.GetRequiredService<IRedisConnectionFactory>();

    return factory.Create(options =>
    {
        options.EndPoints.Add("localhost:6379");
    });
});

Acquire a distributed lock:

public sealed class OrderService(IDistributedLockProvider lockProvider)
{
    public async Task ProcessAsync(Guid id, CancellationToken ct)
    {
        await using var handle =
            await lockProvider.AcquireAsync($"orders:{id}", ct);

        // Critical section: only one holder across all nodes
    }
}

🧩 Included Components

Component Description
IRedisConnectionFactory Creates Redis connections.
RedisConnectionFactory Applies production-ready defaults.
IDistributedLockProvider Abstraction for distributed locking.
RedisLockProvider Redis-based lock implementation.
RedisLockOptions Lock duration, retry delay and max wait time.

🏗 Architecture

Application
      │
      ▼
IDistributedLockProvider
      │
      ▼
RedisLockProvider
      │
      ▼
RedisLock (SET NX PX)
      │
      ▼
Protected Operation

Each lock key is acquired atomically through Redis, so only one holder runs the critical section at a time regardless of how many application instances exist.


📖 Documentation

The full documentation includes:

  • Getting Started
  • Connection management
  • Distributed locking
  • Ecosystem integration
  • Architecture

Visit the GitHub repository for the complete documentation.


🤝 Contributing

Issues, discussions and pull requests are welcome.


📄 License

Released under the MIT License.

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on CoreSystem.Redis:

Package Downloads
CoreSystem.Cache.Redis

Redis external cache provider for CoreSystem.Cache on .NET 8, .NET 9 and .NET 10, with tag-based invalidation, distributed locking, health checks, and optional resilience integration.

CoreSystem.Idempotency.Redis

Production-ready Redis storage provider for CoreSystem.Idempotency, providing high-performance distributed persistence through the IIdempotencyStorage abstraction.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 156 10/21/2026
1.0.4 170 10/18/2026
1.0.3 327 10/7/2026
1.0.2 98 10/7/2026
1.0.1 94 10/7/2026
1.0.0 785 7/7/2026

Initial stable release.
 - Redis Connection Factory
 - Distributed Lock Provider
 - Dependency Injection integration
 - Production-ready defaults
 1.0.4: Dependency refresh. StackExchange.Redis 2.13.1 to 2.13.17. No code or API changes.
 1.1.0: targets net8.0, net9.0 and net10.0. No public API or behavior change; the net9.0 and net10.0 assets are new, and the net8.0 asset is unchanged. Microsoft.Extensions.DependencyInjection.Abstractions is declared per TFM (8.0.2 / 9.0.21 / 10.0.13), raising the floor on net9.0/net10.0.