CoreSystem.Redis
1.1.0
dotnet add package CoreSystem.Redis --version 1.1.0
NuGet\Install-Package CoreSystem.Redis -Version 1.1.0
<PackageReference Include="CoreSystem.Redis" Version="1.1.0" />
<PackageVersion Include="CoreSystem.Redis" Version="1.1.0" />
<PackageReference Include="CoreSystem.Redis" />
paket add CoreSystem.Redis --version 1.1.0
#r "nuget: CoreSystem.Redis, 1.1.0"
#:package CoreSystem.Redis@1.1.0
#addin nuget:?package=CoreSystem.Redis&version=1.1.0
#tool nuget:?package=CoreSystem.Redis&version=1.1.0
⚡ 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.
✨ 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 | 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- StackExchange.Redis (>= 2.13.17)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- StackExchange.Redis (>= 2.13.17)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.21)
- StackExchange.Redis (>= 2.13.17)
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.
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.