Can Datastores Handle Shutting Down All Servers?

Hypothetically speaking… If I have a urgent game update and I need to shut down all the servers, can Datastores handle saving for example 10k players worth of data at once?

I have my current Datastores only saving/updating automatically once every two - five minutes for every player. And on player exit a mandatory Datastore happens. Will I receive an angry mob of player messages later?

I don’t think I’m exceeding the limits in this case according to the Datastore limits page.

It can. Your server maximum size might present an edge case however in which you don’t have a sufficient amount of DataStore requests available.

Realistically, when a server closes, you’re only using a single write request per player to save their data. You certainly won’t exceed the server limitations this way, unless your method of saving data throughout the game is bad. A 2-5 minute auto save interval shouldn’t hamper on your budget much.

As for limitations across the entire game (all your game servers), they aren’t well documented. They simply call for best practices in not modifying a single key often across servers. Since player data is held in unique keys (hopefully you’re saving tables of data to UserIds), the Developer Hub says that it’d be highly unlikely that you’ll hit global limits.

3 Likes

Thanks that is really helpful. I am saving the data in tables using unique player-ID keys.

Considering limitations across the entire game, I feel like shutting down all the servers with 10k players will be such a computationally expensive moment that some Datastores might be queued and processed maybe a few minutes later. If that’s the case I can imagine players spinning up new servers in that time frame, which poses opportunity for single key modification.

I guess it all boils down to how sharp my code is… pcall everything

But you can never be sure, that the DataStore will be saved.

Thats right, imagen if the DataStore doesnt save in that time frame and the player already joins another server then his data will be overwritten by :SetAsync() and the data will be lost for ever. Therefore I recommend switching to DataStore2.

1 Like

Good suggestion. Im just now learning about the module. Might as well not reinvent the wheel.

Seems like a good idea :wink:

DataStore2 is the best way to save data, many big games use the module or their own system that is very simillar, for example, bereeza, cindering, ForeverHD…