YAML VS SQL

Discussion in 'Bukkit Discussion' started by DuoDex, Jan 14, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    DuoDex

    What are the pros and cons of YAML and SQL? A lot of people on the Bukkit Help forum seem to have trouble with one or the other...

    Any ideas are appreciated, since I have no idea. I'd just like to discuss the features and downfalls of each.

    Note: I don't need help with either, I'm just wondering which is "better" or "worse".
     
  2. Offline

    hubeb

    DuoDex Personally I like YAML, because in my opinion it is easier to setup. But SQLite is also pretty good.
     
  3. Offline

    robotnikthingy

    MySQL can be a pain, especially when it comes to users of your plugin who may have no idea how to set up a mysql server. sqlite is pretty good though
     
  4. Offline

    DuoDex

    Thanks!
     
  5. Offline

    Zeluboba

    DuoDex I think that using YML as database is bad idea.
    Also, depending on plugin it can use MySQL, if it's own data should/can be used at website, maybe. Also, giving user a ability to use both MySQL and SQLite is good too. :)
     
  6. Offline

    Maximvdw

    As my developer point of view, I think you should choose for yourself:

    1. YAML: Use Yaml or flatfiles to store small data, excellent for configuration or things that do not need to change often. I recommend to use this for one time setups like arena setup in a minigame, ...
    2. SQLite: Use SQL to store small data that can not be seperated (tables that inherit , etc). Large .db files will cause lagg on read write. F.ex. If you change something in a 300MB .db file of a logging plugin, that file has to be written over and over again. Do not use it for logging or statistic plugins.
    3. MySQL: Best option, do not use mysql for just a bit of data. MySQL requires a connection that takes (a bit) time. Table structures are stored in seperated 'chunks'. Query's can be made fast.
    So about performance:
    Example: Economy plugin
    The plugin just stores how much money you have.
    When using flatfile the plugin will save a seperated file for each person. If you haven't got a lot of players this is a good option. Every time you write small files.
    When using SQLite the plugin will have to save a file with ALL the users each time. When you have a large file this can lagg your I/O.
    When using MySQL it will have the query speed of SQLite and the save speed of flatfiles. However if the plugin is badly coded and open/closes the connection on every query, this can be slow.

    My advise:
    • Warp plugins: yaml or SQLite (mostly you dont have much warps)
    • Home plugins: MySQL or yaml
    • Logging plugins: MySQL without doubt - I've seen people using CoreProtect (bad plugin btw) with a sqlite file of 3 GB, they were wondering why they were getting lagg...
    • Plugins that temp store cache (killstreaks etc): SQLite
    • Player information (ip, etc): Yaml (quickly accesible {PLAYERNAME}.yml)
     
    Chr0mosom3 likes this.
  7. Offline

    DuoDex

    Thanks! This is sorta a comprehensive list of what's what.
     
  8. Offline

    Bobcat00

    Another way to approach this is to use whatever the plugin has set up as a default, or the recommended setup in the plugin instructions. That way you're using whatever the devloper most likely uses and tests with. This is also what most other players will use, so any bugs are more likely to be found.
     
Thread Status:
Not open for further replies.

Share This Page