1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Which storing method is better?

Discussion in 'Development' started by BruhLol, Apr 1, 2019.

  1. BruhLol

    BruhLol Baby Zombie

    Messages:
    122
    Is it MySQL, SQLite3, or serializing .sl?? I find .sl much easier and faster, thoughts on which should I use? I want the fastest...
     
  2. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    serializing.sl is much, much much more faster
     
    BruhLol likes this.
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    MySQL hosted locally and having enough resources to run at it's peak.
    SQLite3 works as well.
    With databases (especially server-oriented ones like MySQL) the queries are usually ran asynchronously to avoid latency issues (and other things like your queries being queued in cases where the structure of the table you're querying is being modified).

    Flat file databases aren't really a good alternative to databases. I'd say flat files are fine if you're storing something that doesn't grow over time (like a configuration file, loot tables for crates/kits etc). But if it does grow over time, then I don't think it's going to be fast at all. You could use a whole file as an index like pocketmine does with players/, considering filenames are indexed in folders (I'm not really sure how file systems work, I might be wrong here) but you'll still need to:
    > read from file
    > unserialize
    > write to file
    which is CPU intensive. Period.

    You might be caching the serialized data when the player joins, and then writing to file when the player quits, but that doesn't make .sl the fastest. Once you transfer data to RAM, any read writes to RAM isn't contributing to the performance of .sl. You can essentially do the same thing with MySQL and yet have MySQL beat .sl in read-writes by 100x if not more ¯\_(ツ)_/¯.
     
    BruhLol likes this.
  4. BruhLol

    BruhLol Baby Zombie

    Messages:
    122
    you got a point
     
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    They are used for different purposes. Use .sl if you only want to load/save a bulk of data. Use sqlite if you want to search data with other methods, e.g. if you want to search all players in a team, find the top 10 kills players, etc. Use MySQL if you want to do something like sqlite and/or share the data among multiple servers or with your website etc.
     
    Levi, Diduhless and BruhLol like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.