Datastore sent too frequently on datastore2

Thanks! I really appreciated ! so the causes of warning are moneychanged ?

1 Like

Alright thank you for helping me i try it , and im gona make sure it runs well

Alright thanks for the info , later i will try it

1 Like

Yes, the money.Changed event might cause too many DataStore requests if it’s connected to a function that writes data to the DataStore every time the money changes. Since a player’s money can change very often during gameplay (e.g., whenever they earn or spend money), writing to the DataStore every time this happens can easily lead to exceeding the DataStore’s rate limits.

but it happens when tons of player join at the same time , i have played with my friends while game went private but got no kind of warning , when i public-ed it , warning occur . i heard from my friend he said that you dont have to care bout money.changed since it will save anytime it want . idk if its true

The issue you’re facing is indeed a common challenge when designing systems that handle many users concurrently. The sudden spike in player joins can lead to a burst of data-saving attempts, which can overwhelm Roblox’s datastore system.

As for the money.Changed event, your friend is right to a certain extent. However, it does depend on how your game is set up. If you’re saving the player’s money to the datastore every time it changes, this can lead to a large number of datastore requests, especially when many players are interacting with your game at the same time. If many players join your game at once, and they all start earning money quickly, it can cause a large number of datastore write requests.

Here are a few ways to mitigate this problem:

1. Cooldowns or Delays: Implement a delay before saving data. Instead of saving immediately on the money.Changed event, you can start a countdown (say 1 minute), and then save the data after that. If the money changes again during this countdown, reset the timer. This way, you’re only saving at most once per minute, per player.

2. Queueing: If you’re dealing with a lot of requests, you might want to consider implementing a queue system. This can help you manage large numbers of datastore requests by queuing them up and processing them in a controlled manner.

3. Batching: If possible, group several changes together and save them all at once. This can significantly reduce the number of requests made.

Remember to also utilize pcall() when dealing with datastores to catch any errors that may occur, including rate limit errors. If an error does occur, you can retry the request after a delay.

1 Like

Great to hear , i will try it !

1 Like

thats what this loop setup does in this script only saving data that has changed

good luck with all this saving data can be tricky but once you understand its all good

1 Like

I SEE ITS NOT NORMAL DATASTORE PROBLEM , THE PROBLEM IS FROM DATASTORE2 IM SO DUMB . yeah i really wasted my time by spending on old data . and if i gave up willing to use yours

Idk wat to say cause both of u , i fnally managed to fix it :grin: thanks :grin::grin::grin::+1::+1::+1::+1::+1:

2 Likes

yeah datastore2 is not a very good system in terms of not losing data it is very picky on keys etc so if anything is changed or you need to adjust it can cause you to lose data…

I learned this the hard way from a few games I had to migrate off of that system

1 Like

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