Repolode
2881099

2881099/csredis

A .NET client library for Redis, with Redis Sentinel and Cluster support and both synchronous and asynchronous APIs.

Stars
2,057
Forks
423
Open issues
310
Last commit
23 days ago

What is it?

CSRedis is a .NET client for Redis, targeting both .NET Core and .NET Framework 4.0+. It exposes method names that match redis-cli commands, so developers familiar with the Redis command set can use it without learning a new naming scheme.

The library covers standalone servers, Redis Sentinel with master-slave setups, and Redis Cluster. It provides both synchronous and asynchronous clients, supports geo and stream commands on newer server versions, and includes pipelines, pub/sub with pattern subscriptions, and a cache-shell helper. A RedisHelper static class and an IDistributedCache adapter (Caching.CSRedis) are available for ASP.NET Core integration.

Connection behaviour is configured through a connection string covering password, default database, key prefix, pool size and timeouts.

Key features

  • 01Method names match redis-cli commands
  • 02Supports standalone, Sentinel with master-slave, and Redis Cluster
  • 03Synchronous and asynchronous clients
  • 04Geo and stream commands on supported Redis versions
  • 05Pipelines and pattern-based pub/sub
  • 06IDistributedCache adapter for ASP.NET Core

Use cases

  • Connecting a .NET application to a Redis server or cluster
  • Using Redis as a distributed cache in ASP.NET Core
  • Running high-throughput async writes through pipelining
  • Building pub/sub messaging between .NET services

Quick start

  1. 1

    Install the CSRedisCore NuGet package

    dotnet add package CSRedisCore
  2. 2

    Create a client with your Redis connection string

Things to know

  • Geo commands require redis-server 3.2 or above, and stream commands require redis-server 5.0 or above.
  • Official Redis Cluster does not support multi-key commands, pipelines, or Eval scripts.

Topics

#redis#dotnet#csharp#redis-client#redis-cluster#caching#pub-sub#csredis#redis-sentinels

FAQ

What is csredis?
A .NET client library for Redis, with Redis Sentinel and Cluster support and both synchronous and asynchronous APIs. CSRedis is a .NET client for Redis, targeting both .NET Core and .NET Framework 4.0+. It exposes method names that match redis-cli commands, so developers familiar with the Redis command set can use it without learning a new naming scheme.
Is csredis free to use? What license does it have?
csredis is open source under the MIT license. Check the license terms before using it in commercial products.
Is csredis still maintained?
Actively maintained. The last commit to csredis was on Oct 15, 2026.
What can I use csredis for?
Connecting a .NET application to a Redis server or cluster Using Redis as a distributed cache in ASP.NET Core Running high-throughput async writes through pipelining Building pub/sub messaging between .NET services
How do I install csredis?
Install the CSRedisCore NuGet package: dotnet add package CSRedisCore Create a client with your Redis connection string
Where can I get csredis?
The source code and installation instructions are on GitHub: https://github.com/2881099/csredis

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects