java - Scalability advice for large game site -


I am creating a website where players can play a turn based game for virtual credit (like a Poker site, but different). I came up with that setup:

  • A data server that includes all player accounts with related data (a database + service).
  • One or more web servers that serve the website, when the data connects to the server when needed.
  • A lobby server where players
  • Many game servers where the game is played (all rules and such servers are on the client, the client is just a remote control and viewer), with a load balancer .
  • A game client

will be created with the client flash, the webserver will use PHP, the rest are all Java.

Communications

  • On the player log in site. The webserver sends the user's name / password to the data server, which creates a session key (such as a cookie)
  • The player starts the client connects to the client lobby server, passes the session key The lobby server checks this key with the data server
  • After the lobby is created and the launch begins, the lobby server loads a game server from the load balancer and sets a game on this game serverLand.
  • The lobby server asks the client to connect to the game server and the game is played.
  • When the game is over, the game server lobby allows the server to know that the lobby will check the server score and update the credit in the data server.

Protocol :

  • Java in Java: RMI
  • PHP or Flash in Java: Socket Custom Binary Protocol Through

If the client has their own desire, then the site will need to support thousands of concurrent players. With this information, can you see any obstacles in my setup? I am personally worried about the existence of only one data server, but I am not sure how to separate it, other scalability (or other) comments are also welcome.

There are many single services in your architecture that work for any user for any part of the system Important to do I understand them.

  • You may want to consider (or horizontal partition) for your data server.
  • Consider the many lobby servers Flash client still hide them in the form of a single lobby, if you want to privately, I do not like to play games with people with whom I I can not even speak in the language which I do not understand. Apart from this, I prefer not to be involved in finding ninety thousand games in any lobby server and I do not know anyone. Make many lobbies a feature (when you thought it, you can actually do it). There is no real use for the lobby with 10000 people. If you still want to go through it, then on the basis of perception, that one player has to specify one or several parameters for specific parameters (opponent level, game type, etc.) Depending on the trunk trying to split the lobby, still can try to split.
  • Load balance does not really require enough power to be a physical server. Why not repeat it on all lobby servers? Everyone has to know that there is availability / server, you have 10000 game servers (which I think is a complete fucking in this case) and the refresh rate of 1 second (which is far more than enough here) All of you are synchronized, 10000 integers per second (assuming you can represent the availability as a number (which I think you can do)). If you find something better than adding every game server with every lobby server, then they do not need a lot of connections on the same machine.

In this type of application, I feel horizontal, splitting is a good idea, because it can be easily done for one and add credibility to the system. Assume that your SPO is divided, rather than being redundant, it is easy and probably cheaper if any part of SPOF goes down (we say our 20 free and physically distributed data servers), this is bad, Because your 5% of the players are locked but maybe it will be up soon. If your SPF is unnecessary, then there are fewer possibilities that anything fails. But if this happens then everyone is closed. This is an issue because you will have an attempt to get everyone back online at the same time. After your SPOF is back, it will generally be hit with the number of orders requested for maximum magnitude to handle. And yet you can keep horizontal division and redundancy at the same time, as is proposed for the balance service.


Comments