Databases

Started by
7 comments, last by WebsiteWill 20 years, 7 months ago
Maybe I should change my handle to "TheQuestionGuy" Anyway. I''m pondering over the backend database/s for a MMO and am currently wondering how many actual databases there are? Does one need a separate computer with it''s own database for every different WORLD in a game plus a separate database for accout information? Or will one really nice computer holding a single massive database get the job done? I''m thinking of a preliminary design that some entities would be ACCOUT Accounts have user information and account information and character information. Each character is also a specific entity. An account can have characters on multiple WORLDs sooo. Or if a single machine for each world then one database to store account information and another DB for each world so when a client logs in, the login server presents a list of active WORLDS and the client selects a world and is then handed off to a new computer and new database. This new database has all information about the characters this client has on this server. The single database for everything model would be the easiest to setup as far as communication and data backup but I''m wondering is a single database will be able to work quickly enough? All logins, game saves, inventory loading, everything going through one master computer and master database. Of course is the network connection and computer holding it is fast enough I suppose it is possible. I''m just which solution is more viable? Thanks, Webby AKA TheQuestionGuy PS. I realize that I ask various questions about a vast array of topics. Reason being is that I''m not developing any serious software YET. I''m just getting a feel for the major topics involved in development. Then I gather information on them and study them writing code and such as practice. Eventually I''ll probably start on an actual project I have in mind but for now I''m just learning. Thanks for the patience and all the great information.
Advertisement
About this, I have selected the One database per world for user accounts and PCs plus one database per server. The fact is that my worlds are composed as following:
                    __ Screen 1                   /         __ Area 1 --- Screen 2        /          \ - World --- Area 2  -- Screen 3        \          -- Area 3 ...    

And one server can choose to only manage the whole world, or one particular area or only one screen according to its power (cluster...). In this case Data replication will be used. Moreover, the database implementation is free:
- small server can use MySQL (free)
- big server can use Oracle (a little more expensive )

Well that's only theory (currently) but I think the concept looks good.

WS

[edited by - wondersonic on September 1, 2003 12:39:37 PM]
Curious about your isolation of MySQL into small projects and
Oracle into large projects.
Seeing as how DAoC and a couple of others have very successfully used MySQL for free, why would anyone want to pay the 10''s of thousands of dollars to liscense Oracle and then pay a buttload more for an Oracle specialist?

I''m MySQL all the way. Especially seeing how they are quickly catching up to Oracle in matters of operability, stability and functionality.

Still need to decide on a definite setup. Right now I am greatly considering the setup where I have
1 Database that keeps track of client login and account information. Then let the world servers keep track of everything pertaining to that specific world.
World servers would keep all info related to every character on that world server as well as all item, monster, etc info related to that particular world. World in this sense is the same as a different server in EQ or DAoC.

So I have one machine for login and account. Then one machine per world server for however many servers I would be able to run (1 in this case).

I am thinking that this setup would be the easiest to create and manage.

Thoughts?

Webby
Just make sure that whatever DBMS you use, you use an abstract interface to hide the implementation. That way, if MySQL stops meeting your needs, you can easily replace it (with Oracle for example). Here''s a really rough example:

class IDatabase
{
virtual ~IDatabase ( void ) {}

virtual void SetConnectionInfo ( char * db, char * user, char * pw ) = 0;
virtual int Query ( char * sql ) = 0;
..
}

Then each database implementation would extend this interface and new implementations could be created with a DBMS factory class like so:

DBMSFactory dbmsFactory;
DBMS *dbms = dbmsFactory.Create ( "mysql" );

char* sql[] = "DELETE FROM accounts WHERE ID=1";
dbms->SetConnectionInfo ( "mmorpg", "root", "" );
dbms->Query ( sql );

dbmsFactory.Destroy ( dbms );

Another cool idea would be to make your factory a singleton so that you could call it from anywhere to get an instance of your dbms. The book C++ Programming for Game Developers has a really good chapter on abstraction which explains this in more detail.

bpopp (bpopp.net)
You actually have to pay money for MySQL if you use it in a project that you sell...
ONLY if you sell the software that actually has the database.

In the case of a MMO, the server code will be the only part that uses the database. The client part that is sold will be MySQL free and hence it can still be used for free for this kind of project.

One of the things I checked through thoroughly before even starting. I''m not going to spend time learning a system that I would never be able to use due to monetary constraints.

Webby
quote:
Curious about your isolation of MySQL into small projects and
Oracle into large projects.
Seeing as how DAoC and a couple of others have very successfully used MySQL for free, why would anyone want to pay the 10''s of thousands of dollars to liscense Oracle and then pay a buttload more for an Oracle specialist?

I''m MySQL all the way. Especially seeing how they are quickly catching up to Oracle in matters of operability, stability and functionality.


I mean that if one has a small server then he perhaps has not the money to buy an expensive DBMS, I just intended to speak of DBMS independency not DBMS power...

quote:
Just make sure that whatever DBMS you use, you use an abstract interface to hide the implementation. That way, if MySQL stops meeting your needs, you can easily replace it (with Oracle for example).


About DBMS abstraction, I must tell you that I''ll use Java langage so JDBC is totally DBMS independent and Moreover, I''ll use an appplication server (such as JBoss) that also adds abstraction layers to DBMS

WS
The reason to look at Oracle or MSSQL Server is for support and uptime, as well as better drivers and design tools. MySQL is quickly catching up on the design tools and performance areas, but for support it''s pretty tough to beat Microsoft or Oracle.

As for design, I''d say do this:

Start out assuming one central database server that handles all of your databases, but write the code so that if you need to move the account database to a different server you can do that by just changing a configuration setting without changing code. Assuming efficient database code, one central database server should easily be able to handle a whole MMORPG "universe" (multiple worlds, all accounts, users, etc...)
In regards to efficiency MySQL always have the reputation for better speed and the drivers are as good as anyone elses.

The reason to look at MsSQL or Oracle is because they have better server side data manipulation and data referentiality, which MySQL is just catching up on in version 4 and InnoDB. Both Oracle and MsSQL have the ability to offer triggers, to limit the amount of time in a application, and also limited views based on the information you want, neither of these are in MySQL yet.

It''s widely reconignised that many higher end games need to manipulate data within the database itself.

quote:Original post by JonStelly
The reason to look at Oracle or MSSQL Server is for support and uptime, as well as better drivers and design tools. MySQL is quickly catching up on the design tools and performance areas, but for support it''s pretty tough to beat Microsoft or Oracle.

As for design, I''d say do this:

Start out assuming one central database server that handles all of your databases, but write the code so that if you need to move the account database to a different server you can do that by just changing a configuration setting without changing code. Assuming efficient database code, one central database server should easily be able to handle a whole MMORPG "universe" (multiple worlds, all accounts, users, etc...)


This topic is closed to new replies.

Advertisement