February 2018
Intermediate to advanced
382 pages
11h 33m
English
With the help of the Sorted Set in Redis, we can easily implement a leaderboard. As we have shown in the Using the Sorted Set data type recipe in Chapter 2, Data Types we can create a Sorted Set of restaurants; the score of the Set is the user vote number. Therefore, the ZREVRANGE command returns restaurants by popularity. The same functionality can also be implemented in an RDBMS such as MySQL, but the SQL query will be much slower than Redis.
Read now
Unlock full access