Design of BBS based on MySQL (1)

Source: Internet
Author: User
Tags add key mysql new features one table return client mysql database


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. ), the key question: the planning of the database, whether or not to use documents to assist.



B. system function Layer: completes the basic function of the BBS, consists of several side-by-side modules, to reduce the function of MySQL to access the database, up, accept processing requests, the results of processing returned to the upper level, according to the type of request, return the results of success and other data. And the module is highly flexible and can be easily modified to increase. Including:



* * User module, processing the user's registration, basic data modification, the change of authority, users of information inquiries.



* * Layout module, the completion of the article published, read the article, the deletion of the article, add tags, read delete permission check, this module for the highest database requirements.



* * 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 delete letters, letterhead marks, new letters notice



* * Message modules, including sending messages, receiving messages, new message notifications, message reviews, message deposit letters.



* * System dynamic module, including the current number of stations, current dynamics, due to frequent changes, such data with shared memory implementation may be better.



* * Chat module, whether two people chat can learn from the practice of ICQ, by both sides direct call, but chat results save the letter may be more trouble, at the same time, for compatible with Telnet function, when the upper layer of service to telnet, the addition of specialized modules to deal with.



* * Chat room module, using shared memory or database? Open the room, inside the permission question. 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, call the function module to  and then send the data back to the client, according to the type of client, the development of different service modules, and as reasonable as possible to abstract, so that different service layer, can share the system function layer module. The specific include:



+ + cq66 Server, take the original cq66 way, and the planning protocol to support all functions of the system functional layer, but to use a dedicated client program (CQ66), if you can do backward compatibility is better, the client program to upgrade with the server side, the user may be a little inconvenience. There is a need to add encryption in the process of transmission, similar to SSH.



+ + Telnet Service side, using the old BBS way, some features do not support, the client does not need to upgrade, the server side to save the state of the client side, and according to the client key to determine the state of the transfer, and thus the required data, (such as reading an article), and then to the system functional layer request data, Then the data is processed (for example, with the top row, the tail line) and then return the data, can be modified on the existing BBSD, you can omit the IO module design but more difficult, in addition to the article aspects of the better, other difficult to change, but write from scratch too laborious.



+ + httpd Server, the required functionality is less, relatively simple, the direct call to the MySQL database can be directly used in PHP, but in view of the principle of layering, the proposal is still in the way of C-series CGI 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 user has 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, sorting and cache function can rely on MySQL bar.



B. MySQL Chinese this field size limit, limit an article must not be greater than 64k, and from an efficient point of view, it may be better to store an article in the largest 2k block, so that when the Telnet user reads the article, the Telnet server does not have to query the database every time to read dozens of K of data, One of the 2k is passed to the user, and the local compensation database field cannot read a part from the middle as a file. But this article field data management is 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




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.