I generally use physical storage for data both the server and client share. The server automatically replicates the values of things to clients, so it removes the need to use remotes to replicate those changes.
You’ll still have to use remotes for client to server though.
It’s up to what works best for you. The only two advantages I see to the module-based approach are slightly less overhead and that it is more searchable. Instead of having to navigate to a given folder you can search through all the code in your game using the find dialog to quickly look things up.
I heard from somewhere (not sure how true it is), that it is safer to save data in modules, like the second example. Not too sure if it matters or not.
Thank you all for the feedback. I think I’ll stick with physical storage for now as it’s not worth the time converting to modules but I think for the future I’ll start using modules - both for the reasons TheGamer101 pointed out and because it’s a bit easier to edit long descriptions (e.g. for quests).
As long as you store your important data, scripts, items etc on the server then your work will be safe - modules wouldn’t make a difference in this situation. Most developers store values like gamepasses, animation IDs, etc in ReplicatedStorage so they’re easy to view for both client and server.
Instances will Always take up more Memory than Code Stored inside a Script.
My Mentor said
Objects use a lot more memory than a hashed table
You have to remember
Some players are using a toaster
so they don’t have much free memory
You should always try to keep memory down
Think of Storing Money as an IntValue in every Player, if your Server has 100 People that’s 100 of them right? and if it’s not inside Leaderstat for the Leaderbroad then you are wasting a lot of memory.
In other words it’s better to not show the Client (and Server) what they don’t have to see
That’s a good point, especially as you mentioned for things like datastores, but it shouldn’t be so much a worry in this case as I’m only storing a small, set amount of variables.
You (or your “mentor”) wildly overestimate how much a basic Value instance takes in memory. It’s miniscule compared to everything else. Also, the parent of the Value doesn’t matter, leaderstats or not it’s still the same, very small amount of memory.
For datastores I store my values in a module, but in this case I’m only using a small amount of static values which would take up hardly any storage.
Up to preference, but I personally would use a module over values when it comes to the system your referenced in the OP, simply because it leaves me with more options.