Sign in to follow this  
Funyun

How do the major MMOs out there store login and other information?

Recommended Posts

Funyun    122
How do other MMO companies out there store things like usernames and passwords? Do they store them in SQL databases or something of that sort? And what about things like information on skills, items, etc.? Is that all stored and constantly written to a central database or is it just saved in a text file on the server? Thanks.

Share this post


Link to post
Share on other sites
d000hg    1199
I suggest a MMO server is viewed like any other big server application. In which case, a database is the standard solution. You CAN use files but databases are designed for exactly this purpose.

Share this post


Link to post
Share on other sites
hplus0603    11356
Some things (like authentication) don't change much between applications.

However, the amount of mutating state for an MMO, and the real-time requirements, are actually fairly special to MMO games. The other app that may be similar is the stock market, but they have different trade-offs (consistency is more important, latency is less important, somewhat oversimplified). And different budgets :-)

The "vanilla" MMO architecture is that the simulation servers "check out" the state from the database server when a player logs in, and they "checkpoint" the state after important events and once in a while, to reduce the amount of data lost if the server should crash. Additionally, user trades and other "important" events should be done as a transaction in the database, to avoid the possibility of "dup" or "trade" hacks/corruption.

Share this post


Link to post
Share on other sites
daredeval756    106
Well MMO's such as WoW are using SQL right now, it seems to be a big deal lol

I on the other hand like text files whn im making my games, much easier, although SQL is much mor effcient!

Share this post


Link to post
Share on other sites
asp_    172
Quote:

The other app that may be similar is the stock market, but they have different trade-offs (consistency is more important, latency is less important, somewhat oversimplified). And different budgets


Latency for trading is crucial. Especially with all the automatic electronic trading going on today. There are trading solutions that count the response time in microseconds. MMO's also have fairly small budgets with few reaching the 100 million USD mark. Remember that this is the financial backbone of the world we're talking about where 100 million or so is nothing.

Quote:

I on the other hand like text files whn im making my games, much easier, although SQL is much mor effcient!

A RDBMS is extremely inefficient to be honest. It's more about relational models than a simple blob storage engine. I doubt authentication will ever be a bottleneck though since even if it would be a full RDBMS you'd be running extremely simple queries and the database files would be very very likely to fit in RAM. The most expensive part would probably be to reach out to the database server, compile the SQL and execute the SQL. However you'd have transactional safety and other guarantees that can be very hard to get completely right on your own. I would definitely go with simply using an existing RDBMS and then switch it out with a custom solution after doing load testing and seeing that it wouldn't be able to keep up. My bet is that you'll be able to log in many thousands of people per second even on a desktop computer.

Share this post


Link to post
Share on other sites
Antheus    2409
Quote:
Original post by asp_My bet is that you'll be able to log in many thousands of people per second even on a desktop computer.


But being logged in isn't particularly interesting, no matter how fast they log in.

It's what they do that matters.

Share this post


Link to post
Share on other sites
Numsgil    501
Text files don't scale. Any MMO that expects more than a few dozen players (and if you're not it's not really an MMO. It's more a mMO :P) needs to be using a database of some sort.

Share this post


Link to post
Share on other sites
Numsgil    501
Quote:
Original post by hplus0603
Quote:
Text files don't scale.


Shh! Don't tell the web. It hasn't heard yet! It'd be a shame if it suddenly collapsed because of the lack of scalability of text files.


Heh, I can't tell if you're being sarcastic or facetious :)

Share this post


Link to post
Share on other sites
Kylotan    10011
Quote:
Original post by Numsgil
Text files don't scale. Any MMO that expects more than a few dozen players (and if you're not it's not really an MMO. It's more a mMO :P) needs to be using a database of some sort.

At least one released MMO (and yes, a proper MMO) used flat files (not necessarily plain text) rather than a 'proper' database. I can't remember which is was though. To be honest it's not that big a deal if you can keep most of your data in memory and don't need to write it out that often. Many MUDs, which support hundreds of players and thousands of NPCs simultaneously, read everything from text files and keep all the data in memory at all times.

Share this post


Link to post
Share on other sites
d000hg    1199
Quote:
Original post by Kylotan
Quote:
Original post by Numsgil
Text files don't scale. Any MMO that expects more than a few dozen players (and if you're not it's not really an MMO. It's more a mMO :P) needs to be using a database of some sort.

At least one released MMO (and yes, a proper MMO) used flat files (not necessarily plain text) rather than a 'proper' database. I can't remember which is was though. To be honest it's not that big a deal if you can keep most of your data in memory and don't need to write it out that often. Many MUDs, which support hundreds of players and thousands of NPCs simultaneously, read everything from text files and keep all the data in memory at all times.
I can see if you only run a single server, it could work fine if you do a lot of caching - read everything at startup and then write updates, rather than doing a ton of read/write stuff the whole time. But wouldn't it get trickier with multiple servers?

Share this post


Link to post
Share on other sites
hplus0603    11356
Quote:
wouldn't it get trickier with multiple servers?


Why? As long as the multiple servers don't need to write the same files at the same time, there's not a problem. If they do, then file locking could be sufficient for your needs, if you got something out of flat files in general.

I don't like flat files, because you can't easily query them (and, no, "grep -ri" does not count as a query tool :-)

Share this post


Link to post
Share on other sites
humanapp    157
The current trend seems to be to persist everything in a central relational database, though I've heard of a few MMOs that have developed their own distributed storage mechanisms. I don't know whether it was a good decision to do so; I don't have that information.

Somewhat on topic: I haven't looked very closely into it, but Amazon's S3 cloud storage seems like an interesting alternative to storing binary blobs. I imagine one would want to keep some metadata about your blobs in a local SQL database in order to do ad-hoc queries on them, but I think that offloading storage of binary data would certainly help lessen the pain of a database ever increasing in size.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this