0
0
Redisquery~10 mins

Transaction execution model in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a Redis transaction.

Redis
redisClient.[1]()
Drag options to blanks, or click blank then click option'
AMULTI
BEXEC
CWATCH
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC instead of MULTI to start the transaction.
Using WATCH which is for monitoring keys, not starting transactions.
2fill in blank
medium

Complete the code to execute all commands queued in the transaction.

Redis
redisClient.[1]()
Drag options to blanks, or click blank then click option'
AEXEC
BWATCH
CDISCARD
DMULTI
Attempts:
3 left
💡 Hint
Common Mistakes
Using MULTI instead of EXEC to run the transaction.
Using DISCARD which cancels the transaction.
3fill in blank
hard

Fix the error in the code to cancel a Redis transaction.

Redis
redisClient.[1]()
Drag options to blanks, or click blank then click option'
AEXEC
BMULTI
CDISCARD
DWATCH
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC which executes the transaction instead of cancelling.
Using WATCH which is for monitoring keys, not cancelling.
4fill in blank
hard

Fill both blanks to watch a key and start a transaction.

Redis
redisClient.[1]('user:1')
redisClient.[2]()
Drag options to blanks, or click blank then click option'
AWATCH
BEXEC
CMULTI
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC before MULTI.
Using DISCARD instead of MULTI to start transaction.
5fill in blank
hard

Fill all three blanks to watch a key, start a transaction, and execute it.

Redis
redisClient.[1]('cart:123')
redisClient.[2]()
redisClient.[3]()
Drag options to blanks, or click blank then click option'
AWATCH
BMULTI
CEXEC
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Executing before starting the transaction.
Not watching the key before starting the transaction.