Atomicity of operation? #772
Answered
by
romange
phuongnd08
asked this question in
Q&A
-
Let say I need to get the value of a key, increase it by x, and set the new value to database. With redis lua script, I can make sure if I send N operations in parallel, they are executed without race condition because redis is single threaded. How can I achive this with dragonfly? |
Beta Was this translation helpful? Give feedback.
Answered by
romange
Feb 10, 2023
Replies: 1 comment 3 replies
-
You can do it exactly the same in Dragonfly. You do not have to be single threaded to guarantee atomicity. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
phuongnd08
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do it exactly the same in Dragonfly.
It preserves the atomicity of lua scripts.
You do not have to be single threaded to guarantee atomicity.