Direct
The pomelo Server framework can be divided into two layers: the connection layer (connector, gate) and the service layer (logic, Master), also known as the frontend server) and backend server ).
The connection layer directly communicates with the client over the network. The client requests are forwarded to the logic at the service layer through the connection layer for processing. After the processing, the results are forwarded to the connector.
This structure allows us to expand servers, especially for balancing.
It must be noted that the gate and master are used. The first request sent by the client is sent to the gate server, and then the gate server assigns a connector server to the client. The specific allocation policy is controllable by the program. The master is mainly responsible for server management, such as new server activation and server shutdown.
Because there can be multiple logic servers, the client needs to tell connector which Logic Server the message needs to be sent to when sending a request. Therefore, pomelo introduces the routing mechanism, that is, the route information must be specified for all messages on the client, and the messages are correctly delivered.
Logic servers can be divided into different servers by function, such as scenario servers, chat servers, and user information management servers. Therefore, communication between different servers is inevitable. Therefore, pomelo introduces the RPC mechanism, that is, the communication between all logic servers can be completed through RPC, which is convenient.
References:
Pomelo framework overview https://github.com/NetEase/pomelo/wiki/pomelo%E6%A1%86%E6%9E%B6%E6%A6%82%E8%BF%B0
[3] Server Structure Analysis of pomelo game Server programming sharing