0
0
Redisquery~10 mins

Redis as cache vs data store vs message broker - Interactive Practice

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

Complete the code to set a key with an expiration time in Redis.

Redis
SET mykey myvalue EX [1]
Drag options to blanks, or click blank then click option'
A60
Bmyvalue
CGET
DDEL
Attempts:
3 left
💡 Hint
Common Mistakes
Using a command name instead of a number for expiration.
Omitting the expiration time.
2fill in blank
medium

Complete the code to retrieve the value of a key in Redis.

Redis
[1] mykey
Drag options to blanks, or click blank then click option'
AEXPIRE
BDEL
CSET
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using SET instead of GET.
Using DEL which deletes the key.
3fill in blank
hard

Fix the error in the code to publish a message to a Redis channel.

Redis
PUBLISH [1] "Hello World"
Drag options to blanks, or click blank then click option'
AGET
Bmykey
Cmychannel
DSET
Attempts:
3 left
💡 Hint
Common Mistakes
Using a key name instead of a channel name.
Using a command name instead of a channel.
4fill in blank
hard

Fill both blanks to create a Redis hash and set a field value.

Redis
HSET [1] [2] "John"
Drag options to blanks, or click blank then click option'
Auser:1000
Bname
Cage
Dmykey
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the hash key and field.
Using a simple key instead of a hash key.
5fill in blank
hard

Fill all three blanks to subscribe to a Redis channel and receive messages.

Redis
SUBSCRIBE [1] [2] [3]
Drag options to blanks, or click blank then click option'
Anews
Bupdates
Calerts
Dmykey
Attempts:
3 left
💡 Hint
Common Mistakes
Including a key name instead of a channel.
Using commands instead of channel names.