Multiple operations also support transactions, that is, atomicity, wrapped through MULTI和EXEC instructions
Atomic operation means that it will either be executed successfully or not executed at all if it fails. The most vivid metaphor is the real-life transfer metaphor. Your transfer either succeeds or fails. The money does not move. There is no such thing as your money being transferred out, but the payee did not receive it. This is a half-success and half-failure situation
Atomicity: A transaction is an indivisible minimum unit of work, either all succeed or all fail.
Atomic operation means that one of your business logic must be indivisible. For example, if you transfer money to someone else, your account will deduct money, and someone else's account will add money, this business logic is atomic, and this operation is an atomic operation. , either all succeed or both fail.
The execution of all single commands in Redis is atomic.
I feel that atomicity means that only one operation can be performed at the same time. (A transaction is an indivisible minimum unit of work, either all succeed or all fail.) It should be about consistency. I’m a bit confused here
The atomicity of Redis has two points:
A single operation is atomic
Multiple operations also support transactions, that is, atomicity, wrapped through
MULTI
和EXEC
instructionsAtomic operation means that it will either be executed successfully or not executed at all if it fails. The most vivid metaphor is the real-life transfer metaphor. Your transfer either succeeds or fails. The money does not move. There is no such thing as your money being transferred out, but the payee did not receive it. This is a half-success and half-failure situation
Point 1 has been answered
Atomicity: A transaction is an indivisible minimum unit of work, either all succeed or all fail.
Atomic operation means that one of your business logic must be indivisible. For example, if you transfer money to someone else, your account will deduct money, and someone else's account
will add money, this business logic is atomic, and this operation is an atomic operation. , either all succeed or both fail.
The execution of all single commands in Redis is atomic.
The principle of redis implementing transactions
I feel that atomicity means that only one operation can be performed at the same time. (A transaction is an indivisible minimum unit of work, either all succeed or all fail.) It should be about consistency. I’m a bit confused here