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.
|
|




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.
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.
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.

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?


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
Do you mean tables? Because splitting them into different databases will have little effect. If anything, I think it would complicate clustering/sharding.
If you're saying that MySQL's performance is not good enough for a private server, then you must be using it incorrectly.





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.
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
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.
| « RuneScape Scared? | A one line tutorial on increasing playercount. » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |