Memorystoreservice Hashmaps returning empty pages

MemoryStoreService Hashmaps seem to be returning empty tables seemingly at random. This happens even when manually putting single entries into a new key. This causes us to have to do many extra requests causing us to hit out API limits.

Expected behavior

I would expect hashtable pages to return the max amount of entries each page, rather then returning empty tables.


The Prints from the script

1 Like

Thanks for the report - just sent this over to the team! We’ll update you as soon as we can. :slight_smile:

Hello, there is no guarantee that hash maps will not return empty pages. There is more documentation on hash map partitioning here: Partitions and Data Distribution | Documentation - Roblox Creator Hub

How many keys approximately are in your HashMap?

For hash maps we allocate data to multiple partitions rather than one, when you call list we will read all partitions. Although we try to avoid empty partitions there is no guarantee. If your data structure has under 1000 keys you can hit empty partitions, therefore empty pages more frequently. I would recommend you to switch to SortedMap for use cases under 1000 keys.

I see, we currently use a few hashmaps. We use one batch for handling the serverlist of each of our worlds, and one for handling our ranked lobbies. I’ll swap to sortedmap for the ranked lobbies as they won’t hit 1000 keys.

1 Like