Best way (performance) to connect to a (MYSQL) DB

So we making a network based game (Dungeon Crawler). The architecture of the network code will be authoritative server based. All the communication to the DB will be done by the Server.

All informations about player and items should be stored in a DB (MYSQL).
What is the best way to do this? (Cant find any good tutorial).
How to connect to DB ? I read about 2 ways:

  • With PHP (bad Performance ?)
  • With a MYSQL connector (DLL files to install) → Dont sound like this will work on Linux later on…

So how this works ?

Hope someone can help me with this.

Thx & Greetings

Teiwaz

This is for serverside high scores, but it shows you how to add info to a db, as well as receive information. It also shows you how to use md5 for security, so people can’t just type the values they want to add in their address bar, and potential cheat. Overall it’s a good tutorial on how to have your UnityScript or C# Script communicate with your php script located on your server, whether it be local or web, and send and receive information to and from your sql db tables.

http://wiki.unity3d.com/index.php?title=Server_Side_Highscores

I currently use the DLL method which works extremely well but it really comes down to how many INSERT/UPDATES you intend throw at MYSQL and if those responses are time critical.

The majority of the queries i currently do are saving user and game data every X seconds and retrieving game data and AI influence updates made by our AI & Event servers every X seconds and so far its not been an issue.

I am currently contemplating a Threaded async queue system for MYSQL queries to see if I can improve server load and data throughput…