Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7917471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:09:34+00:00 2026-06-03T15:09:34+00:00

The documentation for transactions says: we may deprecate and finally remove transactions and everything

  • 0

The documentation for transactions says:

“we may deprecate and finally remove transactions” and “everything you
can do with a Redis transaction, you can also do with a script”

http://redis.io/topics/transactions

But does it? I see a problem with this.

Within a transaction you can WATCH multiple variables, read those variables, and based on the unique state of those variables you can make a completely different set of writes before calling EXEC. If anything interferes with the state of those variables in the intervening time, EXEC will not perform the transaction. (Which allows you to retry it. This is a perfect transaction system.)

An EVAL script will not let you do that. According to the documentation on this page:

“Scripts as pure functions…The script always evaluates the same
Redis write commands with the same arguments given the same input data
set. Operations performed by the script cannot depend on any hidden
(non explicit) information or state that may change as script
execution proceeds or between different executions of the script, nor
can it depend on any external input from I/O devices.”

http://redis.io/commands/eval

The problem I see with EVAL is that you cannot GET the state of those variables inside of the script and make a unique set of writes based on the state of those variables. Again: “The script always evaluates the same Redis write commands with the same arguments given the same input data set.” So the resulting writes are already determined (cached from the first run) and the EVAL script doesn’t care what the GET values are inside of the script. The only thing you can do is perform GET for those variables before calling EVAL and then pass those variables to the EVAL script, but here’s the problem: now you have an atomicity problem between calling GET and calling EVAL.

In other words, all the variables that you would have done a WATCH for a transaction, in the case of EVAL you instead need to GET those variables and then pass them to the EVAL script. Since the atomic nature of the script isn’t guaranteed until the script actually starts, and you need to GET those variables before calling EVAL to start the script, that leaves an opening where the state of those variables could change between the GET and passing them to EVAL. Therefore, the guarantee of atomicity that you have with WATCH you do not have with EVAL for a very important set of use cases.

So why is there talk about deprecating transactions when that would cause important Redis functionality to be lost? Or is there actually a way to do this with EVAL scripts that I do not understand yet? Or are there features planned that can solve this for EVAL? (Hypothetical example: if they made WATCH work with EVAL the same way that WATCH works with EXEC, that might work.)

Is there a solution to this? Or am I to understand that Redis may not be completely transaction safe in the long term?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:09:35+00:00Added an answer on June 3, 2026 at 3:09 pm

    Its true that lua scripts can do whatever transactions can, but I don’t think Redis transactions are going away.

    EVAL script does not let you watch variables

    When an eval script is running, nothing else can run concurrently. So, watching variables is pointless. You can be sure that nobody else has modified the variables once you have read the values in the script.

    The problem I see with EVAL is that you cannot GET the state of those variables inside of the script and make a unique set of writes based on the state of those variables.

    Not true. You can pass keys to the eval script. Within your eval script, you can read the values from Redis, and then based on those values conditionally execute other commands.

    The script is still deterministic. If you take that script and run it on the slave, it will still execute the same write commands because the master and slave have the same data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking into the documentation it says that the Rollback method can throw when the
Is it worth using System.Transactions.TransactionScope on Linq to Entities? On the MS documentation ,
Documentation says: The Grails team discourages the embedding of core application logic inside controllers,
Documentation says Dictionary keys order is unspecified. I guess it means the first added
The documentation lists the tags that are allowed/removed by default: http://www.feedparser.org/docs/html-sanitization.html But it doesn't
The documentation implies that you can either have 3D rendering or framebuffer mode, and
I'm using GAE and I've found the documentation about how to use transactions to
I've read through MSDN on ROLLBACK TRANSACTION and nesting transactions . While I see
Infinispan documentation says a lot of stuff about its locking scheme, optimistic and pessimistic,
I cant seem to find any documentation on using AMQP transactions through the Kombu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.