zset
zset, also known as a sorted set, is a data structure that stores a collection of elements, where each element is associated with a score. The elements within a zset are unique, but their scores can be duplicated. The primary characteristic of a zset is that its elements are ordered based on their scores, typically in ascending order. This ordering allows for efficient retrieval of elements within a given score range or retrieval of the elements with the highest or lowest scores.
Operations commonly supported by zsets include adding new elements with their scores, updating the score of