CMHDev Posted May 29, 2022 Posted May 29, 2022 (edited) The situation is as follows... We have 3 methods to save data: 1 - We save player data every time it changes. 2 - We save player data at a time interval. 3 - We save player data when disconnecting from the server. Now the question is, which method is more optimized and which of them have a low risk of data loss in case of an error. In my opinion method 1 is good for data security but we lose on the optimization side (so I think) even if we use async PS. I forgot to specify that we use mysql Edited May 29, 2022 by CMHDev I forgot to specify that we use mysql
Champa Posted May 29, 2022 Posted May 29, 2022 First one should be ok as long as you don't block the main thread and use pooled connections (see: https://www.npmjs.com/package/mysql2#using-connection-pools) 1
Kopra Posted May 30, 2022 Posted May 30, 2022 I save money on every change, few things on payday like xp,level and most of the things on player disconnect. I think you should balance it depending on what you are saving and how often data is changed. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now