Which data store should I use

I am adding data store to my game right now and it’s the first time I am working with data store so I am a little new to it. I heard about a module called data store 2 that is very reliable, but I also heard that there can only be 2 keys, not really sure if it’s true or not but I need more than 2 so if it is true this won’t work. I already have regular data store in my game and it works fine, so unless regular data store loses data often is there really any reason for me to use data store 2?

1 Like

If you’re going to just be using two keys for your datastores, then you can use DataStore2 (that’s actually funny how the name literally has 2 in there, kidna ironic). Unless, if you’re planning to have TONS of keys for one DataStore, then it’s best to use the regular DataStoreService.

For a quick explanation of both of them:

Some examples include:

DataStoreService

You have an adventuring RPG game with a leveling system, coins system, player’s body stats and also to keep the weapons/inventory that they’ve had.

What DataStore you should use, is DataStoreService since it requires you to have more than two keys, BUT the disadvantage of this than the DataStore2 is that it would receive data loss for the amount of keys it has to save. You can use DataStore.AutomaticRetry, but even in the documentation it says that

  • "DataStoreService does not respect this property because automatic retry has been disabled due to technical reasons,"

which would mean you have to set up your own retry system to prevent any data loss.

DataStore2

Say you have a simple platformer type game that would save the amount of levels they have beaten and just the amount of lives that they have before they lose the game.

In this case, you would use DataStore2 because it’s saving nothing more than 2 keys. And because of this, the player wouldn’t receive any data being loss when they play the game since, it saves the data without data loss, caches, and even verifies the data before saving.

What you wouldn’t want to do though with this is create too many DataStore2’s, as it would eventually become too many DataStores for the roblox to queue. Therefore, it may even become a data loss, just hypothetically speaking it may not be true.

I would recommend for you to do your own research, but I DO hope this helps you decide whether you should use DataStores or not.

1 Like