Redis Transaction rollback
Asked Answered
B

2

7

I am new to redis. I have an application in which i have multiple redis commands which makes a transaction. If one of them fails does redis rollback the transaction like relational databases ? Is it users responsibility to rollback the transaction ?

Beating answered 24/4, 2013 at 7:12 Comment(1)
Might be useful: https://mcmap.net/q/271105/-how-to-implement-transaction-with-rollback-in-redisCuckoopint
L
8

Redis does not rollback transactions like the relational databases does.

If you have a relational databases background, the fact that Redis commands can fail during a transaction, but still Redis will execute the rest of the transaction instead of rolling back, may look odd to you.

However there are good opinions for this behavior:

  • Redis commands can fail only if called with a wrong syntax (and the problem is not detectable during the command queuing), or against keys holding the wrong data type: this means that in practical terms a failing command is the result of a programming errors, and a kind of error that is very likely to be detected during development, and not in production.

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

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

Latinalatinate answered 24/4, 2013 at 7:20 Comment(0)
W
1

Documentaion here. Redis does not supports rollback.

Watthour answered 24/4, 2013 at 7:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.