Data idea comments please

hi all, the game i am working on has a lot of master data and uses HTTPService and APIs to load a lot of data at the server start. (example i have over 4k data rows for crafting items, 800+ for weapons etc)

so to reduce the load on my data server at game start i thought perhaps do this…

Have a disabled script(s) file that holds master data in json format on ServerSide, once loaded into tables it(they) would be destroyed.

is this a good/bad idea etc.

1 Like

Couldn’t you just hold your data in a ModuleScript and store a version number? When a server starts you can periodically check the version number and if there’s a new version you can update it.

Also if you’re simply looking to update this data while the game is running you can use packages. Then you can use Insert service:LoadAssetVersion and InsertService:GetLatestAssetVersionAsync and use the same method to update the data.

1 Like

thanks for the reply, i did think about packages yes. I assume they are 100% secure, trying to avoid any exploit stuff. Using the disabled script was really just to use as a json file for the source that is loaded into a modulescript. That way i just dump from my api and add to script.source then the module loads it. I cant use StringValue due to size. I assume that putting directly into a Modulescript i would need to have as massive string or lots of table.inserts. Not been doing LUA/Roblox for that long so learning best ways to go about things. Thanks again for your input :slight_smile:

1 Like

If you’re using this type of data in scripts it has to be able to fit into a ModuleScript. You can do something like the following:

-- Example data Module
return {
 Data={
  Crafting = {},
  Items = {}
 }
}
-- Updater
DataModule.Data = jsonDataFromSite

Also packages are 100% secure, but ModuleScripts that aren’t in ServerScriptService and ServerStorage can be decompiled.

Your best bet is Packages probably. I wouldn’t worry about “too much data” unless it’s being sent to the client.

1 Like

thats pretty much what im doing currently, but was just thinking how to reduce the server stress (ever hopefull my game will be a hit ha ha) so your idea of Packages seems a good one for sure :slight_smile: i will have a look at using packages, Thanks for the tips, def going to research packages then :slight_smile: thanks again

1 Like

How are you storing the data? If its MySQL, are you doing queries every time you make a request to it?

1 Like

hi there, back end is MS SQL, with c# api called once at start of a server instance. I have an API now that dumps to a modulescript with table.inserts. so I can add to packages. I tried pasting into a script(disabled) the json. LOL Studio didnt like me after that. json was way to big lol but the table inserts are working fine.

1 Like

What do you even mean? Why not just have a script enabled with the data table to begin with?
What are you trying to accomplish and what is the issue?

the goal was to see if anyone had ideas on what i was thinking about to reduce stress on API calls to my web server for master (in game) data. So I was asking if putting json into a script was a feasible option (disabling it would meen it could have contained raw jason data with no errors).

I am sorted now with pre built module scripts, and packages.