Chapter 14 checkpoint: a distributed key-value cache
Every question from this chapter’s lessons. Your first answer to each is the one that counts; afterward you can practice again as often as you like. Passing needs 75% right on the first attempt.
0 of 17 answered0 right on the first attempt
Question 1 of 17
Each cache entry is 270 bytes, and there are 10 billion queries a month. If every query were unique and kept, how much would a month add, in TB?
Answers within 5% count, in any unit you choose.
Question 2 of 17
Using 400 requests per second ≈ 1 billion a month, how many requests per second do 10 billion queries a month average out to?
RPS
Answers within 5% count.
Question 3 of 17
A client sends one Redis command, waits for the reply, then sends the next, over a link with a 0.5 ms round-trip time. At most how many commands per second can it complete?
commands/s
Answers within 2% count.
Question 4 of 17
What does Redis pipelining change?
Question 5 of 17
Which data structure does the primer’s LRU cache use?
Question 6 of 17
A Memcached server’s workload switched from small items to larger ones. Now it evicts recent large items constantly, even though plenty of memory sits in pages assigned to the small-item class. What is happening, and what fixes it?
Question 7 of 17
With Memcached’s default growth factor of 1.25, about what fraction of a chunk can be wasted in the worst case, as a percentage?
%
Answers within 5% count.
Question 8 of 17
A 1 MB Memcached page (1,048,576 bytes) belongs to the class with 120-byte chunks. How many chunks does it hold?
chunks
Answers within 1% count.
Question 9 of 17
Why is a Redis string of up to 44 bytes cheaper to store than a longer one?
Question 10 of 17
Keys are placed with hash(k)modN over 10 servers. One fails, leaving 9. What percentage of keys move to a different server?
%
Answers within 3% count.
Question 11 of 17
A cache uses consistent hashing with many points per server. Growing from 10 servers to 12, about what percentage of keys move?
%
Answers within 5% count.
Question 12 of 17
Why does libketama hash each server to 100–200 points on the ring instead of one?
Question 13 of 17
In Redis Cluster you need one multi-key command over a user’s profile and orders. How should you name the keys?
Question 14 of 17
Match each Redis Cluster reply to what the client should do.
Question 15 of 17
Three Sentinels watch a Redis primary, with the quorum set to 2. What does the quorum decide?
Question 16 of 17
A partition cuts the Redis primary off together with some clients, which keep writing to it. Sentinel promotes a replica on the other side. When the partition heals, those writes are gone. What bounds this loss?
Question 17 of 17
Put the steps of a Sentinel failover in order.
- It promotes that replica, and clients get
+switch-master - A Sentinel marks the primary subjectively down
- It picks a replica by priority, then replication offset, then run ID
- Enough Sentinels agree: objectively down
- A Sentinel wins a majority vote to lead the failover