(mongodb) database player layout

Discussion in 'Spigot Plugin Development' started by Franz-san, May 29, 2016.

  1. hey,

    im using mongodb and thinking about my layout right now.

    say I have 2 servers, rpg and creative.
    the rpg and creative have data that is not relevant to the other.

    should I do a central player collection, which contains all data or partition it into players, rpgPlayers and creativePlayers, with each of them having only their relevant data?

    not sure about this, I would like some input
  2. Tux


    My advice: never use MongoDB unless you'd like your data sucked into /dev/null without warning.

    I'd probably do separate.
    • Agree Agree x 1
  3. Tux


    Okay then, let's start:

    MongoDB responding poorly to downtime: https://aphyr.com/posts/284-call-me-maybe-mongodb
    MongoDB providing inconsistent data: https://aphyr.com/posts/322-call-me-maybe-mongodb-stale-reads
    A word about the mentality of MongoDB evangelists: http://www.mongodb-is-web-scale.com/

    MongoDB can only really achieve high-performance by skimping on everything (at one point, the MongoDB library returned from a write operation although the request was still waiting to be flushed out of a buffer).

    You should evaluate a data store based on the properties it provides. MongoDB is the one instance where I must say "never use unless the situation really calls on it".
    • Agree Agree x 1
  4. +1, don't get stuck building your infrastructure on mongoDB, I regret the decision 100% and wish I would have spent more time investigating other solutions such as postgreSQL.
  5. so postgre or mariadb ?
  6. A simple google search would tell you that. Mariadb is a fork of mysql. Also postgre has features that maria/mysql doesn't have. Take a look yourself.
  7. ...
    he's clearly having experience that I dont have.
    besides I can hardly find anything related to postgresql and spigot/minecraft servers
  8. MariaDb is a great solution. I've been using MySQL since I started programming and have never had dataloss or bad performance. Hell i execute millions of inserts in seconds, and query a 10gb database in milliseconds.
  9. 4chan


    I use MongoDB.
    • Winner Winner x 1
  10. I didn't mean it this way.
    I meant for bench marks, additional functions and comparisons.
    Also, it doesn't matter of you cant find anything Minecraft related since you're going to store strings, integers, booleans etc; you should rather look up how to use postgre with Java :)

    Any particular reason you don't want to just go with MySQL?
  11. I generally just pick the best fit. If your data fits in SQL, go for it. If it doesn't, pick the storage that fits best.
  12. Depends on how different the data is between the two. Do you have any comon grounds between the RPG player and the creative player? If not, it would be more normalized to just create two totally different tables / databases.
  13. Serializator


    At the end it is simply a matter of what you like the most and what database fits your needs.

    If the time to query a MySQL database is greater than the time it takes to (example) query a MongoDB database you should probably go with MongoDB and vice versa.
  14. I don't think to you'll lose any data with MongoDB. I choosed MongoDB too for my new server project. MongoDB has a safe write option. So, I'm prefer to see MongoDB good or bad myself.
  15. Tux


    MongoDB has had a long history of having data losing bugs, some even catastrophic.
  16. mysql is by oracle and when I get myself into SQL I would like to start with the best DB. im more inclined to use Postgre, sounds good. there is also a java driver, it should work from first view.
  17. no. what they have in common would be in the player table/collection
  18. I would go for MySQL. Unless you need advanced functions to execute over loads of records.

    Have a read. You'll come to a conclusion yourself after having a look.

  19. 4chan


    Hypixel uses MongoDB. Seems fine with them.