Datastore2 vs Firebase vs DSService

Hello, guys. I’m start another big project and I’m not sure what is the best data saving method to prevent data loss. I’ve always used standart datastore service. Can you tell me your opinions?

2 Likes

I’m just starting, but I’m using ProfileStore from loleris. Seen good reviews on it.

1 Like

I personally use Datastore2 and haven’t had any issues with it, although many uses also prefer ProfileService.
Profile service seems to keep the player from rejoining too quickly to prevent potential data corruption, although you would have to join REALLY fast for it to trigger

I use Profileservice and almost everyone i talk to uses it as well, its really great at preventing data loss and duping and it allows me to not have to think about saving data, all i have to do is change a value in a table and i can rest assured that the players data will 99% of the time save properly.

1 Like

I recomend using the datastore directly or Suphi’s DataStore Module

Suphi’s DataStore Module is still in beta but you can find documentation about it at Suphi’s discord channel

here is a simple example

-- Require the ModuleScript
local dataStoreModule = require(11671168253)

-- Find or create a datastore object
local dataStore = dataStoreModule.new("Name", "Key")

-- Connect a function to the StateChanged event and print to the output when the state changes
dataStore.StateChanged:Connect(function(state)
    if state == nil then print("Destroyed", dataStore.Id) end
    if state == false then print("Closed   ", dataStore.Id) end
    if state == true then print("Open     ", dataStore.Id) end
end)

-- Open the datastore session
local errorType, errorMessage = dataStore:Open()

-- If the session fails to open lets print why and return
if errorType ~= nil then print(dataStore.Id, errorType, errorMessage) return end

-- Set the datastore value
dataStore.Value = "Hello world!"

-- Save, close and destroy the session
dataStore:Destroy()

and here is a example for player data

local dataStoreModule = require(11671168253)

local template = {
    Level = 0,
    Inventory = {},
    DeveloperProducts = {},
}

game.Players.PlayerAdded:Connect(function(player)
    local dataStore = dataStoreModule.new("Player", player.UserId)
    local errorType = dataStore:Open(template) -- reconcile with template
    if errorType ~= nil then print(player.Name, "failed to open") end
end)

game.Players.PlayerRemoving:Connect(function(player)
    local dataStore = dataStoreModule.find("Player", player.UserId)
    if dataStore == nil then return end
    dataStore:Destroy()
end)
2 Likes

I would just recommend writing your own save system with Roblox’s DataStore system. You don’t need fancy modules. People complain that normal DataStores can risk data loss, but I’ve only seen that happen with poorly written scripts. It’s fine to use modules, but if something goes wrong and you don’t know why, now you have a whole foreign module to investigate. It’s also just better to know how to do it yourself first. As long as you use good save/load practices and stay within the limits, you’ll have no issues.

(While you can most likely trust the majority of modules, keep in mind that if you’re using require, they can easily update the code and sneak something malicious in.)

3 Likes

Guys, I’m talking about prevention data loss on roblox service disruption

there is nothing for you then.

But the Firebase (Robase) doesn’t even use Datastore service, why nothing?

If there is a service disruption then it is likely that HTTP Service will be down as well. So good luck sending your data to FireBase.

Why so toxic? If HTTP Service is down, it’s not gonna send data. It’s most likely going to rollback. If data store service disrupted in most cases, it wipes the data. I mean not wipes, technically, it’s loading the clear data save to current.

Plus, I forgot to mention. With firebase you can make backups of whole datastore. And I even wrote a simple python script to download a JSON data file everyday.

This is simply not true at all. Roblox tends to work in an all-or-nothing way in regards to saving data. So there is no chance for data loss in that scenario. If your save data is being overwritten and “cleared”, it’s your own code that’s doing that. In addition to that, I have never once had a single issue regarding Roblox’s built-in DataStore system. So overall, your statement is incorrect.

However, that is not to discourage external saving. HttpService has far less restrictions than Roblox’s DataStore system does. Now in 99% of cases, those limitations are irrelevant, but there are some cases in which they become an issue. The two that come to mind for me are the frequency limitations and size limitations (which very few games will ever have this issue), and the lack of cross-experience data sharing (which again, almost no game will ever need this). But even with the benefits of having an external database, keep in mind that you’re now using your own hardware or paying for a service to do it for you, both of which cost money. In addition to that, those are far more likely to go down from overload than Roblox is, especially if your game reaches any sort of relevant popularity.

In summary, unless you absolutely cannot use Roblox’s DataStore system for very specific edge cases, you should always use Roblox’s built-in DataStore system with the appropriate code (don’t save unloaded data).

You are right, but from what I know some popular games use external saving and there is no problem. If you are game reaches any popularity and you can devex the money. 5$/gb is not that big? Free plan can handle up to 200k unique users. The main problem with service disruption is that if it’s disrupted it won’t load you data. But when you leave it will put the clear data instead of your’s that did not get loaded. And you can’t really do anything about it, because you can’t check if player has data if service is disrupted. So game will treat him as a new player and will wipe his own data.

Again, that’s not true if you write your save system correctly. As I’ve said many times (not just here), do not save data that was not loaded correctly. This is why we use pcalls and see why the data didn’t load. Not having data and the service being unavailable are two different errors.

1 Like

I use datastore 2 because in about 10 lines of code I can save,load and set any value I want

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