So basically I’m making a kind of system where players can explore and donate random players, but only for those player who created their post. And to make this explore algorithm I need to save all players who ever created their posts. And I’m just wondering, will it crush/loss data, because I’m storing huge amount of data, basically here is example:
local Data = {
[1] = {
PostTitle = 'hello!';
PostDescription = 'Can you donate me please?';
Goal = 100; -- robux
-- some more misc info
} -- player userid
-- and etc.
}
And this data creates /updates when player creates/updates their post.
So I’m wondering: 1. is there better way? 2. Is it safe?
I’m greatful for any answers
EDITED:
Here is code I’m using to save this data:
PostDataStore:UpdateAsync("PostData", function(PlayerData: Enums.ExportedPostdata)
if PlayerData then
local UpdatedData = PlayerData
UpdatedData[tostring(Player.UserId)] = Data
return UpdatedData
else
return {[tostring(Player.UserId)] = Data}
end
end)
Thank you very much for your respond! But does profile service have such a tools for that? And how would I make it more perfomance using profile service?
Profileservice doesnt how any kind of compression however EasyDatastore does. I would recommend using EasyDatastore since not only is it a lot easier to learn but also can save more space.
However I am not sure if there is a specific method of datastore you could use, designed for such purposes, so I would keep looking.
If you do decide to go with a module, chose my datastore module: EasyDatastore!
I’m sure there are plenty of workarounds so that you don’t need to save huge amounts of data, such as making an expiration date for player posts, etc.
But if you don’t want to consider that, you must note that for regular DataStoreService, DataStores can only hold up to 4MB of Data (4 million Characters).
Follow the documentation first, make some basic structures or watch a youtube guide. Then try to save that data. You need to make modules to control data most people call it datamanager, then a template which is basically a table that holds all the data of the player. Here: Setting up - ProfileService
Get a feel of the module before shooting straight for your goal as PS is a bit more complex than most.
You can currently create datastores that includes 4,194,304 characters. It is very unlikely that you would reach this limit, so do not worry about this.
If you really worry about it, then I would suggest shortening your data names, so do numbers instead of names, and perhaps in string form so you can jump over numbers if needed? - This does so you can even jump over saving some type data if it isn’t used.
local Data = {
[1] = {
["1"] = 'hello!';
["2"] = 'Can you donate me please?';
["6"] = 100; -- robux
-- some more misc info
} -- player userid
-- and etc.
}
But again, very unlikely that you will ever reach this limit. This were the old method of doing it, when the limit were a few hundred thousands.
I would also suggest that you use Suphi’s data store over any other datastore module available. It is in my opinion just superior overall. Only thing missing is deep-copy reconcile, but no datastore module got that anyway as far as I am aware.