Datastores vs Datastore2

I had a couple of previous posts on datastores and people kept recommending that I use Datastore2, however it was my belief that this had been effectively made obsolete by updates ROBLOX made to their in-house datastores a few years ago.

I brought this up multiple times in said posts and never got an answer, so while I am undergoing a restructure of my datastores I figured I’d make a dedicated post asking about this.

Is there a difference? Is datastore2 better to use, or is it obsolete like others say it is?

2 Likes

I recommend using Datastores since it’s always going to be fully supported by Roblox, but really in general just pick a system that meets the requirements for what you are trying to do

Datastore2 is obsolete and a pain to use. Stick to vanilla datastores, or more preferably ProfileService

1 Like

not to advertise but there is always EasyDatastore too…

datastore2 can still be used, however i do believe you should start moving away from it onto something that is still kept up to date like profileservice.

The only danger with using regular datastores is that you have to implement safeguards for loading and saving errors by yourself, and if you’re not particularly good at that then you can suffer from data loss

I believe if you learn effective error handling, implementing try & catch with a library like Promises, then you don’t really need a datastore library

It’s not obsolete or a pain to use (I find it much simpler than most libraries.) DataStore2 is still very battle-tested as a wrapper. The original idea of using its OrderedDatastore method is flawed, but the library is still usable by setting the data saving method to “Standard” which uses the default Roblox method.

I suggest you use Suphi’s Datastore Module or ProfileService as those are probably the best ones available now and are actively updated.

The problem is that there are too many edge cases that most developers aren’t going to catch when writing their own DataStore scripts.

A handful of issues include:

  • Server hard crashes (no auto-saving periodically)
  • Avoiding saving data when the player leaves if their data was never successfully loaded (I see this almost all the time in this section)
  • Session-locking (two servers can read/write datastores at the same time. One might receive an older version while the other receives a different one)

ProfileService and SDM address all of these. DataStore2 uses the player object which might work for session-locking, though I am not totally sure.

I suppose this is ProfileService, just to make sure I’ve got the right thing?

Yeah, that’s the one. I would also give Suphi’s DataStore Module a chance as well. It’s sort of the “new kid on the block” but it’s a great module and he made a very detailed video breaking down the pros and cons of each module:

I’ve used it for one of my games and haven’t found any issues with it yet. Its session-locking logic is also much more efficient than ProfileService because it uses Memory Stores.

both are mid. you should just use profileservice, it’s more reliable and easier to use

I don’t know how long it will be until this is released, but as a heads up, there appear to be plans for a new service built specifically for saving User Data (UserDataStoreService), which, according to a Roblox Staff member, may end up having built-in support for:

  • Session locking
  • Periodic writeback
  • Automatically handling GDPR Requests
  • Integration with Roblox services such as Analytics
  • And probably a lot more!

So when it comes to the long-term, that new service may become the ideal option for saving user data. In the meantime, it’d be best to weigh the opinions presented throughout the other replies here to see if anything that was mentioned aligns best with your use case.