Optimally saving user data [MySQL]
#1

Currently, I use MySQL account system (r39-2) in the traditional way. You load user data into variables when he connects, and send an UPDATE query when he disconnects.

Sometimes, the server might crash, be DDoSed or whatsoever. I don't want to lose users' data and have a rollback.
What would be the optimal way to solve this?

Saving users' stats every X amount of time?
Updating the MySQL entry whenever the variable changes?

P.S. I have an additional question. Is it okay to use mysql_pquery when OnGameModeExit is called? I'm afraid that the server will shutdown before all threaded queries are executed.
Reply


Messages In This Thread
Optimally saving user data [MySQL] - by yanir3 - 07.10.2014, 23:17
Re: Optimally saving user data [MySQL] - by Eth - 07.10.2014, 23:22
Re: Optimally saving user data [MySQL] - by JacobEdwards - 07.10.2014, 23:24
Re: Optimally saving user data [MySQL] - by Shaneisace - 07.10.2014, 23:43
Re: Optimally saving user data [MySQL] - by yanir3 - 07.10.2014, 23:46
Re: Optimally saving user data [MySQL] - by Shaneisace - 07.10.2014, 23:48
Re: Optimally saving user data [MySQL] - by IceCube! - 07.10.2014, 23:48

Forum Jump:


Users browsing this thread: 2 Guest(s)