Static data storage

Hello there!

Im divided how to go about static storing data on the server. With static i mean data that wont change. For instance i have alot of blueprints describing entities (hp, dmg, etc…) or a pricelist describing prices of each entity in a shop and so on…

Atm im storing this data into a json file. Once the server is started it reads the file and build objects based on the blueprints.

I was thinking if this approach is a good idea or is it preferable to store this data in the storage engine aswell? In the future im planning to build tools to edit the blueprints, but nothing says that i cant post this into the database instead of read them to file.

Whats your thoughts on this?

edit:
To clarify, this is only blueprints. The objects state themselves are stored in the database. This just describes what properties each entity should have.

Hi @gruset,

Since it is configuration data, storing it in JSON and reading it once the server starts is perfectly fine. However, since you have mentioned you may in future build a tool to edit the data, you may consider storing it in the storage engine so that it can be modified directly, rather than requiring a rebuild of the server image (assuming you’re using docker containers) when the JSON changes.

I hope this helps.

@tom Hi and thanks for the reply.

Its a really good point you are making. I will consider that once its time for some toolbuilding! :slight_smile:

I must say, i do really appriciate you guys for being increadbly active on this forum - it really helps alot so thanks! :slight_smile:

1 Like