We’re back with another collection data type: Sorted sets!
Blog post from Momento
Sorted sets have been introduced as a new collection data type (CDT) by Momento, adding to the previously released dictionaries, sets, and lists. This CDT allows for the creation of ordered arrays of distinct elements based on numeric scores, automatically updating as elements change. In the multiplayer game Acorn Hunt, sorted sets can be utilized to manage leaderboards by tracking players' scores and automatically updating rankings as players collect acorns. They can also support rate-limiting features, such as limiting players to three uses of a special ability per game by decrementing scores and removing players from the set when their limit is reached. Additionally, the sorted set API offers versatility for various use cases beyond leaderboards and rate limiting, with commands to manipulate sets and manage time to live (TTL) for cached items. The feature is available in the Go SDK and supports multiple programming languages, enhancing developer experience by responding to user feedback.