Jorge Y. C. Rodriguez
Jorge Y. C. Rodriguez

Reputation: 3449

Using Redis clusters and transactions

While using Redis cluster I get the following error:

Cannot use 'MULTI' with redis-cluster.

With the just the following call:

Redis::multi();

Is there a way to ensure data integrity across the clusters without the use of transactions, since that is not possible

Upvotes: 2

Views: 5487

Answers (1)

for_stack
for_stack

Reputation: 23041

Redis doesn't support transaction, if keys are located on different slots/nodes.

If you have to store your data in a cluster, you must ensure all keys related to your transaction are stored on a single slot. You can use hash tag to do that.

Then you can take the node holding the slot as a single Redis instance, and run transaction on that node.

Upvotes: 8

Related Questions