- 🇬🇧United Kingdom somersoft
This patch enables the ability to use a multiple Redis services and configure which cache bin use which service based upon the cache bin name.
The Redis report has been greatly modified to report information per service. It also lists which cache bins have been configured to use each service.
The patch has been used with AWS services in production.
It is fully backward compatible. for single service use and there are no changes to limit the configuration options.
Documentation has also been updated to indicate how to add and configure multiple services. - 🇬🇧United Kingdom somersoft
Updated the patch for redis 1.7
Here is the list of patches from composer.patches.json"drupal/redis": { "Currently Drush Cr or Cache Clear UI does not flush Redis cache - https://www.drupal.org/project/redis/issues/2765895": "https://www.drupal.org/files/issues/redis-n2765895-16.patch", "Support TLS for Predis - https://www.drupal.org/project/redis/issues/3004561": "https://www.drupal.org/files/issues/2021-11-19/redis-support_tls_on_predis-3004561-37.patch", "Implement initial RedisCluster client integration - https://www.drupal.org/project/redis/issues/2900947": "https://www.drupal.org/files/issues/2024-01-15/2900947-60.patch", "Cache bin handling in multiple Redis DBs - https://www.drupal.org/project/redis/issues/2395255": "https://www.drupal.org/files/issues/2024-02-01/redis-Cache_bin_handling_in_multiple_Redis_DBs-2395255-5.patch" },
- 🇬🇧United Kingdom somersoft
Updated the patch for redis 1.8
Here is the list of patches from composer[.patches].json"drupal/redis": { "Currently Drush Cr or Cache Clear UI does not flush Redis cache - https://www.drupal.org/project/redis/issues/2765895": "https://www.drupal.org/files/issues/redis-n2765895-16.patch", "Support TLS for Predis - https://www.drupal.org/project/redis/issues/3004561": "https://www.drupal.org/files/issues/2021-11-19/redis-support_tls_on_predis-3004561-37.patch", "Implement initial RedisCluster client integration - https://www.drupal.org/project/redis/issues/2900947": "https://www.drupal.org/files/issues/2024-10-15/2900947-82.patch", "Cache bin handling in multiple Redis DBs - https://www.drupal.org/project/redis/issues/2395255": "https://www.drupal.org/files/issues/2024-10-27/redis-Cache_bin_handling_in_multiple_Redis_DBs-2395255-6.patch" },
- 🇳🇱Netherlands casey
Nice. This is also useful if you want things like queues and persistent locks to be stored in redis instances with persistence enabled, while caches can be stored in redis instances without persistence.
Note that I don't really like the name $settings['redis_client_bins']. I would go for $settings['redis.connections'] (or redis.servers) and $settings['redis.targets'] (or redis.bindings) and have the redis CacheBackendFactory look for "cache:$bin" and "cache". Maybe the same can be useful for queues.
Also, the patch seems to create a client per cache bin, even if they are configured to use the same server. I guess this can be done more efficiently.
- 🇬🇧United Kingdom somersoft
@casey
The index redis.connection is already used. It is for connection details when there is only one and acts the fallback conection configuration for when no further server is configured for that cache bin. The change does not break any current configurations.
FYI:
cache bin is mentioned here core/lib/Drupal/Core/Cache/CacheFactory.php::24
'bins' and 'servers' are the indexes used in the Memcache configuration. It seems they had the functionality fromearlier on. Wanted the configuration concepts for both to be very similar so moving between using different techonlogies was not difficult for evalution purposes.
Feel free to make updates to the patch file and create one client per server rather than per bin by updating
Drupal\redis\ClientFactory::getClientInterface() and/or ::getClient()