sorentwo / readthis

:newspaper: Pooled active support compliant caching with redis
MIT License
504 stars 40 forks source link

why fault tolerant options is a global options? #60

Closed saiqulhaq closed 6 years ago

saiqulhaq commented 6 years ago

is there any problem if fault tolerant feature is used per connection/url instead globally?

in case someone wants to use Readthis gem to connect to multiple redis server?

sorentwo commented 6 years ago

Aside from it being a big change to the API, there wouldn't be a problem with having it per-client. Although, I have a hard time envisioning a scenario where you have multiple caches and only want fault tolerance for one of them.

I'd accept a PR to implement this at the client level, but it would take a while to roll out.

saiqulhaq commented 6 years ago

oh ok great to hear that

currently we use 2 redis connections the first one is for storage (used by sidekiq), and the another one is for LRU cache (migrated from memcached)

actually I want to modify Readthis config to optimize redis as LRU cache, but I can't because the config is global, I worry it will affect the another instance

I'd accept a PR to implement this at the client level, but it would take a while to roll out.

ok thanks, I hope will able to make PR for this feature

sorentwo commented 6 years ago

You are correct that changing the settings in Redis is shared across databases. I would recommend using a separate instance entirely for Sidekiq.