How it works...
When you are going to design an application with Redis, one thing you should bear in mind is that there isn't always only one data type that can fit your business scenario. That means different requirements for storage and query performance lead to different designs. Your job when designing is to dig out which data type is best for you via various prototype verifications as in the previous example.
In this example, first we make a basic design, which is a simple mapping of a key to a value per attribute of a user. We do this in the first step as a baseline of the memory usage for the follow-up reference.
After that, we try to reduce the memory usage in two different ways. One is trying to reduce the number of keys. The reason ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access