The BBS design based on MySQL (a) _php tutorial

Source: Internet
Author: User
1. System Architecture:
Using modular thinking, divided into 3 layers:
A. Data storage layer: Use MySQL to store all BBS data, including user information,
Article data, user letters, user messages, system data (? ), the key question:
Database planning, whether files are used to assist.
B. system function Layer: complete the basic functions of BBS, composed of multiple parallel modules, downward
Call the MySQL function to access the database, up, accept processing requests, will handle the
The result returns to the upper layer, depending on the request type, returning success or failure results and other data. And
The module is highly flexible and can be easily modified and added. Including:
* * User module, processing user registration, basic data modification, change of permissions,
The query of the Netizen information.
* * Layout module, complete the article publication, the article reads, the article deletion, the article
tag, read and delete permission check, this module has the highest requirements for the database.
* * Essence area module, including the essence area of the article, directory additions, deletions, move up and down
(? Read and delete permission check, directory structure is one of the difficulties.
* * Letter module, including sending new letters, reading and deleting letters, letterhead marks, new letters of communication
Know
* * Message module, including send message, accept message, new message notification, message review,
Messages are stored in the mail.
* * System dynamic module, including the current number of stations, the current dynamic, due to frequent changes,
This type of data may be better implemented with shared memory.
* * Chat module, whether the two chat can learn from the practice of ICQ, by both sides of the direct call,
But the chat results save the letter may be more cumbersome, while, for compatibility with the Telnet function, when
When the upper layer of service is Telnet, additional specialized modules are added for processing.
* * Chat room module, using shared memory or database? Open the room, inside the authority
Problem.
New features can be added as needed. For example: The active Kanban module, but for non-
Telnet terminal, the meaning does not seem very big .....
C. Service layer: Directly and the client dialog, according to the client's request, call the function module to obtain
Data, and then sends the data back to the client, depending on the type of client, to develop separate
service modules, and as reasonably as possible to abstract, so that the different service tiers, can be shared
Module of the system functional layer. Details include:
+ + cq66 Server, take the original cq66 way, and re-plan the Protocol to support system functions
Layer, but with a dedicated client program (CQ66), if you can
Compatibility is better, client programs to upgrade with the server upgrade, users may have
Point of inconvenience. There is a need to include encryption in the transfer process, similar to SSH.
+ + Telnet Server, using the old BBS way, some features are not supported, the client does not need to
Upgrade, the server side to save the client's state, and according to the client's key to determine
The required data, (e.g. reading an article), and
Request data to the system functional layer and then process the data (for example, by adding a top row,
Last line) then return the data, can be modified on the existing BBSD, can save the IO module
Design but more difficult, in addition to the article a little better, other difficult to change, but from the beginning
It's too laborious to write.
+ + httpd server, less functionality required, relatively simple, would have directly called MySQL
Database also line, directly can be used in PHP, but considering the principle of layering, the proposal is still in the C-series
The way the CGI is implemented, I wonder if I can change it on the original basis? I guess not.
Key and difficult points of the system:
A. Database design, does MySQL support a large number of table? For example, tens of thousands of? Each
Users at least one table, and then one table per edition, the table structure of the essence area may be more complex.
But it should always be more clear than the current BBS file structure, efficiency is a little bit, sort
And the function of the cache can rely on MySQL.
B. MySQL Chinese this field size limit, limit an article must not be more than 64k not too much,
And from an efficiency point of view, it may be better to store an article in blocks of up to 2k
This way, when a telnet user looks at an article, the Telnet server does not have to query the database every time
Read dozens of k data, and then pass one of 2k to the user, can compensate the database field locally
You cannot read a portion of it from the middle like a file. However, this article manages the field data
More complex.
2. System Development Plan:
First consider the user module and layout module, planning the data structure, it should be easy and existing BBSD combination
Up. Then consider other modules .....
(//The following is 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 Retrofit
7. Preliminary test Plan.

http://www.bkjia.com/PHPjc/316248.html www.bkjia.com true http://www.bkjia.com/PHPjc/316248.html techarticle 1. System architecture: Using modular thinking, divided into 3 layers: a. Data storage layer: Use MySQL to store all BBS data, including user information, article data, user letters, user messages ...

  • 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.