uintaam's avatar

AWS Serverless Valkey

Has anyone built or seen a package that deals with Serverless Valkey read replicas. Speaking with AWS and looking at their docs, if you use Serverless Valkey it's recommended you do read operations on port 6380

https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ReadReplicas.html

0 likes
1 reply
uintaam's avatar
uintaam
OP
Best Answer
Level 1

So the solution here was to make sure you have context settings in to get it work properly in cluster mode

 'options' => [
          'cluster' => env('REDIS_CLUSTER', 'redis'),
          'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
          'failover' => RedisCluster::FAILOVER_DISTRIBUTE_SLAVES, // Use slaves to read vs FAILOVER_DISTRIBUTE which uses master and slaves
          'context' => [
              'ssl' => [
                  'verify_peer' => true,
                  'verify_peer_name' => true,
              ],
          ],
      ],

      'clusters' => [
          'default' => [
              [
                  'url' => env('STATE_REDIS_URL'),
                  'host' => env('STATE_REDIS_HOST', '127.0.0.1'),
                  'password' => env('STATE_REDIS_PASSWORD'),
                  'port' => env('STATE_REDIS_PORT', '6379'),
                  'scheme' => env('REDIS_SCHEME', 'tcp'),
              ],
          ],
  ],

Please or to participate in this conversation.