Self-test
Check your understanding
Self-test11 questions
What does a plain
SETdo to an existing TTL, and why does that matter undervolatile-*eviction?Why is
INCRsafe with 100 concurrent clients when read-then-write in the app isn't?When would you store an object as a hash, a JSON string, or a native JSON document?
Why does a small hash use less memory than the same fields stored as separate keys? What's the catch with raising the listpack threshold?
Why is plain
BRPOPan unreliable job queue? What fixes it?How does a sorted set make
ZRANKO(log N)? Name its two internal structures.How are ties in a sorted-set leaderboard ordered, and how would you make earlier scores win?
A HyperLogLog counts 1 billion unique visitors. How much memory, and what can't it do?
What does a Bloom filter guarantee, and what doesn't it? Give a good and a bad use.
Why does
MEMORY USAGEreport far more bytes than the value you stored?- Design question
Model an e-commerce product catalog in Redis: products, categories, price filters, best-sellers, and "recently viewed" per user. Name the type and key for each.