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

SQL In Minecraft

Discussion in 'Community Talk' started by Jaytuple, Jun 6, 2023.

  1. Jaytuple

    Jaytuple Well-Known Member

    Messages:
    211
    Likes Received:
    76
    Local Time:
    12:30 AM
    Hey all. I'm doing some coursework to learn to be a data analyst, and currently working on learning SQL. I have a few questions that I'd like to ask this staff, as well as anyone else knowledgeable in SQL in Minecraft. Also, I'm aware Google can help me with a lot of this, I just really like having specific context, as well as a community to bounce ideas/questions/etc off of. I have no intention of using any of this, other than furthering my understanding of SQL in an environment I know well.

    1) What is commonly stored in databases for servers?

    2) What sort of information and queries (either exact SQL queries or general intent works for this question) are commonly used when working with the databases?

    3) What are some common problems with using databases for Minecraft, with both queries and database in general?

    4) What are problems that can only be fixed using the database?

    5) Any additional information or advice that's good to keep in note?
     
    BookerTheGeek likes this.
  2. BookerTheGeek

    BookerTheGeek Patron Tier 3

    Messages:
    3,257
    Likes Received:
    1,097
    Local Time:
    2:30 AM
    Hello Jay!

    Realize that my answers are about general usage with Minecraft and not MyM specific.

    Most often it is used to store information regarding events, such as a block being broken or a player picking up an item. This is done through server-side mods or plugins (mods are written to be used in a Forge environment and plugins are written to be used server side such as SpongeForge or Bukkit)

    Lookup queries almost exclusively.

    • The size of the database before performance losses occurs.
    • The speed at which it performs lookups and returns results.
    • Number of concurrent lookups that can occur at the same time.

    Problems that can only be fixed by using a database? None really. It does make many things easier though. Now there are solutions that realistically can only be easily solved by a database, such as keeping track of every block every player breaks and/or places on a server. Trying to keep track of that in any other way then a database while possible is not feasible.

    • Keep regular backups.
    • Trim unneeded information and fields



    Hope this helps and good luck in the class.
     
  3. Willfon

    Willfon Well-Known Member

    Messages:
    752
    Likes Received:
    154
    Local Time:
    9:30 AM
    A database is an excel sheet so large that you can only use advanced queries to find the answer. But in an extremely large excel sheet you have duplicates. Most of the information will repeat itself. What the database give you is more bang for the bucks, than the excel sheet.

    But SQL is not the database. SQL is the syntax you use to ask, add or set data. Which is how you can use SQLite files for simple databases and Oracle for monsters.

    And thats … well that is really all that Minecraft and SQL has in common. Oracle, who owns Java now and monsters.

    Sure servers might use a database to keep track of stuff, but that is not Minecraft, those are the backend plugins.

    SQL is good for asking or setting stuff, from several places, stored in one central place.

    select player.name, claim.owner from PLAYERS inner join CLAIMS on claim.owner = player.name where player.name is "Willfon"

    … or something. I have no idea if that is how it would look or work. It has been 25 years since I took the SQL course and I don't fiddle with the server plugins.
     
  4. Jaytuple

    Jaytuple Well-Known Member

    Messages:
    211
    Likes Received:
    76
    Local Time:
    12:30 AM
    Booker, you did a fantastic job at answering each question, very insightful.
    Will, I love your example query. If it makes you feel better, my course has taught me that SQL has barely changed since it's creation. Though that can be said about a lot of languages.
     
    BookerTheGeek likes this.
  5. BookerTheGeek

    BookerTheGeek Patron Tier 3

    Messages:
    3,257
    Likes Received:
    1,097
    Local Time:
    2:30 AM
    You are very welcome.
     
  6. Willfon

    Willfon Well-Known Member

    Messages:
    752
    Likes Received:
    154
    Local Time:
    9:30 AM
    Of course, we didn't say anything about how things really work.

    First rule about IT security is you do not talk about IT security.
    Second rule about IT security is… you do not talk about IT security.
     
    BookerTheGeek likes this.
  7. Jaytuple

    Jaytuple Well-Known Member

    Messages:
    211
    Likes Received:
    76
    Local Time:
    12:30 AM
    I thought the first rule of any IT field is don't mess with the IT guy?
     
    BookerTheGeek likes this.
  8. Willfon

    Willfon Well-Known Member

    Messages:
    752
    Likes Received:
    154
    Local Time:
    9:30 AM
    No some pointy haired boss came with a SOP and ruined that. Now that it rule number five behind “change your password” (but it doesn’t specify how often or how good because of rules one and two) and “keep the kitchen stocked with coffee”.
     
  9. MaraJade2

    MaraJade2 Moderator

    Messages:
    123
    Likes Received:
    25
    Local Time:
    12:30 AM
  10. BookerTheGeek

    BookerTheGeek Patron Tier 3

    Messages:
    3,257
    Likes Received:
    1,097
    Local Time:
    2:30 AM
    I love xkcd
     
  11. Jaytuple

    Jaytuple Well-Known Member

    Messages:
    211
    Likes Received:
    76
    Local Time:
    12:30 AM
    I changed my password from one to two just 3 years ago. 100% safe.

    I died, this is great. Thank you.
     

Share This Page