Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question PocketMine and MySQL

Comments in 'General Discussion' started by DovahDoVolom, Oct 19, 2014.

  1. DovahDoVolom
    Offline

    DovahDoVolom Active Member

    Joined:
    Nov 29, 2013
    Posts:
    76
    Minecraft User:
    DovahDoVolom
    I've noticed that PocketMine plugins are starting to use MySQL... SimpleAuth and one I am using from ProjectInfinity. Why doesn't PocketMine use a database for player data or as my dad thaught a database for worlds logging each block and their location. (With his programming he has had databases with millions of entrys)
    EvolSoft, Smarticles101 and LDX like this.
  2. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    You want to wait even longer for 1.4?
  3. codmadnesspro
    Offline

    codmadnesspro Notable Member Plugin Developer

    Joined:
    Sep 11, 2013
    Posts:
    552
    Plugins:
    1
    Minecraft User:
    Codmadnesspro
    This maybe could be a improvement after 1.4 is finished.
  4. DovahDoVolom
    Offline

    DovahDoVolom Active Member

    Joined:
    Nov 29, 2013
    Posts:
    76
    Minecraft User:
    DovahDoVolom
    If it means better performance then yes....
    codmadnesspro likes this.
  5. williamtdr
    Offline

    williamtdr Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    23
    SQL-based database servers actually doesn't work nearly as well as you'd think. It's awesome if you want to sync data, such as member information for a website or such. I use it as a backend for player authentication and the like. 1.3 actually ran an SQLite server and used it pretty heavily for tracking player movement and such. But nothing's faster than the native objects, arrays and such in RAM.
    iJoshuaHD and Smarticles101 like this.
  6. DovahDoVolom
    Offline

    DovahDoVolom Active Member

    Joined:
    Nov 29, 2013
    Posts:
    76
    Minecraft User:
    DovahDoVolom
    But it would still be great for player data. All of the fields could be editable like the X,Y,Z location, inv/armor slots, gamemode, yaw, pitch, time last online, the user name... it would overall just be easier to manage
  7. williamtdr
    Offline

    williamtdr Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    23
    @DovahDoVolom That's not really practical, as every single time someone moved, changed their inventory, gamemode, viewport, etc, there'd have to be a call to the database server to update it, instead of just changing a property of an object. All those calls would add up extremely quickly. At the moment, Entity ticking is more than double everything else in terms of how much of the tick cycle it takes up, so adding an SQL layer of abstraction would make the problem much worse. Also, even though everything is stored in the database, you couldn't change it using an easy to use GUI such as PHPmyadmin's frontend, because the values would change before you could save it. An event would also not fire, so you'd have to wait for the server to check the database before any of your changes to take effect.

    Side note: 1.3 stored data in yaml files, and that was awesome. No idea what witchcraft 1.4 is using, but it sure isn't modifiable by humans anymore. Sigh.
    iJoshuaHD and Smarticles101 like this.
  8. DovahDoVolom
    Offline

    DovahDoVolom Active Member

    Joined:
    Nov 29, 2013
    Posts:
    76
    Minecraft User:
    DovahDoVolom
    Yeah that is why I was wondering darn DAT files.
  9. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,434
    Plugins:
    14
    Someone doesn't like PocketMine 1.4. XD

    I only use dat files when I don't want people to edit the data in a text editor. :p
    Darunia18 likes this.
  10. williamtdr
    Offline

    williamtdr Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    23
    @LDX It's a love/hate relationship. ;)
    MegaSamNinja and LDX like this.
  11. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    LDX likes this.
  12. DovahDoVolom
    Offline

    DovahDoVolom Active Member

    Joined:
    Nov 29, 2013
    Posts:
    76
    Minecraft User:
    DovahDoVolom
    Thanks for answering my questions guys! I just like throwing ideas out and maybe one will be good XD
  13. ProjectInfinity
    Offline

    ProjectInfinity Active Member Plugin Developer

    Joined:
    Sep 7, 2014
    Posts:
    112
    Plugins:
    3
    Minecraft User:
    ProjectInfinity
    1.4 is far better for developers, there's no doubt about which one is the best version.

    As for the rest of this thread, SQL databases are nice, but the concept of "database comes first" is detrimental to server performance.
    In an ideal situation where SQL databases are useful is when you have thousands of blocks to record every minute (imagine 30-40 players breaking blocks at the same time) and you queue them. Iterate the queue and insert them asynchronously to the database.

    This is essentially what plugins such as Prism for Bukkit does and it worked wonders without affecting server performance.
  14. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    95
    Plugins:
    2
    Minecraft User:
    ekifox
    $db = \mysqli('fg','fg','fg','fg');
    LDX likes this.
  15. williamtdr
    Offline

    williamtdr Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    23
    I agree, that for developers, 1.4 is amazing. It's consistent, logical, and integrates well with an IDE. However, about it being 'no doubt about which one is the best version', I don't agree. 1.4 is still significantly slower than 1.3, and consumes twice the resources on the server's CPU, using most of two cores instead of most of one. I've had 50 players servers getting TPS as low as 4. And the plugin isn't the problem, it's taking up 3.9% of the total tick time. While 1.4 is amazing from a development standpoint, it's not ready for production servers yet. I love the new API and I want it to roll it out as soon as possible. But those issues need to be solved first and there's no clear reason as to why they're happening.
  16. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    The only good thing is that, it doesn't consume a lot of Bandwidth like in 1.3
    LDX likes this.
  17. williamtdr
    Offline

    williamtdr Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    23
    @iJoshuaHD That's certainly not the only good thing in 1.4. The new API and other features are awesome. The bandwidth consumption has to do with the new protocol allowing for compression when sending chunks.
    iJoshuaHD and LDX like this.

Share This Page

Advertisement