Thread: Best Database Software for RSPS/Runescape?

Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42
  1. #21  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,578
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by iLankan View Post
    Wait so some of their main Servers are Linux based?

    Smart people i guess



    Okay so if i had a simple method which executes a Delete and Insert query, how would i optimize this.
    Code:
        public static boolean online(int x) {
            try {
            query("DELETE FROM `online` WHERE id = 1;");
            query("INSERT INTO `online` (id, currentlyonline) VALUES('1','"+x+"');");
            } catch (Exception e) {
                e.printStackTrace();
                return false;
            }
            return true;
        }
    The reason i am asking is because i want to know which ways you use to "optimize" your code. Like in my opinion, i think all of the stuff in there is necessary, but i don't understand how you could optimize something like that. Or i might just be really stupid :\
    It would be much better to use UPDATE for that query because there is going to be a small period of time where the row does not exist (which could cause something else - I'm guessing your website - which expects the row to exist to fail).

    Also you might want to look into an in-memory for that kind of table since you don't need the players online to be persistent if the server is down.

    Quote Originally Posted by Mister Maggot View Post
    Using multiple databases is fine..

    You shouldn't use one for everything.
    It's more of an organisational thing tbh - I doubt it's going to have much performance impact whether you have one big one with lots of tables or lots of small ones with small tables.
    .
    Reply With Quote  
     

  2. #22  
    Respected Member

    Join Date
    Jan 2009
    Posts
    5,682
    Thanks given
    1,093
    Thanks received
    3,494
    Discord
    View profile
    Rep Power
    5000
    Allot of people do not take any care what so ever when using MySQL for example username varchar(255) when the username can only be 14 chars... Its such simple things which lead to poor performance.
    Reply With Quote  
     

  3. #23  
    Registered Member

    Join Date
    Mar 2010
    Age
    26
    Posts
    686
    Thanks given
    35
    Thanks received
    92
    Rep Power
    157
    Quote Originally Posted by iLankan View Post
    @Graham

    I know Java is free, but i meant to say they probably have their own software to handle that stuff.

    Anyways, thank you for your ideas and input.
    Do you think that it would be easy to use InoDB or MyISAM? Like would i have to learn it on my own or is it user friendly and related to MySQL in a way?
    First off, I would like to say I am not as advanced as everyone on this forum, but I do know a bit. So, If anyone finds mistakes in my statement, please tell me nicely and not flame.

    Now, are you connecting to a local database, or a external database?

    P.S. Have you tried using flatfile storage?
    Reply With Quote  
     

  4. #24  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,246
    Thanks given
    3,283
    Thanks received
    2,874
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Pixelthis View Post
    Allot of people do not take any care what so ever when using MySQL for example username varchar(255) when the username can only be 14 chars... Its such simple things which lead to poor performance.
    You mean 12.

    Quote Originally Posted by I Vain I View Post
    First off, I would like to say I am not as advanced as everyone on this forum, but I do know a bit. So, If anyone finds mistakes in my statement, please tell me nicely and not flame.

    Now, are you connecting to a local database, or a external database?

    P.S. Have you tried using flatfile storage?
    Anything outside of your own intranet's retarded.

    A flat file system is worse.
    Reply With Quote  
     

  5. Thankful user:


  6. #25  
    Jim
    Jim is offline
    I dunno, its fine I guess

    Join Date
    Feb 2007
    Posts
    147
    Thanks given
    12
    Thanks received
    33
    Rep Power
    265
    Lately I've begun to like document (NoSQL) storage engines a lot better. There are some nice CouchDB wrappers for Java like [Only registered and activated users can see links. ] that let you easily fetch documents as POJOs.

    Benefits:
    • Don't need to write queries
    • No ugly JDBC drivers
    • Can use existing model classes
    • Easy replication
    • RESTful GETting/POSTing to the CouchDB server
    • JSON encoded data


    Quote Originally Posted by Mister Maggot View Post
    Using multiple databases is fine..

    You shouldn't use one for everything.
    Do you mean tables? Because splitting them into different databases will have little effect. If anything, I think it would complicate clustering/sharding.
    Reply With Quote  
     

  7. #26  
    Member
    Boomer's Avatar
    Join Date
    Sep 2006
    Posts
    1,282
    Thanks given
    309
    Thanks received
    795
    Rep Power
    1111
    If you're saying that MySQL's performance is not good enough for a private server, then you must be using it incorrectly.


    [Only registered and activated users can see links. ] ||| FightScape | InnerFantasy | PkIsle | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #27  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,074
    Thanks given
    2,625
    Thanks received
    3,578
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Mister Maggot View Post
    A flat file system is worse.
    I don't think you can make such a broad statement. Also, where do you think MySQL is storing its data? In files on your file system...
    .
    Reply With Quote  
     

  9. Thankful users:


  10. #28  
    Member
    Boomer's Avatar
    Join Date
    Sep 2006
    Posts
    1,282
    Thanks given
    309
    Thanks received
    795
    Rep Power
    1111
    Quote Originally Posted by Graham View Post
    I don't think you can make such a broad statement. Also, where do you think MySQL is storing its data? In files on your file system...
    But that doesn't mean its faster then reading a plain data file.
    So if he is defining "better" as speed, then he has a valid argument. Then again, it depends on the specific use.


    [Only registered and activated users can see links. ] ||| FightScape | InnerFantasy | PkIsle | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ]
    Reply With Quote  
     

  11. #29  
    Registered Member

    Join Date
    Sep 2007
    Age
    29
    Posts
    2,396
    Thanks given
    5
    Thanks received
    436
    Rep Power
    902
    Quote Originally Posted by Mister Maggot View Post
    You mean 12.


    Anything outside of your own intranet's retarded.

    A flat file system is worse.
    I'd disagree, flat file systems can be quite good if done proplery, last week I was considering making my own mini-database system something similiar to the runescape cacahe where there is one main file (main_file_cache) (mabey in my case id use several) and in that file it would contain all character files, easily parseable without much modification at all. MySql is a very professional product so its services span a huge range, whiel in rsps we use very little of these it makes more sence to write our own smaller db system that will be much faster if done proplery to read write and grab char files.

    I've found the average read of a char on a flat file system tends to be about 6ms. While when using MySql over a localhost connection can take up to 20-50ms to load although its still quite fast that can make a big difference over time.

    Overall I find mysql to have too many features to be used my jagex since there databases are probally very large at this stage.

    Mabey a more commerical version of SQL they might use which is more designed for their usage.

    Quote Originally Posted by Pixelthis View Post
    Allot of people do not take any care what so ever when using MySQL for example username varchar(255) when the username can only be 14 chars... Its such simple things which lead to poor performance.
    I'd hugly agree on this, if you have a 3 Million account database and your searching for the account on login there is a huge difference between

    SELECT * FROM users WHERE username = 'Example'

    SELECT * FROM users WHERE username = 'Example' LIMIT 1

    The extra Limit 1, will tell the database to stop searching after it finds the user and not keep looking for users with similar usernames
    Hyperion V2 Martin's Updates.
    [Only registered and activated users can see links. ]

    Scar says:
    i hate it when it hits your face
    Reply With Quote  
     

  12. #30  
    Registered Member thiefmn6092's Avatar
    Join Date
    Dec 2006
    Age
    21
    Posts
    2
    Thanks given
    26
    Thanks received
    389
    Rep Power
    0
    Quote Originally Posted by Boomer View Post
    But that doesn't mean its faster then reading a plain data file.
    So if he is defining "better" as speed, then he has a valid argument. Then again, it depends on the specific use.
    If you're using database software like MySQL purely for speed, you have the wrong idea. It's all about providing a unified structure for information that is (theoretically) accessible from anywhere.

    If you want speed, store your characters as raw binary files, load them all at start up and access player credentials from memory.
    [Only registered and activated users can see links. ]

    If you are a starter and want to learn rsps coding, i think that the server that fits most of your requests is deathlypvpz.
    I know some stone heads will flame and say its shit, i completely agree buy deathlypvpz is the best thing to start with.
    And you must do some Java courses in codecademy to improve yourself.
    Reply With Quote  
     

  13. Thankful users:


Page 3 of 5 FirstFirst 12345 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •