Database Dilemma

Discussion in 'Spigot Plugin Development' started by PandaDevs, May 2, 2017.

  1. Do you like my alliteration?

    Anyways, I'm stuck between choosing mongodb and MySQL for database storage. As I'm not familiar with mongo, is there any reason for me to try it? Or should i stick with the Amazon storage that comes with my cloud server plan.

  2. Serializator


    What kind of data do you want to store in the database?
  3. i would go with MySQL
    • Agree Agree x 1
  4. Use what you're experienced with. I personally prefer MySQL because that's what I know and use. I have personally never used Mongo, and probably never will unless I have a job that requires it.
    • Agree Agree x 1
  5. overall, i see mongo being used for high load data transfer that is somewhat constant (a network for instance), and mysql to be used for minimal data transfers on occasion(a banning plugin of some sort, etc).

    there's also the storage type difference when using either or.

    mongo is more of a hashmap / json type storage system. (key & value)
    mysql is more of a relation based storage (column, row, identifiers, etc)
    • Like Like x 1
    • Agree Agree x 1
    • Informative Informative x 1
  6. Mas


    I personally prefer Mongo after working with it for a short while, after having experience with sql also.
    You will find SQL is probably easir to get going due to the endless tutorials, but once you get going it can often become a bit of a mess with statements and queries.

    As Mongo is document based, it is easier to quickly store and find data without having to manually write statements like "INSERT INTO table (something, something2) VALUESE (?, ?) WHERE thing = ?;". However with Mongo you can just make a wrapper class for Document and serialize objects into the database with ease.

    If you do decide to use Mongo, don't use the guide on the Spigot wiki. It's very outdated I'm deciding whether to rewrite it myself.
    • Like Like x 1
  7. Depends on the size of the project. I have a few years of SQL experience and I recently started using MongoDB. For my personal Minecraft server (it uses an enormous database), I felt like MongoDB was the way to go. I started designing the database in MySQL but it just came too big for my screen, it was insane. MongoDB isn't as strict as SQL so maintaining the database or "designing" something new can be done in seconds, especially if you're using a good API / core plugin.

    My advice: Small projects with SQL, large projects with MongoDB.