When is it better to use Redis transactions?
Hi,
With some help of AI, I am trying to learn the best practices for making a cache service with Redis.
Currently, I am not quite sure when I should be making use of transactions, as I am getting conflicting answers from GPT and Claude for my specific method.
I just want to know:
- When transactions can be useful
- Whether Redis transactions specifically roll back changes upon failure
The image holds the current method which could probably use transactions if it would be useful.
Thanks for any help!

4 Replies
@Swyftey did you look at the docs? https://redis.io/docs/latest/develop/using-commands/transactions/
I'll take a look, I just figured I could save a few minutes with two questions
Personally I would've looked at the docs, at least the overview page, before asking AI.
I get you. I have a general idea of what a transaction is, I guess I more than anything just wanted to know if it fits my use-case (the method)
"Redis does not support rollbacks"
so that answers the second question