database

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
filo
Peon
Peon
Posts: 19
Joined: 01 Apr 2008, 19:56
Location: Czech republic
Contact:

database

Post by filo » 04 Apr 2008, 20:25

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
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: database

Post by Crush » 04 Apr 2008, 21:18

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).
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
filo
Peon
Peon
Posts: 19
Joined: 01 Apr 2008, 19:56
Location: Czech republic
Contact:

Re: database

Post by filo » 05 Apr 2008, 09:52

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 ;-).
jimao888
Peon
Peon
Posts: 15
Joined: 09 Sep 2007, 16:53

Re: database

Post by jimao888 » 11 Apr 2008, 17:23

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?
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: database

Post by Crush » 11 Apr 2008, 18:11

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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 10:17
Location: Ohio, USA
Contact:

Re: database

Post by leeor_net » 14 Apr 2008, 01:55

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

"Oh, no thanks. I ate a boulder on the way in." - Shrek
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: database

Post by Crush » 14 Apr 2008, 07:50

That's exactly how it works.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 10:17
Location: Ohio, USA
Contact:

Re: database

Post by leeor_net » 20 Apr 2008, 01:42

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

"Oh, no thanks. I ate a boulder on the way in." - Shrek
Post Reply