Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis transaction atomically

Tags:

redis

I'm new to Redis and while reading its transaction on the official site, I'm so confused at one thing.

  1. It says

Either all of the commands or none are processed, so a Redis transaction is also atomic.

  1. Then it says

even when a command fails, all the other commands in the queue are processed –

So it opposes to one another, doesn't it?

like image 778
Lucky Lam Avatar asked Oct 25 '25 14:10

Lucky Lam


1 Answers

It's about a different things. Redis have pipelines - client can send many commands to redis at once. Inside of pipeline batch can be transactions. And when transaction fails all commands inside a transaction will be discarded, but any pipelined (queued) commands after EXEC command will be executed anyway.

For more information see http://redis.io/topics/pipelining and http://redis.io/topics/transactions.

like image 175
sisoft Avatar answered Oct 28 '25 03:10

sisoft