Solved MySQL or save Data on servers?

Discussion in 'Plugin Development' started by Regenwurm97, Nov 8, 2013.

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

    Regenwurm97

    Hey!

    I never worked with MySQL before so I really...don't understand a lot arround it. I just regard it as some Kind of table like in Excel but on the Internet :D

    Anyway, the Problem is, I have a [PLAYERNAME].yml for each Player of my Server, saving Information like Money etc. So theres a Folder full of configs called "Hans.yml", "Peter.yml", etc.
    Now, as the server's growing, I want to convert it into a Lobby and create sub-Servers for different minigames. But well, the subservers all have to be able to get Information from the specific Player.yml when he connects and so, just saving it on the Lobby Server might not work :l

    I'd really love to Keep the .yml System as it works great but I think you can only save data in MySQL Databases globally can't you?
    Or did I totally missunderstood MySQL and could Keep the old System running on one Server and all subservers also could edit them?

    Sorry but I don't know very much about all that lol :D
    Hope you can help me, I already found a tutorial on MySQL here but (as said) don't really like this System (think I couldn't use (de-)serialization could I?)
     
  2. Offline

    Noxyro

    You can use files and MySQL globaly... there is just the question if your hoster allows external access. Most hosters only allow external access on MySQL databases - that's the reason why most people use it.

    Whatever... MySQL is the best solution for your problem... yes.
     
  3. Offline

    Regenwurm97

    couldn't I just save the files on the Lobby Server and if someone connects on a Sub Server, the Server gets the Players Information via a socket Connection?

    I think I'll try to Switch over to mysql now...the table structure is very usefull indeed!
    But is there any way to save serialized objects in there? Or would I have to store the variables in the table and then parse the corresponding values out again and set them to an empty player's object?
     
  4. Offline

    Noxyro

  5. Offline

    Regenwurm97

    Thx alot! :)
     
  6. Offline

    1Rogue

    SQLite would be a good solution for this as well, since it removes the network dependency.
     
  7. Offline

    NathanWolf

    You could stick with a YML file or SQLite if your sub-servers are only reading from the player data.

    If the subservers can modify the player data, then I think you'll need to go with mysql (or implement server synchronization yourself, probably don't want to have to do that!)

    SQLite will blow up if more than one thing tries to modify a table at the same time (I'm pretty sure), and YML files will definitely have problems with concurrent writes.
     
    CubieX likes this.
  8. Offline

    CubieX

    MySQL can be installed on any root server and many virtual servers also offer a MySQL DB.
    So you can use MySQL on your machine just like SQLite.
    The difference between both is, that a MySQL DB can be easily accessed even when it's installed on some remote server.
    But you can also install and use it locally.
    If you need a potent DB system, MySQL will fit your needs better than SQLite or YAML.
    Using MySQL is the best way if you want to access the same data from multiple local minecraft servers that are running on your root (or even when running MC on different physical servers).
    So if you want to have multiple servers later, I would stick with MySQL.
     
Thread Status:
Not open for further replies.

Share This Page