What happens to messages published to a channel with no active subscribers?
Redis raises an error to the publisher.
Redis discards the messages immediately.
Redis stores the messages until a subscriber connects.
Redis persists the messages to disk for later retrieval.
A Redis key 'product:567' has a TTL of 60 seconds. What will be the TTL of this key after executing the command PERSIST product:567?
PERSIST product:567
60
-1
0
None of the above
What is the role of replication in a Redis Cluster?
To improve write performance by distributing write operations.
To optimize read operations by caching frequently accessed data on multiple nodes.
To provide fault tolerance and ensure data availability in case of node failures.
To enhance data security by encrypting data across multiple nodes.
You need to set a value and its expiration in a single atomic operation. Which command is most suitable?
SETEX
MSET
EXPIRE
SET
How do subscribers express interest in receiving messages from specific channels?
By executing the SUBSCRIBE command with the channel name.
SUBSCRIBE
By setting a special key in Redis with the channel name.
By establishing a direct connection to the publisher.
By writing a Lua script that listens for messages on the channel.
How does the WATCH command help in implementing optimistic locking in Redis?
WATCH
It acquires an exclusive lock on the watched keys.
It sets a time-to-live (TTL) on the watched keys.
It monitors the watched keys for changes by other clients.
It prevents other clients from reading the watched keys.
What units can be used to specify the radius in the GEORADIUS command?
GEORADIUS
Only degrees
Only kilometers
Only meters
Meters, kilometers, miles, feet
What is a potential downside of using Redis as a primary database for your application?
Redis does not support complex queries or joins like traditional SQL databases.
All of the above
Redis' in-memory nature means data persistence relies on disk or replication, introducing potential data loss risks.
Redis has limited data modeling capabilities compared to document-oriented or relational databases.
What is the primary advantage of using Redis HyperLogLogs over traditional sets for cardinality estimation?
HyperLogLogs consume significantly less memory for large cardinalities.
HyperLogLogs support range queries on the stored elements.
HyperLogLogs provide exact cardinality counts.
HyperLogLogs allow for storing duplicate elements.
In Redis Cluster, what happens if a node holding a primary key fails?
The cluster becomes inaccessible until the failed node is restored.
Data on the failed node is lost permanently.
All other nodes in the cluster take over the data from the failed node.
A replica of the failed node is promoted to master, ensuring data availability.