Coder Social home page Coder Social logo

Comments (5)

ryanlecompte avatar ryanlecompte commented on August 19, 2024

I actually think those two commands would work just fine. Would you mind forking redis_failover and adding support for them? I'd love to know how they work for you since I personally don't use Redis databases.

On Jul 4, 2012, at 9:42 AM, [email protected] wrote:

Hi, I was looking through the code for the failover client, and noticed that SELECT and TTL are not supported. These still have meaning in a failover environment, as many use SELECT to partition their Redis entries between different databases. Similarly, TTL is relevant to check how close to expiry a key is. Key expiration certainly seems like something that is needed.

What is your take on this? What was the rationale behind not supporting those operations in particular?

Thanks!

flu


Reply to this email directly or view it on GitHub:
#24

from redis_failover.

ryanlecompte avatar ryanlecompte commented on August 19, 2024

Actually, I know I made SELECT an unsupported operation. It's because RedisFailover::Client abstracts away exactly which underlying Redis client will be used for any given operation. For example, you may get a random slave when you perform an operation. I'd have to make SELECT cycle through all of the underlying redis clients and force them all to use a particular database. That's something that I didn't feel necessary in the initial implementation of redis_failover. You can specify a database to use when you initially create the RedisFailover::Client instance. So, if you wanted you could have multiple instances of RedisFailover::Client pointing at different database numbers.

I think TTL could still work though.

from redis_failover.

 avatar commented on August 19, 2024

I think that providing the DB to the client on creation would work for my SELECT needs. Our services only talk to a particular DB when they are using redis, so the different services could just construct them differently. As for the TTL support, I'd imagine that could just pass through and behave as expected (assuming that Redis replication also replicates key expiration data).

Unfortunately, I cannot fork and assist due to legal issues :/

Thanks for your quick response!

from redis_failover.

ryanlecompte avatar ryanlecompte commented on August 19, 2024

I added support for TTL in master. Thanks!

from redis_failover.

 avatar commented on August 19, 2024

You're the man. Huge thanks!

from redis_failover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.