StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

Identifying update failure in Redis.

Open Vijay27anand opened this issue 12 years ago • 2 comments

mgravell,

we are trying to use redis for our application which involves 100000 read/writes per hour. We are have SQL DB as persistent storage and will use Redis as cache only, so any update we will do in Redis and DB, any read we will use Redis first and if not available we go to DB and update Redis.

So we like to know if we will have any chance if an update fails in Redis and success in DB we will have out of sync issue.

Is there a way to identify if any update to Redis is failed, will the redis client return any error code if save/update is failed.

Vijay27anand avatar Nov 18 '14 16:11 Vijay27anand

The redis client will report any unexpected responses from the server as exceptions - on both the sync and async APIs. One exception to this is if you are using the FireAndForget flag; and likewise, if you are using the async API but not watching the completion / failure, then you don't be notified.

But in the general case: it should be very obvious if the server reports a failure. In particular, it should be a RedisServerException (or the RedisException super-class if you want to also include things like TCP failures).

It also largely depends on what commands you are using. SET, for example, only fails for edge-case reasons (loading from disk, readonly-slave, etc)

Marc On 18 Nov 2014 16:45, "Vijay27anand" [email protected] wrote:

mgravell,

we are trying to use redis for our application which involves 100000 read/writes per hour. We are have SQL DB as persistent storage and will use Redis as cache only, so any update we will do in Redis and DB, any read we will use Redis first and if not available we go to DB and update Redis.

So we like to know if we will have any chance if an update fails in Redis and success in DB we will have out of sync issue.

Is there a way to identify if any update to Redis is failed, will the redis client return any error code if save/update is failed.

— Reply to this email directly or view it on GitHub https://github.com/StackExchange/StackExchange.Redis/issues/128.

mgravell avatar Nov 18 '14 20:11 mgravell

Closing this out as answered.

NickCraver avatar Jan 25 '16 12:01 NickCraver