fast data access for MMOGs

Started by
23 comments, last by hplus0603 18 years, 10 months ago
everyone and their mothers uses mysql religiously, which it isnt a product that you should be religous about. so thats probably why ppl are obstinate about it on efnet. that and its efnet.
Advertisement
Just out of curiosity, what are the major advantages of SQL over storing your data in memory. Obviously there is less memeory than hardisk space but memory has much faster access and with the 1+gig of memory you can get on a computer very easily these days it would be a pretty large program before using up this.

Or is memory used for runtime and the SQL used for data storage? Just wondering when one vs the other...
The SQL is used as robust data storage (you could go with a flat file, but with something like a MMORPG with it's interconnected data, you'd end up manually reinventing a lot of database functionality).
Quote:Original post by graveyard filla
I believe DAOC only uses MySQL for certain low performance things, and uses flat files for the main stuff.


Indeed, Dave Rickey confirmed this some years back - they use(d) it for running the newspaper and stuff like that.

Quote:
However, in business programming, this seems to be the complete opposite. People seem to always stick with SQL Server, and the other big guys... in fact the only free DB that I see gets any respect is Postgres.... You aren't even allowed to mention MySQL on #sql in efnet... the people in there are all business developers and I have spoke with them about it.. apparently there is a lot of data integrity issues with MySQL...


MySQL was very very bad to the level that anyone with a brain wouldn't have bothered calling it a database without laughing.

That was a very stupid move, because it gave My a bad rep that has taken years to make any in-roads against - most people nowadays in business have re-appraised My recently enough to know it's usable.

However, it *STILL* lacks one of the fundamental features you need for real DB work: stored procedures. (note: you can get versions with them, but the only thoroughly tested versions which people truly trust do NOT have them. Yet. Shouldn't be long now).

In business, you re-appraise every 18 months or so - about the length of a project - and My was just too crap for words on people's appraisals, so they didn't bother for more like 3 years (or more, in many cases), in which time it got a LOT better.

Quote:
speed is much more important then having stored procedures


(Slaps forehead) - stored procedures are there to increase speed! (amongst other things, but speed is a BIG reason for having them).

This kind of omission - My being "built for speed" yet not having sprocs was a *real* drag. Some (many?) people who knew their stuff thought "my god, these people don't have a clue what they're doing - I'm not trusting them". Shrug.

These days My is tolerable, although even the main production versions 4.x are still BAD in quite a lot of ways and unforgivably slow in some situations (or just critically badly broken). The vast majority of the ultra serious bugs I've been bitten by before have now been fixed in the latest 4.x releases - but IIRC not all. So...be warned. Be careful. But...you *should* be absooutely fine. Just don't get too creative with it!
If you put your data in main memory, then you have the responsibility for:

1) doing efficient indexing and filtering when querying (OK, not a big deal)
2) doing efficient joins when querying more than one table (a little harder)
3) providing a correct durable transactional view of the database (now it starts getting annoying)
4) doing all of the above in an environment where many users make requests all the time

For some things, you really can do with trimmed-down requirements for 3) and 4) -- maybe even for 2). If all you "really" need is 1), then you can store the data in main RAM and be happy. But as you go down this list of features, you'll quickly find the need for a database.

FWIW: We use MySQL 4.x in production, and these days, it's fine. I use Postgres for side projects, and that's fine, too :-) I've used Oracle, and it's usually fine as well, but it's complicated to administer, and it's expensive. For pay-for databases, I'd rather use DB/2.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement