V
V
Vadim2015-01-27 00:30:17
Game development
Vadim, 2015-01-27 00:30:17

Optimal network game server architecture?

Good day.
Started making a simple online game. Made a server base on ASP.NET WebApi and SignalR and a client on node-webkit. While the last commit was pushing, I realized that I was doing everything completely wrong, as it should be, and everything had to be radically redone. From this a few questions arose:

  • I believe that a separate authorization server will greatly simplify life. How is it done today? He should only look at the local network, probably, and applications (website, game servers) check the correctness of his login / password, get roles? Is it normal if it provides some kind of REST interface, and HTTP requests are made to it?
  • Server runtime. I have vague doubts that ASP.NET is the right choice, but I can not argue. The only alternatives that come to mind are Node.js (or IO.js) and Erlang. It is quite expensive to rebuild thinking and change habits for the second one, I would like to get some kind of demo this year, given that I have very little free time to deal with this project. And as for the node, I have mixed feelings - I saw a bunch of articles where they douse it as soon as they can (and the memory flows that only "restarting once a minute will help", and hellish debugging and everything is terrible in general), but at the same time it is all so asynchronous, fast and in general it is necessary to write only on it. So how are things going with her now? Can it, for example, be deployed in a cluster without wild dances with tambourines? To have a certain master server, which would distribute tasks between slave servers. Or organize some simple transparent messaging between nodes, a la Erlang. Is it worth it at all, or are there any best practices for architecture of scalable game servers on a node? The game will be real-time, sockets will definitely be needed, in this regard, php for game servers is probably not very suitable.
  • As a result, I see the picture something like this: an authorization server, a server with a website, a login server for connecting clients and spitting out the state of the game world, updates, news and maybe a list of shards in them, if running a large server in a cluster will be problematic and, in fact , the game servers themselves. All this good is pulled by the authorization server when accessing them. Is this schema correct?

I do not give preference to specific technologies, but initially I have experience with JS, PHP, and C # in the process of learning. In terms of NoSql database, I don’t really want to use solutions, maybe it will be postgres because of this flexibility. And yes, I understand that if we talk about such scales and architectures, then I should already be able to decide on it myself, but when faced with situations in life when projects started just like that, and then remained like that, or there was a long , painful and expensive refactoring, then I would like to go in the right direction from the very beginning of the path.
I apologize for the possible confusion, tomorrow afternoon I can edit the voros.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yeletsky, 2015-01-27
@Enapiuz

pre-optimization is the EVIL of
KISS
You described well what you want to do, but didn't say a word about why you want it:
- what kind of interaction between the player and the server is planned?
- what loads are expected? Average, peaks...
Without knowing the answers to these questions, there is only one answer to your question: do as you please. Because there are no criteria for choosing an architecture.
Here is a universal decision rule: “Does X solve any problem? If it decides, we do X, if it doesn’t decide, we don’t do it.”

A
Alexey Lebedev, 2015-01-27
@swanrnd

As for authorization, it is always easier to check some kind of authorization key. How to check login and password. But this is not critical.
It is better to store similar in OP. client id - key - role
Write in ASP.NET, it's not bad technology. Write better on it than on NodeJS if you study the last couple of months.
It would also be nice to have a separate server for statics or CDN.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question