Help with MemoryStoreService

Help, I recently saw a tutorial for a Pet Simulator-style storage system or something like that. The system includes several scripts, but it uses a service I’ve never seen called “MemoryStoreService.” I used to work with DataStoreService and recently started learning ProfileService. However, I can’t understand this MemoryStoreService and those “Maps.” They don’t appear in the “DataStore Editor” Plugin. The Plugin I used to delete incorrect data while doing tests now has data or strings of characters that I deleted from another Script Module that contains all the characters inside the “Map.” However, they are still detected inside the Map because their names are transferred to a StringValue. Finally, the error is that a script tries to find the names of the StringValue values ​​inside the Script Module, which shouldn’t be the characters I deleted, but that’s what happens.

Sorry for the lack of samples, the scripts are very complex, there are many scripts and they are all very large, but I tried to be as clear as possible so that it can be understood. And if it is necessary I will try to upload more samples

Hey @GamerTotal_YT ,

MemoryStoreService is different from DataStoreService and ProfileService. It’s meant for temporary data that exists only while your experience is running. Think of it like in-memory communication or caching. Once the server shuts down, everything in it is gone.

So if your tutorial is using MemoryStoreService Maps, it’s probably doing something like:

  • Storing temporary player queues, pet trades, matchmaking states, or live data that doesn’t need to persist.
  • Using .SetAsync() and .GetAsync() to store and retrieve items from MemoryStoreSortedMap or MemoryStoreQueue.

That’s also why you don’t see it in the DataStore Editor plugin. MemoryStore data doesn’t persist, and it isn’t part of the same system.

As for the string values still being found, it sounds like your script is still referencing names from an old copy of the module or isn’t clearing the MemoryStore keys properly. If a name is being inserted into a StringValue, and then the code later looks it up in a ModuleScript that no longer contains it, you’ll get that mismatch.

Check for old StringValue instances still existing in the workspace or whether you’re clearing MemoryStoreMap keys after removal with something like memoryStore:RemoveAsync("SomeKey")

And if the script is referencing the wrong module instance (maybe it’s cached or cloned).

If you can share a snippet even just the part where the data is being written or read from the MemoryStore that would help narrow it down.

4 Likes

Thanks, the problem was the RemoveAsync, there is literally none, I had to put one right below the Local map creation, something temporary just to remove the old bad data from the characters I removed, I saw the system and it doesn’t need to be removed, it just updates itself every so often, and I broke it by removing the characters from the Module Script that still had their names in the Map, making the whole system break, well at least I understood something like that, I just had to put a temporary RemoveAsync to remove those names and now it works correctly, and to remove another character I just have to wait for its name to not be in the Map

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.