Confusion about datastore limits

Hey so I’ve been developing for a while now and I’ve always been terrified of using datastores because I don’t fully understand the limits. I’ve done countless research but still can’t really figure out what the limits are specifically for, and I definitely don’t wanna take any chances with losing players data.

My question is: Do datastore limits only apply to how many times data is requested or are there also limits to how much specific data you can store? Like if a player had an insane amount of different items in their inventory would that create problems with saving or would it only apply to how many times I’m saving this data and not how much there actually is to save?

2 Likes

Read about datastore limits here.

The limits apply to all requests (:Get :Set and :Update). To avoid capping out, I would suggest using an autosave routine that saves the player data every minute (preferably 3-5 minutes) and then again allow another save when the player is leaving the game.

In terms of your question about inventory limits, you can read those limits in that page mentioned above.

As advice, a good structure is to have a local data structure (array in server, folder with values, modulescript with values) that is set when a player loads in, then periodically upload those local values. You don’t need to be grabbing the values from the datastore after a player loads into the game unless it’s a special case like real-time updating stats and such.

1 Like

ProfileService literally saves every 30 seconds and doesn’t have issues with overall DataStore limits. This number is changeable, of course. My DataStore solution is similar to ProfileService and auto saves every 60 seconds instead, mostly because I’m annoying. But I would change it to 30 if I wanted to.

Session-locking is epic, you should look into it. B)

Anyhow, the biggest problem is the per-key throttling. You can use write requests, (SetAsync, RemoveAsync, UpdateAsync) as much as you want, of course, reasonably, however, if you write to the same key with an interval smaller than 6, it will queue it’s calls and “throttle”.


If you don’t, don’t worry. For the most part, they’re not too strict, you can write a lot and not throttle. This shouldn’t be an worry.

If you’re doing an auto save system however, don’t auto save EVERYONE’s data every certain amount of time, instead start a thread (spawn, Coroutine, whatever) and then save that person’s data every 30/60 seconds.

That ensures most calls are not being called right in front of each other.

About the size limit, it’s 4MB currently, so um… yeah you don’t need to worry, I’m pretty sure the entire BadgeService3 module is 0.01MB or something, and it’s a big enough file.

Hmm I should create a script saver using datastores B)

1 Like

These helped a whole lot thanks so much for clearing that up for me guys :smile:

1 Like

By the way, yes. There are limits both for writing and for getting data.

1 Like

im not sure with datastores limits but ive made a changing multiple part color it has only 200 max limits