Hi developers!
Just wanted to let you guys know I’ve documented my datastore system, it’s currently in Nevermore, but several other people have been using it.
Let me know if you have any questions!
Hi developers!
Just wanted to let you guys know I’ve documented my datastore system, it’s currently in Nevermore, but several other people have been using it.
Let me know if you have any questions!
Definitely using this in my roblox game!
How would you say it is different from Kampfkarren’s own system?
Good question!
Features:
Summary:
As another note, I have a lot of respect for datastore2, but I evaluated it as a solution, and it didn’t meet my needs (legacy system, safety, control over feature, minimizing API usage), so I wrote this one.
This could actually work quite well for a lot of people (especially with your claim you’ve made migration easier). I tend to minimally rely on third-party code on Rōblox though.
I can recommend this. I switched my current project’s DataStore system to this (third time in a week) a few hours after he documented it, and it’s so much nicer. Doesn’t freeze up Studio for nearly as long as the previous system did and the API is just perfect and understandable.
You can drop freezing down to zero by calling the :DoNotSaveOnCloseInStudio() API when in studio.
Going to migrate from Datastore2 to this just for the control, and the other bonuses are great too
(also the auto saving ValueObjects feature is epic)
Wow! This is really cool. I love the simplicity of the API compared to DataStore2. I can’t wait to use this in some upcoming projects I am working on!
To Quenty, great work on the module as always!
Quenty nailed most of the pros of his system, just some notes from my point of view:
:GetAsync
isntead of just :Get
).This doesn’t appear to support serialization from my reading of the documentations, something DataStore2 has over it.
There doesn’t seem to be a backup system, unlike DataStore2’s one line backup API.
To Quenty:
I’m not sure what this means in the context of comparison to DataStore2, which doesn’t make any API calls once the data loads. It seems both do the same amount of calls when you describe it as:
Most of that is copied right from the documentation. He listed pros of his system in general, not all was in comparison to your system.
Both of you do fine jobs of handling API budget limits.
I have a quick question if I load a table and store it somewhere else will it be autosaved?
local data = {}
dataStore:Load("items", {sword = true, sword2 = true}):Then(function(items)
data.items = items
end)
data.items.sword = nil
I’m assuming it does, but I’m asking to be safe
In this case, if you don’t write anything to the datastore, it won’t save it. So if you only load, the autosave won’t kick in. Also, if you request a flush to store, and nothing has changed, it won’t flush, or overwrite any data. So this helps with collisions on quick join/leave/rejoin.
Just to be clear, this was in relation to the berezza method.
Uhh. It might in VERY certain situations, but, but don’t do this. This is a bad practice. I assume a general no-modification of data going out, although this was designed with my usecase in mind.
Edit
I’ve been experimenting and discovered why doing that wouldn’t work myself, I was just confused because I’m used to having a module that stores all PlayerData tables, but that isn’t necessary with this system
If I call dataStoreManager:GetDataStore(robloxPlayer)
from multiple different scripts with the same player, will it return the same DataStore? Or would it return new instances of DataStore causing issues? Also, it seems that a DataStore has a self._maid
on it. Can this maid be used in custom code? Or is this only for internal use?
Same datastore for the player datastore manager!
Thanks for the response. My only other question is how would I handle using the same maid for player data across multiple scripts? Is this possible?
Edit: Also as far as I can tell, all data is saved under the same key. Is there a way to detect load failure for the entire key without using :Catch
on every single DataStore:Load()
call?
Edit 2: Do I have to use the same PlayerDataStoreManager in all scripts somehow?
I see that this system doesn’t use the “berezaa method” of retrieving data from timestamps in OrderedDatastore. I’m really interested in migrating back to “standard” data stores because I dislike the double API calls and suspect it might be redudant. But I don’t want to risk the data losses. Any thoughts or feedback from other people using your system on the stability? Perhaps compared to the “berezaa method” and DataStore2?
There’s also no “retry” function in place when an API call fails. Most DataStore systems I’ve seen has this so I’m curious why that is? Does it happen so rarely that it’s not worth handling those cases?
I’ve had no issues with data loss using this, It’s very stable and easy to use. It autosaves at an interval of your choice and only saves data that has been stored. Meaning if for some reason your “Money” doesn’t load it will not attempt to save your Money causing some sort of overwrite. In other words if you don’t write something to the datastore then it won’t attempt to save it (as stated above). This uses Then/Catch promises to handle the API calls so if for some reason :Load() fails it will go to the “Catch” and you can handle the error however you please.