1

My question is about a bukkit plugin.

I want to save data on closing the server. But I can't find the best way to save the data. all the data I want to save are strings. what is the best way?

using yml file saved in the server files or using database MySQL or?

Tanveer Munir
  • 1,956
  • 1
  • 12
  • 27

1 Answers1

0

Majority of Bukkit developers prefer YAML because of its availability which have made it standard to use, snakeyaml is included in Bukkit. If you write code that will be shared, such as open source or for a team of developers YAML is almost a necessity.

MySQL should only be used when the data needs to be shared between multiple servers such as a network. If you enter any network, for instance a minigame network, your player data is most likely stored in a database so you will have the same points in every one of their servers. Why not always use MySQL? It requires a connection to be opened which may fail, this means the server is dependent on another source which you usually want to avoid. MySQL is most times also slower performance-wise than other alternatives.

What about other files/methods? I've seen developers store data using JSON or even pure text files, claiming it's faster, but this should only really be considered if you have performance issues or generally prefer that file type.