1 what is
You can execute more than one command at a time, which is essentially a collection of commands. In a transaction
All commands are serialized, serialized sequentially without being inserted by other commands
2 can do
The execution of a series of commands in a queue at one time, sequentially, and exclusively
Three phase 3
-
Open: Starts a transaction with MULTI
-
Enqueue: To enqueue multiple commands into a transaction that are not executed immediately but are placed in a transaction queue waiting to be executed
-
Execution: transactions are triggered by the EXEC command
4 three features
-
Separate isolated operations: All commands in a transaction are serialized and executed sequentially. The transaction will not be interrupted by command requests from other clients during execution.
-
There is no concept of isolation level: commands in the queue are not actually executed until the transaction is committed, because no instructions are actually executed until the transaction is committed, so there is no headache of “in-transaction queries seeing updates in the transaction and out-of-transaction queries not”
-
No guarantee of atomicity: Redis if a command fails in the same transaction, subsequent commands are still executed without rollback