0
0
Redisquery~10 mins

Multi-key transactions for consistency 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
redis_client.[1]()
Drag options to blanks, or click blank then click option'
ADISCARD
BEXEC
CWATCH
DMULTI
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC to start the transaction instead of MULTI.
Using WATCH which is for monitoring keys, not starting transactions.
2fill in blank
medium

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

Redis
redis_client.[1]()
Drag options to blanks, or click blank then click option'
AWATCH
BEXEC
CMULTI
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Using MULTI to execute commands instead of starting the transaction.
Using DISCARD which cancels the transaction.
3fill in blank
hard

Fix the error in the code to watch keys for changes before starting a transaction.

Redis
redis_client.[1]('key1', 'key2')
redis_client.MULTI()
Drag options to blanks, or click blank then click option'
AWATCH
BMULTI
CEXEC
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC or MULTI instead of WATCH to monitor keys.
Using DISCARD which cancels the transaction.
4fill in blank
hard

Fill both blanks to discard a transaction and unwatch keys.

Redis
redis_client.[1]()
redis_client.[2]()
Drag options to blanks, or click blank then click option'
ADISCARD
BEXEC
CUNWATCH
DMULTI
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXEC instead of DISCARD to cancel.
Using MULTI instead of UNWATCH to stop watching.
5fill in blank
hard

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

Redis
redis_client.[1]('keyA', 'keyB')
redis_client.[2]()
redis_client.[3]()
Drag options to blanks, or click blank then click option'
AWATCH
BEXEC
CMULTI
DDISCARD
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of commands.
Using DISCARD instead of EXEC to run the transaction.