BBS Design Based on MySQL (1)

Source: Internet
Author: User

1. System Architecture:

The modular concept is divided into three layers:

A. Data storage layer: mysql is used to store all bbs data, including user information, article data, user emails, user messages, and system data ?), Key Issue: Database Planning, whether to use files for assistance.

B. System Function Layer: completes the basic functions of bbs, which consists of multiple parallel modules. It calls the mysql function down to access the database, receives and processes requests, and returns the processed results to the upper layer, returns the success or failure results and other data based on the request type. The module is highly flexible and can be easily modified. Including:

** The User Module processes user registration, modification of basic data, permission changes, and query of user information.
** The layout module has the highest Database Requirements for publishing an article, reading an article, deleting an article, marking an article, and checking the read, modify, and delete permissions.
** Essence module, including articles in the essence area, directory addition, deletion, and up/down movement


?) Check the read, modify, and delete permissions. The directory structure is difficult.

** The mail module includes sending new letters, reading and deleting letters, letterhead marks, and notifications of new letters.
** The message module includes sending, receiving, New Message notification, message review, and message saving.
** System dynamic modules, including the current number of people on the site, are currently dynamic. Due to frequent changes, such data may be better implemented using shared memory.
** In the chat module, whether the dual chat can learn from icq can be directly called by both parties. However, it may be difficult to store emails in the chat results. At the same time, it is compatible with the telnet function, when the upper-layer service layer is telnet, a dedicated module is added for processing.
** Does the chat room module use shared memory or database? Open the room, which contains permission issues. New functions can also be added as needed. For example, the event dashboard module does not make much sense for non-telnet terminals .....

C. Service layer: directly communicates with the client. Based on the client's request, the function module is called to obtain data, and then the data is sent back to the client. Different service modules are developed based on the client type, in addition, it is possible to abstract as reasonably as possible so that different service layers can share modules at the system function layer. Including:

+ The cq66 server adopts the original cq66 method and re-plans the Protocol to support all functions at the system function layer, but uses a dedicated client program cq66 ), it is better to achieve backward compatibility. The client program must be upgraded with the upgrade of the server, which may be inconvenient for users. If necessary, you can add the encryption function during transmission, similar to ssh.
++ The telnet server adopts the old bbs mode. Some functions are not supported and the client does not need to be upgraded. The server needs to save the client's status and determine the status transfer based on the client's buttons, then obtain the required data, such as reading an article), request data from the system function layer, and then process the data, such as adding the top line and the end line), and then return the data, it can be modified on the existing bbsd to save the design of the I/O module but it is more difficult. In addition to the article, it is more difficult to modify other modules, but it is too laborious to write from the beginning.
++ Httpd server requires fewer functions and is relatively simple. You can directly call the mysql database and use php directly. However, considering the layered principle, we recommend that you still use the c-compiled cgi method. I wonder if I can modify it based on the original one? Probably not.

Key and difficult points of the system:

A. Does mysql support a large number of tables in the database design? Tens of thousands? Each user has at least one table, and each version has one table. The table structure in the essence area may be more complex.
However, it should always be clearer and more efficient than the file structure of bbs. The sorting and cache functions can trust mysql.
B. The size limit of text fields in mysql cannot exceed 64 kB in a single article. In terms of efficiency, it may be better to store an article in units of 2 K, in this way, when a telnet user reads an article, the telnet server does not need to query the database to read dozens of k of data every time, and then transmits one of the two k data to the user, partially compensated database fields cannot be read from the center like files. However, the management of field data in the article is complicated.

2. System Development Plan:

First, consider the user module and layout module, and plan the data structure. It should be easy to integrate with the existing bbsd.
. Then consider other modules ?.......
// Enter the following when you are free ..... Go to bed first .. Hmm .........)


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.