Page 1 of 1

database

Posted: 04 Apr 2008, 19:25
by filo
Good day,
I look to the server data folder and TMW using XML databases, and my question is:
XML is better then MYSQL database?

Thanks for answer

Re: database

Posted: 04 Apr 2008, 20:18
by Crush
XML files have the advantages over relational databases that they can be viewed and edited with a text editor and that they are easy to make in a way that is backward- and forward compatible.

SQL databases, on the other hand, are much faster to search when they aren't completely loaded into memory and much faster and safer to modify at runtime.

So we are using both. We use XML files only for static data like monster- and item stats while variable data like character stats is stored in an SQL database (The SQLite database tmw.db per default).

Re: database

Posted: 05 Apr 2008, 08:52
by filo
Crush wrote:XML files have the advantages over relational databases that they can be viewed and edited with a text editor and that they are easy to make in a way that is backward- and forward compatible.

SQL databases, on the other hand, are much faster to search when they aren't completely loaded into memory and much faster and safer to modify at runtime.

So we are using both. We use XML files only for static data like monster- and item stats while variable data like character stats is stored in an SQL database (The SQLite database tmw.db per default).
Ok thanks for your answer ;-).

Re: database

Posted: 11 Apr 2008, 16:23
by jimao888
At least use XML you don't have to worry about "lost connection to mysql server during query"
like MYSQL; By the way, did anyone know why I get this warning all the time?

Re: database

Posted: 11 Apr 2008, 17:11
by Crush
The SQLite database used by TMWServ is embedded into the server application itself. So there is no connection which could be lost.

A database on an external server is however an option to reduce the load on the accountserver (while the world can be split up on multiple physical gameservers to improve performance there can only be one accountserver for each world). But in that case you have to make sure that the connection to the database server is fast and reliable, otherwise it could become a bottleneck and make the performance even worse.

Re: database

Posted: 14 Apr 2008, 00:55
by leeor_net
Crush wrote:...(while the world can be split up on multiple physical gameservers to improve performance there can only be one accountserver for each world)...
(haven't tested this so I'm asking)

Does this mean that multiple game servers on different machines can be used to host different maps for the same world? E.g., gameserver1 hosts maps A, B and C while gameserver2 hosts maps D, E and F? Then the account server can tell the Client which gameserver to look for for each map?

If you've got documentation on this already (such as the Wiki, for instance), you can just direct me there.

Re: database

Posted: 14 Apr 2008, 06:50
by Crush
That's exactly how it works.

Re: database

Posted: 20 Apr 2008, 00:42
by leeor_net
Very cool. I imagine then it's a simple matter of defining the game servers within the server config files. Great! :) That will help to really lighten the load on the game servers.