Suphi's DataStore Module

I understood your method, but this is not what I seek I badly forumulate excuse me what I wanted to say is that when we insert a value in "codes(in the dataStore) bah the problem is that its reverifies not every time the dataStore so when I enter an example code ("Code"1) its tells me well “Redeem” but when I rerentre its me “Redeem” instead of "Code already reedem) and its adds the code in the code(dataStore)

I really apologize for the derangement

1 Like

If I add something to the template it adds it to dataStore.Value, but when I remove it from the template again, it doesn’t remove it from dataStore.Value. Is it possible to make a fix for this?

1 Like

I enjoyed your video comparing DataStore2 vs ProfileService vs Suphi’s DataStore Module and it was very interesting to learn about how each module’s method works and the pros and cons of them.

The API of the module is concise and the code is relatively easy to read compared to ProfileService. I also like how it’s built on newer Roblox technologies like Memory Stores.

I think the only thing holding it back is that the other modules are so old and have been deployed in massive games to the point where most people have confidence in them being battle-tested.

I attached a place file I used for testing the module and built a PlayerData module around it that utilizes both this module and ReplicaService together. It works perfectly but is there anything I should look out for by utilizing it in this way?
datastores.rbxl (98.5 KB)

Unfortunately that is not possible without you writing custom code to remove values

The reason why is let’s say you give the player a sword that is not in the template if the module removed things not in the template the player would lose there sword

So hopefully that shows why the module is not able to workout what things to keep and what things to remove

But if you want to remove something manually all you have to do after you have opened the datastore is dataStore.Value.Key = nil

Hey there! The datastore seems to work well from the tests i’ve made. But everytime i test my game this error pops up, i’m not sure what it means, nor what it can cause to my game.
The error code is the following:

MemoryStoreService: RequestThrottled: Recent MemoryStores requests hit one or more limits. API: SortedMap.Update, Data Structure: Bob/global/Good.

Just curious, if I set the data of a player like “dataStore.Value = “Test”” from one server and the player is in a different server. Will they get the data without having the other server having to close and save the datastore?

It’s a current bug affecting everyone right now.

No because the player in the other server will be using a locally cached version

in the advanced video I show how you can use Queue + ProcessQueue to communicate between servers you can also make your own communication system

Would you consider adding a third find constructor that takes a DataStore.Id as its sole argument? My wrapper (a word I am using loosely as I feel that I have added so much that “wrapper” does not properly describe it anymore) for your module is cross-state and I use DataStore.Id for keying items like Changed events I have been implementing. I can do the string manipulation in the wrapper itself, I just think it is a feature worthy of being a built-in.

Lets say I want to save if a player has an emote or a sword equipped through intvalues though the player that is cloned to the player to get an animation id, should I use this module or another module such as ProfileService?

Whenever I try to open a hidden datastore it says failed and the datastore value is nil. Am I doing something wrong?

both modules can work

you would simply do
datasStore.Value.Key = intvalue.Value

and

intvalue.Value = dataStore.Value.Key

to move the values back and forth

1 Like

what does the error say if you have the same key open already then you cannot open the same key twice

Thank you so much for this info!

Roblox has been having some problems in the past few days it should fix itself

Following up on this there have been some lighting issues so it seems like a lot of Roblox could be affected from this.

1 Like

How would i delete the save data of a certain user by chance?

1 Like

Simply set the value to nil

dataStore.Value = nil
2 Likes

Hey, I set up this module in the game my team’s working on and for some reason despite using the .new constructor it comes back up as “Locked” when i try to open it.
image

I destroy the datastore when the player leaves and use .new to create a new one when the player enters a new session, same way as you described in the basics video.


image

This only happens outside of Studio.

Looks like your trying to open the global store multiple times