What do you think about architecture?

ae5c78a954a84fe6a18b7798be6ca6b5.png

main -> view js
http rpc -> there's a stupid proxy between the http and tcp rpc (based on fasthttp). All other services
work RpcTcp
auth service -> service is responsible for rautu with acedamy of Ozerov. He has his own database (auth db)
returns the jwt
service all function -> there are all functions on the idea that does not create much load. As
just what the function of that service, take away 30% of the references to
the service she will be moved to a separate service.
battle service -> the server knows which node created the room (battle node)
battle bot -> Bot. Works with all nodes.

chat * a similar battle part only instead of auto bot there is a moderator. He moder
public chats a machine (a primitive filter Mat which automatic bans in
chat)

each node has its own storage. And in all function for each module (some sort of feature) is also its own database so that in the case of a large load, I could easily make it in a separate service.

Bot and moderator masturbiruut by specifying the addresses to them in the config node)
July 9th 19 at 10:20
3 answers
July 9th 19 at 10:22
Solution
Authorization is not scales? The idea is that it may be the maximum number of requests.
authorization just the minimum number of queries. jwt the same. - Brody_Dickins commented on July 9th 19 at 10:25
July 9th 19 at 10:24
Solution
As said check the authorization. You write about the fact that it is "the minimum number of requests," OK, I believed, and you took into account the possibility that someone is Brutus, I can purposefully felling service authorization? Authorization laid - consider lay down everything else. Pay for this service extra attention. Think about the possible mechanism of scaling, methods of overload protection/fall.

Next, you write that you have a chat & battle are actually one and the same. So my question is, why do they then associate with global services? Make common type of room, which depending on type will be attached either on chat or in battle service.
is there a difference in data storage (huge). Is that the clean signal of the chat server and to combine it with the signal battle server, and a node for chat alone, but for the Other battle. But I even do not like it. - Brody_Dickins commented on July 9th 19 at 10:27
how would advise to masturbirovat auth ? - Brody_Dickins commented on July 9th 19 at 10:30
July 9th 19 at 10:26
Solution
Like big made. Seriously worked.
But there is no explicit horizontal smasshtabirovannogo

UPD:
The review discussed all sorts of technical issues.

But according to the logic in multiplayer
https://habrahabr.ru/post/302394/
Like the same there. The size of the gcd is not restricted. There are two bottlenecks right now. Authorization and signaling server. But what to do with it I don't know. - Brody_Dickins commented on July 9th 19 at 10:29
if you would scale, that would be orchestrating. don't see it. - Brody_Dickins commented on July 9th 19 at 10:32
: and a balancer.
you have some balancing - external or internal? - Brody_Dickins commented on July 9th 19 at 10:35
: I have 3 balancer. nginx proxy fasthttp and signal the servers for the node. - Brody_Dickins commented on July 9th 19 at 10:38
: description occurs in the overall package which compileda in each of the services. - Katlynn_Ha commented on July 9th 19 at 10:41
How many physical servers you can spread out your system?
As will be synchronization between these physical servers? - Katlynn_Ha commented on July 9th 19 at 10:44
Do I need to do a hard sync, or it can be done in deferred mode (like mosh does when using a predictive echo) - Brody_Dickins commented on July 9th 19 at 10:47
: and the management is not thought out. - Brody_Dickins commented on July 9th 19 at 10:50
if you have one physical server will be generally available?
DDoS or just the power supply from the system above.
and what will happen if the server is back operational again. but as he lay he didn't in sync with the others. and what will happen when he comes back with old data. - Katlynn_Ha commented on July 9th 19 at 10:53
: Yes, plenty. Sychronization between the nodes chat is not (each has its own database) but the battle between nodes a pseudo synchronization. They keep the fight in the RAM, and they say signal the server about the result, and he already writes in the DBMS. - Katlynn_Ha commented on July 9th 19 at 10:56
IMHO:

If you are not going to scale horizontally on many physical servers, it is not worth the fuss of these nod - is the only difficulty in the development of add.

If you are going to scale on different physical servers, the task and synchronization management between them is a Herculean task. - Brody_Dickins commented on July 9th 19 at 10:59
And you need to immediately lay the synchronization and orchestration. - Katlynn_Ha commented on July 9th 19 at 11:02
:
> They keep the fight in the RAM, and they say signal the server about the result, and he already writes in the DBMS.

That is, the individual battles? Players don't need to know about what makes the other, if he's suddenly on a different server? - Brody_Dickins commented on July 9th 19 at 11:05
I don't know what you will need. I don't Wang to say that tomorrow I have the 1m players who will stack the server. Right? - Katlynn_Ha commented on July 9th 19 at 11:08
: now to communicate to host 1, I yuzayu UNIX socket - Katlynn_Ha commented on July 9th 19 at 11:11
:
> Sychronization between the nodes chat is not (each has its own dB)

That is, each node is a stand - alone world?
Why then do these difficulties to implement it, if everything is not in one pile running simultaneously?

