1. System architecture:
Adopts modular thinking and is divided into 3 layers:
a. Data storage layer: use mysql to store all data of bbs, including user information,
article data, user letters, user messages, system data (?). Key question:
Whether to use files to assist database planning .
b. System function layer: completes the basic functions of bbs, composed of multiple parallel modules, downward
calls the function of mysql to access the database, upward, accepts the processing request, returns the processed
result to the upper layer, and returns according to the request type Success or failure results and other data. Moreover, the
module is highly flexible and can be easily modified and added. Includes:
** User module, which handles user registration, modification of basic data, changes in permissions,
query of netizen information.
** The layout module completes article publishing, article reading, article deletion, article
tagging, and read, modify, and delete permission checks. This module has the highest requirements for the database.
** Essence area module, including essence area articles, adding, deleting, and moving up and down directories
(?) Read, modify, and delete permissions check, the directory structure is one of the difficulties.
** Letter module, including sending new letters, reading and deleting letters, letterhead marking, notification of new letters
Notification
** Message module, including sending messages, receiving messages, new message notifications, message review,
Messages are stored in letters.
** System dynamic module, including the current number of people on the site, current dynamics, due to frequent changes,
It may be better to use shared memory to implement such data.
** In the chat module, can the two-person chat learn from the practice of icq, with both parties talking directly?
But it may be troublesome to save the chat results. At the same time, in order to be compatible with the telnet function, when
the upper service layer is telnet When, add special modules for processing.
** Chat room module, use shared memory or database? Opening a room, permissions inside
issue.
New functions can be added as needed. For example: the activity board module, but for non-
telnet terminals, it seems to have little meaning. . . . .
c. Service layer: directly talks to the client, calls the function module to obtain
data according to the client's request, and then sends the data back to the client. According to the type of client, develop different
service modules, and try to Properly abstract so that different service layers can share
modules of the system function layer. Specifically include:
++ The cq66 server adopts the original cq66 method and re-plans the protocol to support all functions of the system function
layer, but it must use a specialized client program (cq66). If it can be done to
It is better to be compatible with the lower version. The client program needs to be upgraded with the upgrade of the server. Users may have
some inconvenience. If necessary, encryption function can be added during the transmission process, similar to ssh.
++ Telnet server uses the old bbs method. Some functions are not supported. The client does not need to be
upgraded. The server needs to save the client's status and judge the
status transfer based on the client's keys. , and obtain the required data (such as reading an article), then
request the data from the system functional layer, and then process the data (such as adding the top row,
the last row) and then The returned data can be modified on the existing bbsd. It can save the design of the io module
but it is more difficult. Except for the better article, it is difficult to modify other aspects, but it is too laborious to write from scratch
.
++ The httpd server requires fewer functions and is relatively simple. Originally, it would be OK to directly call mysql
The database can be directly used. PHP can be used directly, but considering the principle of layering, it is recommended to still use C programming
I wonder if it can be modified based on the original implementation using cgi? Probably not.
Key points and difficulties of the system:
a. Database design, does mysql support a large number of tables? For example, tens of thousands? Each
user has at least one table, and then each version has one table. The table structure in the essence area may be more complex.
But it should always be clearer and more efficient than the current bbs file structure. You can trust mysql for sorting
and cache functions.
b. The size limit of the text field in MySQL is to limit an article to no larger than 64k.
And from an efficiency point of view, it may be better to store an article in blocks of up to 2k.
In this way, when When a telnet user reads an article, the telnet server does not need to query the database
every time to read dozens of kilobytes of data, and then pass 2k of them to the user. This can partially compensate for the fact that the database field
cannot be read from the middle like a file. Take a portion. However, the management of article field data
is more complicated.
2. System development plan:
Consider the user module and layout module first, and plan the data structure. It should be easy to
combine with the existing bbsd. And then consider other modules? . . . . . . .
(//I will write the following when I have time... Go to sleep first...hmm......)
3. Database design
4. User module design
5. Layout module design
6. bbsd and cq66 server-side modification
7. Preliminary test plan.
http://www.bkjia.com/PHPjc/532070.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532070.htmlTechArticle1. System architecture: Adopts modular thinking and is divided into 3 layers: a. Data storage layer: use mysql to store all data of bbs, including user information, article data, user letters, user messages...