Small question:
Is there a performance difference between saving data as a table/dictionary containing all saved data and saving data under different subkeys using combine? Is one method preferred above the other?
I’m curious as I have a lot of data to save, like money, xp, level, bought tools, inventory and so on.
I tried switching to the new datastore2 script that you told us to download instead of using the free model one but some other players still lose their data although me personally doesn’t experience it. My game involves updating a player’s mileage by calling :Increment() every second through a remote event and at high speeds. And yes, my script references a couple tutorials out there by combining Alvin_Blox and other people’s tutorials although there’s nothing that teaches us when dealing with multiple stats and has a global leaderboard that updates every minute using a regular ordered datastore. I’m just tryna highlight some of the main processes that occur in my game involving datastores and idk which one of these causes it.
Incrementing every second is fine since it’s not actually writing to a real data store. I don’t know what to do with this much information other than tell you that it’s most likely a you problem.
Is it possible to use a normal datastore next to datastore2? Or could it throttle even when configured correctly? A use case could be having a seperate datastore for global game data such as events / purchase history
Hello @Kampfkarren,
Most of my players experienced a datastore2 loss data when they returned to the main lobby from the multiplayer place (sub-place) under the same game.
Datastore2 requires you to call an update function like :Set() or :Update() whenever the data actually changes and this is okay because the module caches. Are you updating ammo, or is it some other piece of player data?
DataStore2 is open source. If you want to contribute session locking, you’re free to do so. I have zero use case for it, so until I do I’m not implementing it myself.
@Kampfkarren I have the same issue. It would be better to call indepent saves on each of those values affected by data loss (2 tables and 5 values) or a full SaveAll() before teleporting?
EDIT: i put a SaveAll() before the teleporting and one of the tables didnt save for a user.