Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic3: How to save your data when the application crash #72

Open
ketoo opened this issue Feb 2, 2018 · 4 comments
Open

Topic3: How to save your data when the application crash #72

ketoo opened this issue Feb 2, 2018 · 4 comments

Comments

@ketoo
Copy link
Owner

ketoo commented Feb 2, 2018

Background:

Player's data is our income. How to save your customer's data when the program crash for whatever reason is a critical problem when designing the architecture.

How can we do something to avoid losing too much data when the disaster happened?
Please leave your idea here to help others solve this problem.

在游戏中,玩家的数据是极其重要的.在程序异常崩溃的情况下,如何尽可能的保存用户的信息是服务器架构的一个关键问题.

因此,如何避免在这种极端情况下丢失大量的用户数据?请尽情发表你的看法来帮助大家解决这个问题吧!

@lafreak
Copy link

lafreak commented Mar 10, 2018

Regularly save player's properties to database (10min? 30min?)

@ketoo
Copy link
Owner Author

ketoo commented Mar 11, 2018

@lafreak It's a way to do this, the disadvantage is that it will lose the data if the process crashed. In my experience, using the share memory object management to manage the player's properties which you want to store that would be better, based on this, it would don't lose any data once the process crashed. Move over we can use another process to save the player's data by order.

In NF world, just need to replace the data of the class "Property" by share memory object can reach the goal.

@H1X4Dev
Copy link

H1X4Dev commented Mar 16, 2018

There are 3 possible approaches for this topic:

  • Flush player data to database every 15 minutes.
  • Always flush player data to database whenever requested or used.
  • Create a crash capturing system so it would save the data of the player before crash ether;
    • Save player data to the database
    • Save player data into a file if database is unavailable during this time and then when the app starts, it would load the saved data from the file and flush it to database before server starts.

I think using an external application for managing the data ("share memory object management to manage the player's properties") would be exactly the same as just pushing data into the database immediately.

@ketoo
Copy link
Owner Author

ketoo commented Apr 22, 2018

@H1X4Dev Great sum. Most of the time people flush player data to the database every 5 minutes or 15 minutes, this solution easy to implement and just only lose 5 or 15 minutes data once the app crashed.

The solution always flushes player data to the database whenever requested or used is great but too expensive, as the result, I want to use an external application for managing the data to reduce the workload of the database.

@ketoo ketoo changed the title Topic3: How to save your data when the application crash (数据回档&拯救) Topic3: How to save your data when the application crash Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants