I keep reading on here that I shouldn't use MySQL for game development/play on the Internet, a browser game. I understand MySQL wasn't made necessarily for that and for big relational needs. Ok. But what do I use then? I am on a shared hosting, Unix/Linux platform. What do I use to store my "stats" or other game necessities, level information, player information, etc.
Of Course You Can Use MySQL
Let's get this out of the way: lots of successful games and their related companies use MySQL. Riot Games (League of Legends) does, Big Fish Games has a small case-study done by Oracle about their use and optimization of MySQL, an Oracle Principle Infrastructure Architect has a slideshow of a talk they give on using MySQL for high popularity social games (one uses 1000+ dedicated servers), ad infinitum.
It's an industry standard, it's free, it's tremendously scalable, support is available all over the place...its a great system.
...But Use It Correctly
The best, bleeding-edgiest database system on earth won't save you from, say, deciding to store all the textures for a FPS game as a BLOB in the database and trying to load/unload them in real time across a server connection. You're gonna have a bad time.
RDBMS are for Storing information in an intelligent, structured way, where it is assumed that there will be Relationships between the various pools of data. There are Players, and they'll have Highscores, and they'll have Account Information, and there will be Logins, and (hopefully) Transactions and Purchases, and so forth, and that's exactly what things like MySQL was designed to handle.
The rest of the stuff really depends on the game. Graphics? It's usually just plain easier to use a regular file folder structure. Live updates of exact player xyz location as in an MMO? Probably not something to use the database for, but only if something better than using fopen is an option (which usually isn't available in shared hosting environments). But what 'zone' a player is in? Sure, why not!
The same rules apply to games as they do anywhere else - don't ask for more than you really need (avoid SELECT * without a conditional, unless that's what you really wanted), and expect to get cozy with query analyzers and profilers if things start getting sluggish.
Is MySQL the Only/Best Option
No, and of course not/maybe. It's a great system, it works. I dislike SQL, yet ORM tools make it invisible and I like some of them a lot. NoSQL solutions abound, and they have their unique strengths and weaknesses, too.
MySQL is like a chef's knife - it can get the job done. Sometimes you'd be better off with a paring knife or a cleaver, but lets face it - sometimes you just want to whack something with a reasonable-sized knife and get on with your day.
I personally find MySQL is ok to use for browser games but it depends on the type of game. I can't stress that enough!!!
For storing basic player information yes its perfectly fine.. just don't use
mysql_* as it is no longer supported for the future.
Other things however:
For example, is your game turned based, think like civilization franchise, this using mySQL is easily doable and i see no downside if you plan your tables correctly. Same for any games that use timers rather than "real time" updates.
However im not so sure it's wise if you plan to use MYSQL to store a user's location which updates in
real time for other users to see the person on a map. This needs to sync with other players constantly for every player in the given area.
Continuously updating user locations and selecting user's locations from the database like that would basically be like DDosing your server to the point it overloads and lags / crashes.
For live real time syncing between players you want to look into websockets. You don't want to store the user's exact positions but a "rough" position then let websockets fine tune in that area where the user is precisely.
Linking that with client side HTML5 canvas features would be the way to go.
TL;DR - it totally depends on what your game will be.....
MYSQL is a very good tool to use due to is capability of handling lot of data storage, most especially when you're developing an internet base football manager game, it will be capable of holding your various team data.thus this will take allot of query coding......but you know the says, Persistence leads to achievement!.