Atomicity: A transaction is an indivisible minimum unit of work that either succeeds or fails.
Atomic operation means that one of your business logic must be indivisible. For example, if you transfer money to others, your account will deduct money, and other people's account will add money, this business logic is atomic, this Operations are atomic operations, either all succeed or all fail.
Is redis atomic?
The execution of all single commands in Redis is atomic.
The principle of redis transaction implementation
1. Batch operations are put into the queue cache before sending the EXEC command
2. Received Enter transaction execution after the EXEC command. If any command in the transaction fails to execute, the remaining commands will not be executed.
3. During the transaction execution process, command requests submitted by other clients will not be inserted into the transaction execution command sequence. Recommended in
The above is the detailed content of Is redis atomic?. For more information, please follow other related articles on the PHP Chinese website!