Socket data storage problems

Source: Internet
Author: User
Socket data storage problems this post was last edited by cwk44 in 2014-03-1913: 15: 57. Currently, socket connections are implemented using html5 websocket and php, prepare a persistent connection game, prepare a server to support about 100 gamers (try to increase the number of players after going online), and play 5-8 games in one room and one game. Now there is a problem, the current game socket data storage problems

This post was last edited by cwk44 at 13:15:57

Currently, html5 websocket and php are used for socket connection. we are going to make a persistent connection game,
Prepare a server to support about 100 gamers (try to increase the number of players after going online) and 5-8 players in a room/game board.

Now there is a problem where the current game data is good. (Where is the game result data stored in the database)
Global variables:
Storage in global variables can certainly be achieved, and the performance is the best,
However, if the process goes down, the current number of game data disappears, and all players have to start from the game hall again.
Redis:
It is safer to store redis. if the process crashes, the player should be able to continue the game after the restart of the process,
However, the performance is definitely worse than that of global variables. I don't know if this design is necessary.
(Currently, I only want to rent one server. I don't know if redis will be suspended together)

The main reason is that you do not know how likely the process will be crashed, and how much impact the performance will be caused by using redis.
Have you ever taught me any experience in this area before.
------ Solution --------------------
We look forward to your experiences.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.