0

I'm developing for a game network (Minecraft) where we might need to run a large amount of game instances. When it comes to storing configurations, the first thing that comes to mind is to store them in a database, like Mongo, and have the game plugins read the JSON documents from there. While this way has a lot of advantages I started thinking of another approach embedding the config in the game plugin JAR.

These are some of the things I thought about for the "embedding config in JAR" alternative. Note that changing the configuration would be similar in both scenarios, simply pushing the config change to main. For the database alternative we would have a repository just for configurations, with the embed option you would push to the game plugin repository.

Embedding in JAR:

  • Easier to deploy updates since it makes it possible to run 2 versions (or any amount) of the game at the same time since they do not need to share a centralized configuration
  • Easier to develop since you do need all the internal networking (not needing to hook into DB) to test plugins, you can and develop and test on local host. Big time saver and useful for prototyping or early development
  • Due to plugin limitations, the game instance needs to be restarted to have the config change take effect, might be a lot of instances (Note that we would not be kicking players, just moving them to another instance, so do not factor in the "players kicked from network" as a disadvantage for this point)
  • No need to handle loading in configs on instance startup, something that could make instance startup quicker especially if the DB is having a slow day
  • No need for potentially more game logic to make sure a config update change doesn't take effect mid-game for someone (at least for match/round based minigames)
  • The game will technically still function and run if the database goes on fire. Buuuuuttt, this is not also fully correct since we need a lot of other things from the database like user data for settings, sending game statistics to DB and so on

With that said, in my situation, based on the factual pros and cons for both alternatives, does anyone on here have comments on a certain alternative?

Liam
  • 41
  • 1
  • 5
  • Do you think maybe your question is [opinion-based](https://meta.stackoverflow.com/questions/417476/question-close-reasons-definitions-and-guidance/417487#417487) ? – Abra Jul 22 '23 at 10:53
  • @Abra The goal with the post was to get help putting the factual pros and factual cons specific for my scenario together for the two alternatives, and from that be able to recommend one way over the other. With that said, the post doesn't need to be opinion-based if people can leave out their personal opinion and instead look at it from a factual side. Both alternatives have pros and cons that doesn't need to relate to ones opinion – Liam Jul 22 '23 at 16:57

0 Answers0