Best MySQL Practices

I’m just going to jump into this one.

I could go one of two ways, the first is slightly more flexible than the other with a possible reduction in speed.
I’m here to figure out if it truly will be a reduction in speed or not.

Say each player has a variable for Money/Experience/Something that changes quite frequently and needs to eventually be saved in a database as quickly as possible.

Would one run into issues saving AND loading the value of said variable from the database every time its needed?

I have had issues in the past where the server would lock up for 3-5 seconds just saving a single variable from 10+ players at the same time to the database every 5 minutes(which was changed to every 40min to negate the short lockup, it still happened nonetheless just not as often).

As always your help is most appreciated and thanks in advance!
I’m just trying to prevent recoding a few things down the road if possible. :]

From personal experience using the tmysql module has provided the best results. Threaded MySQL allows it to run in threads instead of at once, allowing it to run alongside everything else. Never seen any issues and it saves instantly. We don’t call it every time, it’s saved in NWVars and NWInts and the like, but when it changes via the PMETAs we have set up it calls the SQL query at the same time.

I’ve only ever used mysqloo, would you be able to provide me a link to check out tmysql? :slight_smile:

[editline]26th June 2013[/editline]

After a bit of searching I found tmysql4 here

I almost accidentally got tmysql3, everywhere is saying 4 is more efficient. ;]