Design of BBS based on MySQL (i.)

Source: Internet
Author: User
Tags functions mysql new features one table
1. System Architecture:
Using modular thinking, divided into 3 layers:
A. Data storage layer: Use MySQL to store all the data of BBS, including user information,
Article data, user letters, user messages, System data (?) ), Key issues:
Database planning, whether or not to use a file to assist.
B. System Functional Layer: complete the basic functions of BBS, composed of multiple parallel modules, downward
Call MySQL's function to access the database, up, accept processing requests, and will handle the
The results are returned to the upper level, and the results of success and other data are returned depending on the type of request. And
The module is highly flexible and can be easily modified to increase. Including:
* * User module, processing the user's registration, basic data modification, permission changes,
Information of the user inquiries.
* * Layout module, complete the article published, read the article, delete the article, the article
Tagging, read and delete permission checks, this module on the database requirements of the highest.
* * Essence area module, including the essence of the article, directory of the increase, delete, move up and down
(? Read and delete permission check, directory structure is one of the difficulties.
* * Letter modules, including new letters, read and delete letters, letterhead marks, new letters to pass
Know
* * Message modules, including sending messages, receiving messages, new message notifications, message reviews,
Messages are stored in letters.
* * System dynamic module, including the current number of stations, the current dynamic, due to frequent changes,
This type of data can be better achieved with shared memory implementations.
* * Chat module, whether two people chat can learn from the practice of ICQ, by both sides direct calls,
But chat results save letters may be more cumbersome, while, for compatibility with telnet features, when
When the upper service layer is Telnet, it adds a specialized module for processing.
* * Chat room module, using shared memory or database? Open the room, the right inside.
Problem.
You can add new features as needed. For example: Active Kanban module, but for non-
Telnet terminal, the meaning is not as good as ...
C. Service layer: Direct and client dialogue, according to the client's request, invoke the function module to obtain
Data, and then sends the data back to the client, depending on the type of client, to develop different
Service module, and as reasonable as possible to abstract, so that the different service layer, can share
The module of the system function layer. The specific include:
+ + cq66 Server, take the original cq66 approach, and re-planning the Protocol to support system functions
Layer of all functions, but to use a dedicated client program (CQ66), if it can be done to
Under Compatibility is better, the client program to upgrade with the server side, the user may have
Little inconvenience. There is a need to add encryption in the process of transmission, similar to SSH.
+ + Telnet Server, using the old BBS way, some features do not support, the client does not need
Upgrade, the server side to save the state of the client side, and according to the client key to judge
The transfer of State, and thus the required data, (e.g. reading an article),
Then request the data from the system functional layer and then process the data (for example, with the top row,
Last line) then returns the data, which can be modified on the existing BBSD, eliminating the IO module
The design but more difficult, in addition to the article aspects better, other more difficult to change, but from the beginning
Write too much effort.
+ + httpd Server, the required functionality is less, relatively simple, would have directly called MySQL
The database is also OK, direct can use PHP, but considering the layering principle, the proposal still uses C to edit
The way the CGI implementation do not know can be modified on the original basis? I guess not.
The key and difficult points of the system:
A. Database design, does MySQL support a large number of table? Like tens of thousands of? Each
Users at least one table, and then each version of a table, the essence of the table structure may be more complex.
But it should always be more clear than the current BBS file structure, efficiency is a bit higher, sort
and cache function can rely on MySQL bar.
B. MySQL Chinese this field size limit, limit an article must not be greater than 64k not too much bar,
And in terms of efficiency, it may be better to store an article with a maximum of 2k blocks,
This way, when the Telnet user looks at the article, the Telnet server does not have to query the database every time
Read dozens of k of data, then one of the 2k to the user, can be local compensation database field
You cannot read a section from the middle like a file. But this way, the management of the article field data
More complex.
2. System Development Plan:
Consider user module and layout module first, plan good data structure, it should be easy to combine with existing BBSD
Up. And then consider the other modules?
(//The following are free to write again ...) Go to bed first. Hmm ..... )
3. Database design
4. User module Design
5. Layout module Design
6. Bbsd and cq66 server-side transformation
7. Preliminary test Plan.

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.