Should i use DataStore2 For shop system?

So basically i just found out that datastore1 can cause dataloss. And i’m afraid it gets to bad. So i’m wondering which datastore should i use for a shop system(Inventory to)

Roblox gives us DataStoreService to interact with the datastore

Datastore2 is a library(modules) that holds your hand in using Roblox’s DataStoreService so that you don’t make mistakes

this is what it looks like to use Datastore2

so the best thing to do is learn to use DataStoreService correctly then you will have the full power of the DataStoreService

this article can help you learn how to use the DataStoreService

Yes i do know how to use DSS but i’m scared of players experiencing dataloss. As like my datastores is good i only use 1 datastore(Using Tabels)
So i just wanna know if it would be alright to use DSS1

This is maybe not related to this question, But i know you from youtube, Can u make a full documentation about DSS. It would help alot.

there is no such thing as datastore1

there is just datastore

datastore2 uses datastore

if Roblox servers go down and datastore stops working datastore2 also stops working

datastore2 does not have its own servers where it saves the data outside of Roblox’s datastore

if you save the players data once every minute then if Roblox servers go down they will lose at most 1 minutes worth of gameplay

So should i use DataStore2 or is it not worth it? Like people teling me DS2 is much better than Roblox’s Datastore.

I would do what @5uphi suggested you to do. Learn how DataStoreService works corrently. Then you can control it. Using a module wont learn you anything Sadly.

here is the source code for datastore2

maybe if you read its code it might help you decide if you want to use it

and this is the part that saves the data into the datastore

also datastore2 was created before datastore got its large update and has not been updated since 2019 so it does not use any of robloxes new datastore features

It’s up to personal preference, however if you’re worried about loading data of offline players or item duplication I would check out ProfileService

Yes i do know how to use it. But i thought that Datastore 2 was to prevent dataloss. And datastoreservice sucks

i would say that ProfileService does have better features and i like how it more general purpose but at the end of the day they all are built on Roblox’s DataStoreService so they can only ever hold you back for instance if you wanted to have a datastore lock the same kinda way ProfileService does you can do something like this so you know if its safe to edit offline players datastore

game.Players.PlayerAdded:Connect(function(player)
    -- get the current time
    local currentTime = os.time()

    -- when the player enters the game try to load there data
    local success, value = pcall(dataStore.UpdateAsync, dataStore, player.UserId, function(value)
        if value == nil then return {} end
        if currentTime <= (value.locked or 0) then return nil end
        value.locked = currentTime + 60 -- the datastore will be locked for 60 seconds
        return value
    end)

    -- datastore failed to load servers might be down
    if success == false then return end
   
    -- if the value = nil that means the players data has been locked meaning it was loaded on another server
    if value == nil then return end

    -- player data loaded successfully you can use this data for upto 60 seconds
    print(value)

    -- set locked to nil before saving the players data to unlock it to allow other servers to load it
    value.locked = nil
end)

I do agree that you should learn how to use datastores before using any of these modules, however it’s only going to hold back your development if you’re trying to recreate them in production. There’s a famous saying that goes along with this, don’t reinvent the wheel