What is a server? For many people it may just be simple to become a program running on the server, and the server is usually meant to be a program that runs on the server side. So how do we understand and analyze game servers?
In the traditional sense, after the program runs, the normal process,
Start-up-load necessary data--analysis of necessary data--Accept connection, login system, Exchange data--exit login.
So the idea of a single-threaded server is done. Experienced students can see that this is the simplest program to run the process, there is a major problem is that this is a single-threaded process, carrying capacity is not natural, the throughput will naturally decline.
What if we change to multithreading? After changing to multi-threading, how to ensure the integrity of the data, accuracy? I will explain this question in the following one by one words.
Usually in the game server design, divided into single server and group server,
Single server (including login module, logic module, data exchange module);
The group server is the login server, the logical server, and the data Exchange Server. Here again can be divided into
Login server 1-"Logical server 1-" Data Exchange Server 1,
Login server 2-"Logical server 2-" Data Exchange Server 2,
Login Server N-"logical Server N-" data Exchange Server N,
Typically, a data Exchange server can provide a set of logins and logical servers to use.
The data exchange here can be understood as data cache module, data update module, data storage module. is the exchange of program data and database storage data,
In general, the design of logic modules is a very complex thing. I'll take a step-by-step look at the following article.
Step-by-step development of Game server (i)