Enough delayed synchronization table wins (skills, leveling), once in 15 minutes. - Katlynn_Ha commented on July 9th 19 at 11:14
: and I just made a system that knows all the parts of the network (the nodes). monitors, collects logs and I can them from there to manage. - Brody_Dickins commented on July 9th 19 at 11:17
: each node is isolated in the world. True. And with the battle done, because after the battle, go change the profile of the player. Every 15 minutes are not rolled. - Brody_Dickins commented on July 9th 19 at 11:20
: there's just billions of chat rooms (ranging from General and ending with the chat in each room to battle ) battle At the same time he doesn't even know he had a chat. The page is constructed in the main on the basis of the data from signaling servers. And then main directly communicates with the node. - Katlynn_Ha commented on July 9th 19 at 11:23
> I don't know what you will need. I don't Wang to say that tomorrow I have the 1m players who will stack the server. Right?
> Gizmothron: now to communicate to host 1, I yuzayu UNIX socket

If you do not load the scale, there is no need to do so much of the GBR.
And programming easier and more efficient will work in one node.
And balancer not needed.

And if it is planned to expand to multiple servers, then a simple replacement of the unix socket to TCP/IP will not help. Will have to fundamentally alter. - Brody_Dickins commented on July 9th 19 at 11:26
:
> and I just did a system that knows all the parts of the network (the nodes). monitors, collects logs and I can them from there to manage.

That's your business. I'd have finished monitoring Hashicorp Consul or Yandex Cocaine Runtime or Zookeeper or etcd. - Brody_Dickins commented on July 9th 19 at 11:29
: I am now on a local server set up a bunch of virtual servers and out there testing the whole thing. The overhead between the services is not more than 23MS. - Brody_Dickins commented on July 9th 19 at 11:32
: and it seems to work fine. Tomorrow I think to write a bot that will emulate user activity and see how it works under load in 2nd. flows (in the Internet give physical server to test the for 7 days. There and start the bot. So a real connection ) - Katlynn_Ha commented on July 9th 19 at 11:35
:
Well insulated-the game worlds and non-urgent synchronization faster and easier.
I think you have a common playing field.

And if so: then it is all to be one unified service. - Katlynn_Ha commented on July 9th 19 at 11:38
:
> I am now on a local server set up a bunch of virtual servers and out there testing the whole thing. The overhead between the services is not more than 23MS.

Not an indicator.
You actually measure the overhead of virtual machines. - Brody_Dickins commented on July 9th 19 at 11:41
the course overall (it is synchronized with the node Battle) so kacirek can only be at 1 location at the end of the battle I'll sync up all in the General playing field (see all func) - Brody_Dickins commented on July 9th 19 at 11:44
: I measure the overhead of the code. And if there is and I will masturbirovat Fizicheskie on different servers between them is a direct channel without a switch 1 data center ) - Katlynn_Ha commented on July 9th 19 at 11:47
:
That is, 1 node = 1 location?
In fact, players will have to navigate between nodes, when moving on the map?

Then it is not scalable. The only protection that DDoS can you extinguish one location, while others will work successfully. - Katlynn_Ha commented on July 9th 19 at 11:50
: so I don't think that figure podnimetsya more than 30m.with even different physical. - Brody_Dickins commented on July 9th 19 at 11:53
:
> And if there will masturbirovat Fizicheskie on different servers between them is a direct channel without a switch 1 data center )

It's not every data center allows you, if only you will not own servers in colocation.

Typically, servers are isolated from each other and can communicate only via an external Internet, which is slow and the channel is prone to DDoS.

But AWS and OVH have some sort of internal virtual network for some money.

However, this is not the budget amount. So I would have provided just the minimization of the traffic between the servers, between the servers could be external communication channels to use. - Brody_Dickins commented on July 9th 19 at 11:56
And localization of servers that you can play geographically near is not the same as inside the data center. - Katlynn_Ha commented on July 9th 19 at 11:59
: 1 signal server == 1 location. A node is where are the battle - Brody_Dickins commented on July 9th 19 at 12:02
: for the same and is made a part of the signaling servers with a shared database. Network gzip walks. - Katlynn_Ha commented on July 9th 19 at 12:05
: General database - your funds?
or replication of the database? - Katlynn_Ha commented on July 9th 19 at 12:08
: mysql replication - Brody_Dickins commented on July 9th 19 at 12:11
Tin. This traffic - Brody_Dickins commented on July 9th 19 at 12:14
: how else to masturbirovat mysql then? - Katlynn_Ha commented on July 9th 19 at 12:17
replication is not a scaling. rather Vice versa.
replication is durability. - Brody_Dickins commented on July 9th 19 at 12:20
: well, something to read about this? - Katlynn_Ha commented on July 9th 19 at 12:23
https://habrahabr.ru/company/mailru/blog/273695/
Sharding - Brody_Dickins commented on July 9th 19 at 12:26
: thanks! - Katlynn_Ha commented on July 9th 19 at 12:29

Find more questions by tags GoDesigning softwareProgramming