Saving data

Discussion in 'Spigot Plugin Development' started by Varmetek, May 16, 2017.

  1. When creating my plugins, saving data to YAML files is pretty standard and I could definitely say that I have a firm grasp of the basics The problem is with trying to EFFECTIVELY save the data. On my test project, I code challenges ranging from simple tweaks to entire game modes.

    After cramming all these challenges into one project, I noticed that I really needed to learn a more effective way of saving and loading various data. There is not only a ton of IO exceptions that one must be prepared for but also a contingency plan for when said data files are altered or corrupted. My current methods for handling data are just too clunky and slow down development.

    I'm here to ask, how do you handle the process of saving and loading data from configuration files? Hopefully, there is an easier and more productive method for handling config files.
     
  2. You could always consider (My)SQL, this way you can host the database on any drive you want, as well as cache it on a small but fast ssd with a slave database alongside the masterdb that takes read/writes.

    Small stuff, easy stuff, backups and flatfile storage within the plugin directory. Anything major that big-mc servers and performance requires attention: build to scale.

    i guess.

    Things like coreprotect are really fast, and i use flatfile for now, they are 2gb db files uncompressed and perform very well. I dont have to optimise it yet for my active servers.
     
  3. Interesting. I've never used SQL before.