Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 766cbd3

Browse files
committed
Update docs
1 parent a05b5f9 commit 766cbd3

File tree

1 file changed

+31
-43
lines changed

1 file changed

+31
-43
lines changed

README.md

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,34 @@ for updates, or [StackOverflow](http://stackoverflow.com/questions/ask) or the [
33

44
# C#/.NET Client for Redis
55

6+
[ServiceStack's C# Redis Client](https://github.com/ServiceStack/ServiceStack.Redis) is a simple, high-performance and feature-rich C# Client for Redis with native support and [high-level abstractions](https://github.com/ServiceStack/ServiceStack.Redis/wiki/DesigningNoSqlDatabase) for serializing POCOs and Complex Types.
7+
8+
There are a number of different APIs available with the `RedisClient` implementing the following interfaces:
9+
10+
* [ICacheClient](http://docs.servicestack.net/caching) - If you are using Redis solely as a cache, you should bind to the ServiceStack's common interface as there already are In-Memory an Memcached implementations available in ServiceStack, allowing you to easily switch providers
11+
* [IRedisNativeClient](https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.Interfaces/Redis/IRedisNativeClient.cs) - For those wanting a low-level raw byte access (where you can control your own serialization/deserialization) that map 1:1 with Redis operations of the same name.
12+
13+
For most cases if you require access to Redis specific functionality you would want to bind to the interface below:
14+
15+
* [IRedisClient](https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.Interfaces/Redis/IRedisClient.cs) - Provides a friendlier, more descriptive API that lets you store values as strings (UTF8 encoding).
16+
* [IRedisTypedClient](https://github.com/ServiceStack/ServiceStack/tree/master/src/ServiceStack.Interfaces/Redis/Generic) - created with `IRedisClient.As<T>()` - it returns a 'strongly-typed client' that provides a typed-interface for all redis value operations that works against any C#/.NET POCO type.
17+
18+
The interfaces works cleanly with any IOC and allows your app logic to bind to implementation-free interfaces which can easily be mocked and substituted.
19+
20+
An overview of class hierarchy for the C# Redis clients looks like:
21+
22+
RedisTypedClient (POCO) > RedisClient (string) > RedisNativeClient (raw byte[])
23+
24+
With each client providing different layers of abstraction:
25+
26+
* The RedisNativeClient exposes raw `byte[]` apis and does no marshalling and passes all values directly to redis.
27+
* The RedisClient assumes `string` values and simply converts strings to UTF8 bytes before sending to Redis
28+
* The RedisTypedClient provides a generic interface allowing you to add POCO values. The POCO types are serialized using [.NETs fastest JSON Serializer](http://www.servicestack.net/mythz_blog/?p=344) which is then converted to UTF8 bytes and sent to Redis.
29+
30+
### API Overview
31+
32+
[![Redis Client API](http://mono.servicestack.net/img/Redis-annotated-preview.png)](http://mono.servicestack.net/img/Redis-annotated.png)
33+
634
## Redis Connection Strings
735

836
Redis Connection strings have been expanded to support the more versatile URI format which is now able to capture most of Redis Client
@@ -733,59 +761,19 @@ daysOfWeek.PrintDump(); //[Sunday, Monday, Tuesday, ...]
733761
More examples can be found in the [Redis Eval Lua tests](https://github.com/ServiceStack/ServiceStack.Redis/blob/master/tests/ServiceStack.Redis.Tests/RedisClientEvalTests.cs
734762
)
735763

736-
## Overview
737-
738-
*The Redis client is an independent project and can be used with or without the ServiceStack webservices framework.*
739-
740-
[Redis](http://code.google.com/p/redis/) is one of the fastest and most feature-rich key-value stores to come from the [NoSQL](http://en.wikipedia.org/wiki/NoSQL) movement.
741-
It is similar to memcached but the dataset is not volatile, and values can either be strings lists, sets, sorted sets or hashes.
742-
743-
[ServiceStack's C# Redis Client](https://github.com/ServiceStack/ServiceStack.Redis) is an Open Source C# Redis client based on [Miguel de Icaza](http://twitter.com/migueldeicaza) previous efforts with [redis-sharp](http://github.com/migueldeicaza/redis-sharp).
744-
745-
There are a number of different APIs available which are all a friendly drop-in with your local IOC:
746-
The `ServiceStack.Redis.RedisClient` class below implements the following interfaces:
747-
748-
* [ICacheClient](https://github.com/ServiceStack/ServiceStack/wiki/Caching) - If you are using Redis solely as a cache, you should bind to the [ServiceStack's common interface](https://github.com/ServiceStack/ServiceStack.Redis/wiki/Caching) as there already are In-Memory an Memcached implementations available in ServiceStack, allowing you to easily switch providers in-future.
749-
* [IRedisNativeClient](https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisNativeClient) - For those wanting a low-level raw byte access (where you can control your own serialization/deserialization) that map 1:1 with Redis operations of the same name.
750-
751-
For most cases if you require access to Redis specific functionality you would want to bind to the interface below:
752-
753-
* [IRedisClient](https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisClient) - Provides a friendlier, more descriptive API that lets you store values as strings (UTF8 encoding).
754-
* [IRedisTypedClient](https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisTypedClient) - created with `IRedisClient.As<T>()` - it returns a 'strongly-typed client' that provides a typed-interface for all redis value operations that works against any C#/.NET POCO type.
755-
756-
The class hierarchy for the C# Redis clients effectively look like:
757-
758-
RedisTypedClient (POCO) > RedisClient (string) > RedisNativeClient (raw byte[])
759-
760-
Each client provides a different layer of abstraction:
761-
762-
* The RedisNativeClient exposes raw **byte[]** apis and does no marshalling and passes all values directly to redis.
763-
* The RedisClient assumes **string** values and simply converts strings to UTF8 bytes before sending to Redis
764-
* The RedisTypedClient provides a generic interface allowing you to add POCO values. The POCO types are serialized using [.NETs fastest JSON Serializer](http://www.servicestack.net/mythz_blog/?p=344) which is then converted to UTF8 bytes and sent to Redis.
765-
766-
### Redis Client API Overview
767-
[![Redis Client API](http://mono.servicestack.net/img/Redis-annotated-preview.png)](http://mono.servicestack.net/img/Redis-annotated.png)
768-
769-
### Thread-safe client managers
770-
For multi-threaded applications you can choose from our different client connection managers:
764+
## Copying
771765

772-
* BasicRedisClientManager - a load-balance (master-write and read-slaves) client manager that returns a new [IRedisClient](https://github.com/ServiceStack/ServiceStack.Redis/wiki/IRedisClient) connection with the defaults specified (faster when accessing a redis-server instance on the same host).
773-
* PooledRedisClientManager - a load-balanced (master-write and read-slaves) client manager that utilizes a pool of redis client connections (faster when accessing a redis-server instance over the network).
766+
Since September 2013, ServiceStack source code is available under GNU Affero General Public License/FOSS License Exception, see license.txt in the source. Alternative commercial licensing is also available, see https://servicestack.net/pricing for details.
774767

775768
### [Docs and Downloads for older v3 BSD releases](https://github.com/ServiceStackV3/ServiceStackV3)
776769

777-
## Copying
778-
779-
Since September 2013, ServiceStack source code is available under GNU Affero General Public License/FOSS License Exception, see license.txt in the source.
780-
Alternative commercial licensing is also available, see https://servicestack.net/pricing for details.
781-
782770
## Contributing
783771

784-
Commits should be made to the **v3-fixes** branch so they can be merged into both **v3** and **master** (v4) release branches.
785772
Contributors need to approve the [Contributor License Agreement](https://docs.google.com/forms/d/16Op0fmKaqYtxGL4sg7w_g-cXXyCoWjzppgkuqzOeKyk/viewform) before any code will be reviewed, see the [Contributing wiki](https://github.com/ServiceStack/ServiceStack/wiki/Contributing) for more details.
786773

787774
### Redis Server builds for Windows
788775

776+
* [Redis on Windows](https://github.com/ServiceStack/redis-windows)
789777
* [MS Open Tech - Redis on Windows](https://github.com/MSOpenTech/Redis)
790778
* [Downloads for Cygwin 32bit Redis Server Windows builds](http://code.google.com/p/servicestack/wiki/RedisWindowsDownload).
791779
* [Project that lets you run Redis as a Windows Service](https://github.com/rgl/redis)

0 commit comments

Comments
 (0)