1 year ago

#205396

test-img

lechat

With Redis cluster that has multiple shards, how can I use Queue in laravel?

I am trying to implement "queue" with Laravel and Redis cluster (that has multiple shards).

But I found that Laravel Horizon doesn't work with Redis cluster with multiple shards: https://github.com/laravel/horizon/issues/274#issuecomment-457218217

Horizon does not work with Redis Cluster and likely never will. Even if it did work with Clusters, you wouldn't be taking advantage of the clustering because Lua operations can't operate on multiple shards in one operation. And, for Horizon to work properly, our Lua scripts have to perform operations on multiple keys in one atomic transaction.

I tried "hash tags" as per other questions in stackoverflow. By using hash tags, Laravel Horizon worked with Redis cluster that has single shard, but didn't work with Redis cluster that has multiple shards.

On the otherhand, how to configure for Redis cluster is mentioned in Laravel's queues.

So my question is:

  1. Laravel 's queues work with Redis that has multiple shards?
  2. If both of them didn't work with multiple sharded Redis, I think I should go with database driver with Laravel's queues even if it is not recommended for production. Is there any other option?

laravel

redis

horizon

0 Answers

Your Answer

Accepted video resources