ServiceStack.Redis   .NET's most popular Redis Client for worlds fastest distributed NoSQL datastore

Fast C# Redis Client with high and low-level typed, string and byte[] clients

Use typed, intuitive apis for simplifying talking to redis:

using (var redisManager = new PooledRedisClientManager())
using (var redis = redisManager.GetClient())
{
    var redisTodos = redis.As<Todo>();
    var todo = new Todo
    {
        Id = redisTodos.GetNextSequence(),
        Content = "Learn Redis",
        Order = 1,
    };

    redisTodos.Store(todo);

    Todo savedTodo = redisTodos.GetById(todo.Id);
    savedTodo.Done = true;
    redisTodos.Store(savedTodo);

    "Updated Todo:".Print();
    redisTodos.GetAll().ToList().PrintDump();

    redisTodos.DeleteById(savedTodo.Id);

    "No more Todos:".Print();
    redisTodos.GetAll().ToList().PrintDump();
}
  1. Use thread-safe Redis Client Pool
  2. Get Redis Client from Pool
  3. Create typed Redis client for Todo types
  4. Create new TODO item
  5. Get next unique id for Todo types
  6. Store Todo item in redis
  7. Fetch Todo item by id
  8. Update item
  9. Save Updated Todo item
  10. Print dump of all Todo items in redis after update
  11. Delete Todo item by id
  12. Print dump of all Todo items in redis after delete

 

API Overview

C# Redis Client API

ServiceStack's Redis Client provides a comprehensive idiomatic typed C# library API around the NoSQL Redis Datastore.

Including adapters for .NET collection interfaces over redis server-side collections as well as support for Transactions, Pub/Sub, Lua and more.

Download

PM> Install-Package ServiceStack.Redis

Signed version:

PM> Install-Package ServiceStack.Redis.Signed

Royalty-Free Pricing
Indie*
Business
POPULAR
Indie Renewal* Software Updates and Commercial Support for an additional 12 months
Business Renewal Software Updates and Commercial Support for an additional 12 months

* Permitted Use

Companies or incorporated entities with more than 10 employees must purchase a Business plan (excl. registered non-profit organizations).