KeyDb Redis support

I was trying to use ServiceStack Redis with this drop-in-replacemnt fork of redis KeyDb ( A Multithreaded Fork of Redis That’s 5X Faster Than Redis | KeyDB Docs)

It claims it’s a superset of Redis and should be a drop-in-replacement for Redis. I can connect using my Redis Desktop Manager no problem, so from the outside it all seems to be working as expected.

However when I try to connect with ServiceStack, I get the following error saying no Master could be found.

System.TimeoutException: Could not resolve master instance within 10000ms RetryTimeout

---> System.IO.InvalidDataException: No master found in: redis-keydb.keydb-system.svc.cluster.local:6379

  at ServiceStack.Redis.RedisResolver.GetValidMaster(RedisClient client, RedisEndpoint config) in C:\BuildAgent\work\b2a0bfe2b1c9a118\src\ServiceStack.Redis\RedisResolver.cs:line 147

  at ServiceStack.Redis.RedisResolver.CreateRedisClient(RedisEndpoint config, Boolean master) in C:\BuildAgent\work\b2a0bfe2b1c9a118\src\ServiceStack.Redis\RedisResolver.cs:line 89

  --- End of inner exception stack trace ---

  at ServiceStack.Redis.RedisResolver.CreateRedisClient(RedisEndpoint config, Boolean master) in C:\BuildAgent\work\b2a0bfe2b1c9a118\src\ServiceStack.Redis\RedisResolver.cs:line 103

  at ServiceStack.Redis.RedisResolver.CreateMasterClient(Int32 desiredIndex) in C:\BuildAgent\work\b2a0bfe2b1c9a118\src\ServiceStack.Redis\RedisResolver.cs:line 171

  at ServiceStack.Redis.PooledRedisClientManager.GetClientAsync() in C:\BuildAgent\work\b2a0bfe2b1c9a118\src\ServiceStack.Redis\PooledRedisClientManager.Async.cs:line 131    

Can you look into the possibility for ServiceStack.Redis to connect to a KeyDb-Redis cluster?

Can you please submit feature requests to UserVoice.

Also note that ServiceStack.Redis only supports Redis Sentinel not Redis Cluster, so if it relies on Redis Cluster it wont be supported.

I submitted the UserVoice request KeyDb-Redis Support (A Multithreaded Fork of Redis That’s 5X Faster Than Redis) – Customer Feedback for ServiceStack (uservoice.com)

So yeah I think the issue probably boils down to the Cluster support, as the KeyDb Helm package I used sets up a HA cluster. I can try setting up a single node instance and see if ServiceStack will connect to that.

Is there a specific blocker or reason you say ServiceStack.Redis on Redis Cluster won’t be supported? Is this more of a not supported “yet” language, or is there an actual reason why it will never be supported?

I don’t believe that having every client baking their own cluster logic into their clients is the right approach, Redis Labs was working towards developing a cluster proxy which moved the logic to their managed proxy which would ensure each client would end up making use of the same cluster behavior.

So this here?
RedisLabs/redis-cluster-proxy: A proxy for Redis clusters. (github.com)

Looks like Apr 2020 was the last check in. Is it far enough along to play with? It says alpha code at the very bottom so this functionality is probably a ways off?

Looks like the other option is to get KeyDb to run in sentinel mode:
Using Sentinel | KeyDB Docs

Will try this approach.

1 Like

Never used it, but alpha suggests it shouldn’t be relied on.