Best way to save huge amounts of data without learning a new programming language

Discussion in 'Plugin Development' started by jimbo8, Dec 17, 2013.

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

    jimbo8

    Hi!

    I've came to this point where i need to save all of my data in a some kind of database.

    The problem is that i don't know MySQL or any other database-languages, so i don't know how i should do this without saving to configs.
    As i said in the title, i said huge amounts, and then i mean huge. I'm going to save every single block every single person places and touches, and the configs won't handle that.

    To the point; I need a way to save all of my data in a quick and easy way without learning a whole new language. I know that MySQL probably isn't that hard to learn, but i'm not really interested in learning a new language. If there are any kind of API's that could help me, that would be epic. Like a API to save to a MySQL database with pure java language.

    Thanks in advance,

    -jimbo out.
     
  2. Offline

    Gater12

  3. Offline

    NathanWolf

    Check out the bukkit tutorial. There are some recommended Java APIs there. It will help to learn SQL (it is not a full language like Java, it's really pretty simple) but is not necessary if you use a good ORM package.

    http://wiki.bukkit.org/Plugin_Databases
     
  4. Offline

    NoLiver92

    what exactly are you saving? every block in the world?

    Using a database line mysql is easy to add data too but when you come to get the information back, like searching for a single block would take ages if you put (say) 100000 blocks in it, the bigger the database the longer it will take to search. Therefore you will have to wait for the result.

    saving to config all this data will make one MASSIVE file and will cause the server to lagg if you read it, this would happen with most if not all file based techniques.

    A database like mysql is probably your best bet, but the main question is why do you need to save soo much data?
     
  5. Offline

    1Rogue


    SQL is very much so a programming language. It's not java-specific.
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    MySQL is a database. It is an implementation of the SQL standard. SQL is a language for constructing quires, statements, and other database operations. You can primer on the SQL language at http://www.w3schools.com/sql/

    Java has a SQL API for interacting with SQL servers, however it still requires you to know how to construct SQL statements. That API is called JDBC, and you can find the tutorial at http://docs.oracle.com/javase/tutorial/jdbc/basics/

    There exists Java libraries that abstract away the raw SQL statements. (Like the ebeans one bukkit has)

    There also exists other database systems that do not implement SQL. these are often called NoSQL systems and they consist of database implementations such as MongoDB, Hadoop, and Cassandra
     
  7. Offline

    NathanWolf

    NoLiver makes a good point, I should have asked how you plan to actually use this data. If you need to search through it later, SQL is really your only choice. And with proper indexing you should be able to search for data with millions of rows.

    If you're just logging it though, you could simply write to a plain text file or binary file. You would append to the file as you addd data, not write it all at once, and this would not be a structured format like YAML. Maybe just a CSV file.
     
  8. Offline

    jimbo8

    Thanks for all of your answers!

    The reason i'll be logging all of this, is because it is going to be a buildserver, survival server, PvP, so and so forth, so i need to check the blocklog if someone is griefing etc.

    I know that there are very good plugins like CoreProtect or Prism, but i need it to be 100% norwegian, as it is a norwegian server.

    Does anyone of you know where i could learn SQL easily? I don't really like the way TheNewBoston does it, as he is doing it so slow and i'm just getting tired before i learn anything :p I prefer it fast but still learning.

    Also, about the eBean database, how does this work? Are there any tutorials out there for it?

    Thanks in advance,

    -jimbo out.
     
  9. Offline

    Sagacious_Zed Bukkit Docs

    jimbo8 as mentioned in the wiki article and my post above. eBeans is not a database, it is an Object-relational mapping (ORM) library. The wiki article should be a sufficient starting point.
     
    jimbo8 likes this.
  10. Offline

    1Rogue


    I really don't recommend w3schools at all:

    http://w3fools.com/

    Overall, I think the best resources for individual sql structure per database is usually the providers themselves. For instance mysql: http://dev.mysql.com/usingmysql/get_started.html
     
  11. Offline

    Sagacious_Zed Bukkit Docs

    1Rogue Each implementation also has it's own differences in the way it processes SQL. However, regardless of your stance, there is a distinct difference from generic SQL and what MySQL accepts as SQL.
     
    1Rogue likes this.
Thread Status:
Not open for further replies.

Share This Page