Redis transaction rollback

I am new to redis. I have an application in which I have several redis commands that commit a transaction. If one of them fails, does redis roll back the transaction as relational databases? Is the user responsible for canceling the transaction?

+4
source share
2 answers

Redis does not roll back transactions like relational databases do.

If you have a background of relational databases, the fact that Redis commands may fail during a transaction, but still Redis will execute the rest of the transaction rather than rolling back, may seem strange to you.

However, there are good opinions regarding this behavior:

  • Redis commands can fail only when called with the wrong syntax (and the problem is not detected during the command queue) or against keys containing the wrong data type: this means that from a practical point of view the failure command is the result of programming errors and some error that will most likely be detected during development, rather than in production.

  • Redis is internally simplified and faster because it does not need the ability to roll back.

Check out Why redis does not support rollback transactions from the documentation and here .

+5
source

Documentaion is here. Redis does not support rollbacks.

+1
source

All Articles