Advertisement

The speed of MySQL

Started by August 02, 2006 05:13 PM
17 comments, last by GameDev.net 18 years, 6 months ago
I wouldn't recommend doing a large scale real time game in flash as IIRC the only type of socket connection flash supports is the XMLsocket, which is a tcp socket capable of transferring ascii data, now if your game was like a very large game like the ones on netnexus it would be possible but not recommended to try to aim for 2000 people(do you even know 2000 people you can successfully advertise this to?)

As for speed of mysql according to sqlite*'s benchmarks on a 1.6ghz athlon with a GB of RAM on a table with 25000 entries, it completed 100 select statements on nonindexed data in 2.76 seconds(vs the 2.49 seconds sqlite took), and it was able to do 5000 select statements in 1.27 seconds(vs 1.12 seconds sqlite took), so as long as your data is indexed you should be fine doing 2000 simple queries as long as your dataset is of a reasonable size.




*sqlite's benchmarks are probably tailored to make sqlite shine, but I still like it more than mysql :p
What you are proposing doing is a severe abuse of MySQL and won't scale well. Maybe it'd work for a few players though.

I think it's a much better idea to have a custom server and use sockets, so

1. You can push changes to the clients instead of polling - which will make it VASTLY more efficient in terms of bandwidth at least
2. You can store rapidly changing stuff in memory

If you want you could use MySQL to store a membership database, but don't use it to store stuff that changes on a realtime basis (e.g. positions of objects).

Ignore Michaelson's opinion on MySQL - you'll see that he writes that in almost every thread which mentions it, and it is just that, an opinion. Most of the "facts" he presents aren't even particularly correct, and I don't agree with his opinions on it.

Mark
Advertisement
Yeah, I think you should really examine your bandwidth and concurrency requirements before you discount a Flash/MySQL solution out of hand. I've seen a couple of real-time systems done with such a scheme, namely FlashChat and Penguin Chat, and they perform just fine.

Of course, neither system has a thousand people playing at a time, but we don't know enough about your plans to know if that's in the cards.

(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually still available on store-shelves, although you'll need a keen eye to find them nowadays. He continues to work in the casual game-space as an independent developer, largely working on games in Flash for his website, The Code Zone (www.thecodezone.com). His current scheme is to distribute his games virally on various web-portals and widget platforms. In addition, John writes weekly product reviews and blogs (over ten years old) for www.gamedev.net from his home office where he lives with his wife and daughter in their home in the woods near Lake Grapevine in Texas.

This topic is closed to new replies.

Advertisement