-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use \RedisSentinel instead of Credis #146
Comments
Thanks for creating the issue @eschultz-magix I'm not so much into the topic right now but I think a while back sentinel mode wouldn't work with phpredis. This might have changed. |
@eschultz-magix would there be any particular advantage of using one or the other? |
@tsteur I guess, it would be great not to mix them up. Matomo requires the phpredis extension to be installed if you want to use redis as backend cache. Credis always checks if the extension is installed and fallbacks to phpredis. So there are no advantages, instead there is an additional check + library. In Sentinel model Credis forces its own implementation to communicate with the Sentinel server and with the Redis master server. So at the end there are two different ways to communicate with Redis: phpredis (Matomo and QueuedTracking in Non-Sentinel mode) and Credis (QueuedTracking in Sentinel mode). Using Credis will only make sense if you want to support old phpredis extensions without the |
@tsteur The |
Thanks for this @eschultz-magix didn't know |
The usages of a Redis library are very inconsistent.
Having 1 Redis server without sentinel --> phpredis with
\Redis
Having X Redis server in a cluster --> not supported
Having X Redis server with sentinel --> Credis in standalone mode
In Sentinel mode, one of the Sentinel instances are picked,
getMasterAddrByName()
is called and then a connection is established to the master where all all/write operations are done like in normal Redis mode.Credis uses phpredis by default if available, but phpredis also has a
\RedisSentinel
class which has thegetMasterAddrByName()
function.TL;DR: Credis is only used in Sentinel mode and can get replaced by phpredis, which is required by QueuedTracking anyway.
The text was updated successfully, but these errors were encountered: