Bbs design based on mysql (1)

Source: Internet
Author: User
Bbs design based on mysql (1) 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 mail, user message, system data (?), Key issues:
Database planning, whether to use files for assistance.
B. System function layer: complete the basic functions of bbs, which consists of multiple parallel modules.
Call the mysql function to access the database, go up, accept the request to be processed
The upper layer of the returned results. The success or failure results and other data are returned based on the request type. And
The module is highly flexible and can be easily modified. Including:
** The user module processes user registration, modification of basic data, and permission changes,
Query user information.
** The Layout module is used to publish an article, read an article, delete an article, and delete an article.
This module has the highest database requirements.
** The Essence module, including the articles and directories in the essence area, is added, deleted, and moved up and down.
(?) Check the read, modify, and delete permissions. the directory structure is difficult.
** Mail module, including sending new letters, reading and deleting letters, letterhead marking, and communicating new letters
Zhi
** The message module includes sending, receiving, new, and review messages,
Message storage.
** System dynamic modules, including the current number of people on the station, are currently dynamic. due to frequent changes,
This type of data may be better implemented using the shared memory.
** In the chat module, can two-person chats use icq for reference? both parties can directly call each other,
However, it may be difficult to save the chat result. 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 a room with permissions
Problem.
New functions can also be added as needed. For example, the activity dashboard module, but for non-
The telnet terminal does not make much sense .....
C. Service Layer: directly communicates with the client and calls the function module to obtain
Data, and then send the data back to the client, according to the client type, develop different
Service module, and abstract as much as possible, so that different service layers can be shared
System function layer module. Including:
+ The cq66 server adopts the original cq66 method and re-plans the protocol to support system functions.
All functions of the layer, but use a dedicated client program (cq66 ).
Lower compatibility is better. the client program needs to be upgraded with the upgrade of the server.
Point inconvenience. If necessary, you can add the encryption function during transmission, similar to ssh.
++ Telnet server, using the old bbs method, some functions are not supported, the client does not need
Upgrade: The server stores the status of the client and determines based on the client's buttons.
State transfer, and thus obtain the required data (such as reading an article ),
Then, request data from the system function layer and process the data (for example, add the top line,
And then return data. you can modify the existing bbsd to save the io module.
But it is difficult to design, except for the article, it is more difficult to modify, but from the beginning
Writing is too laborious.
++ Httpd server requires fewer functions and is relatively simple. it was originally used to directly call mysql
The database can also be used. php can be used directly. However, considering the layering principle, we recommend that you still use c encoding.
I wonder if the cgi method can be modified 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
If you have at least one table and one table for each version, the table structure in the essence area may be more complex.
However, it should always be clearer and more efficient than the bbs file structure.
And the cache function can trust mysql.
B. The size of text fields in mysql is limited to 64 KB in a single article,
From the perspective 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 every time.
Reads dozens of k of data, and then transmits one of the two k data to the user. the database field can be partially compensated.
A part cannot be read from the middle like a file. However, in this way, the field data management of the article
Complex.
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 .........)
3. Database Design
4. User module design
5. Layout module design
6. Bbsd and cq66 server transformation
7. Preliminary test plan.

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.