Sets

Sometimes applications may require the ability to keep track of not just the frequency or log of events, but a list of unique items. For these scenarios, Redis has the set data structure. Sets in Redis are essentially unique lists of items.

For those times when a set of unique items needs to be presented in a specific order, Redis offers the sorted set structure. In this way, unique items are added to a set and ordered by a score. Check the Using Redis section for an example of using a sorted set from the redis-cli.

Get Seven NoSQL Databases in a Week now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.