0
0
Redisquery~5 mins

MULTI command to start in Redis - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the MULTI command do in Redis?
The MULTI command starts a transaction block in Redis. It queues multiple commands so they can be executed together atomically with EXEC.
Click to reveal answer
beginner
How do you execute all commands queued after MULTI in Redis?
You use the EXEC command to execute all the commands queued after MULTI as a single atomic transaction.
Click to reveal answer
intermediate
What happens if you call DISCARD after MULTI in Redis?
DISCARD cancels the transaction and clears all queued commands after MULTI without executing them.
Click to reveal answer
intermediate
Can commands inside a MULTI block in Redis fail individually?
No, commands are queued and only executed together with EXEC. If one command fails during execution, the whole transaction still runs but errors are reported per command.
Click to reveal answer
beginner
Why use MULTI in Redis instead of running commands one by one?
Using MULTI ensures commands run atomically, so no other client can run commands in between. This keeps data consistent and avoids race conditions.
Click to reveal answer
What is the first command to start a transaction in Redis?
AEXEC
BWATCH
CDISCARD
DMULTI
Which command executes all queued commands after MULTI?
AMULTI
BDISCARD
CEXEC
DFLUSH
What does DISCARD do in a Redis transaction?
AStarts a transaction
BCancels the transaction and clears queued commands
CLocks keys for transaction
DExecutes queued commands
If a command inside MULTI fails, what happens?
AAll commands run, errors reported per command
BOnly the failed command is skipped
CThe whole transaction is aborted
DRedis crashes
Why use MULTI in Redis?
ATo run commands atomically
BTo delete keys
CTo speed up commands
DTo monitor commands
Explain how the MULTI command works in Redis and how it relates to EXEC and DISCARD.
Think about starting, running, or canceling a group of commands.
You got /4 concepts.
    Why is atomicity important in Redis transactions started with MULTI?
    Consider what happens if commands run one by one without control.
    You got /3 concepts.