Prev Next

Database / ValKey Interview questions

How does Valkey implement publish/subscribe messaging?

SUBSCRIBE and PSUBSCRIBE register a client's interest in specific channels or glob patterns, and PUBLISH broadcasts a message to every client currently subscribed at that moment.

Classic pub/sub is fire-and-forget: messages are never stored, so a client that wasn't subscribed when a message was published simply never sees it, which distinguishes it from the durable, replayable log semantics of Streams.

In Cluster mode, SSUBSCRIBE/SPUBLISH scope pub/sub traffic to a single shard instead of fanning it out across the entire cluster bus, which reduces unnecessary cross-node message traffic.

A key characteristic of classic Valkey pub/sub is that messages...
SSUBSCRIBE/SPUBLISH were introduced mainly to...

More Related questions...

What is Valkey? What is the purpose of Valkey? What are the data types supported by Valkey? How do you install Valkey on a Linux server? Define Valkey persistence? What is RDB persistence in Valkey? What is AOF persistence in Valkey? Describe Valkey replication? List the eviction policies supported by Valkey? What is the purpose of Valkey Sentinel? What is Valkey Cluster? How do you apply a TTL to a key in Valkey? What is the purpose of the valkey.conf configuration file? How do you use the Valkey CLI to connect to a remote, password-protected server? Explain the basic architecture of a Valkey server? Why was Valkey created? Why do we use Valkey instead of Redis? What is the difference between Valkey and Redis? How does Valkey Cluster achieve horizontal scaling through hash slots? How does Valkey handle automatic failover in Sentinel mode? When should you choose Valkey Cluster over Sentinel? What is the difference between RDB and AOF persistence? How can you optimize memory usage in Valkey? How do you troubleshoot high latency in a Valkey deployment? Explain the lifecycle of a command from a Valkey client to execution and response? Explain the execution flow of primary-replica replication in Valkey? Explain the internal working of the Valkey single-threaded event loop? Why doesn't Valkey execute commands using multiple threads by default? What happens when a primary node fails in a Valkey Cluster? Which is better and why: Valkey Cluster or client-side sharding? How does Valkey implement publish/subscribe messaging? What is the difference between LPUSH and RPUSH? How do you use Valkey Streams for event processing? What are Valkey modules and how do you load one? How does Valkey handle expired key deletion internally? What is the difference between Valkey and Memcached? How do you secure a Valkey deployment in production? What is the role of ACLs in Valkey? How does Valkey handle memory fragmentation? What is the difference between WAIT and replica acknowledgment in Valkey? How do you perform a zero-downtime Valkey version upgrade? Explain the internal working of Valkey's hash slot mechanism in cluster mode? How do you troubleshoot a split-brain scenario with Valkey Sentinel? Explain the difference between Valkey Cluster mode and standalone mode? How does Valkey achieve high availability? What is the difference between synchronous and asynchronous replication in Valkey? How do you monitor Valkey performance in production? Explain the internal working of Valkey's LRU and LFU eviction algorithms? Why should you avoid running the KEYS command in production? How does Valkey's multi-threaded I/O model improve throughput over classic single-threading?
Show more question and Answers...


Comments & Discussions