Home Backend Development PHP Tutorial BBS design based on mysql_PHP tutorial

BBS design based on mysql_PHP tutorial

Jul 13, 2016 pm 05:25 PM
bbs mysql one use based on storage Thought data Architecture Modular of system design use

1. System architecture:
Adopts modular thinking and is divided into 3 layers:
a. Data storage layer: use mysql to store all data of bbs, including user information,
article data, user letters, user messages, system data (?). Key question:
Whether to use files to assist database planning .
b. System function layer: completes the basic functions of bbs, composed of multiple parallel modules, downward
calls the function of mysql to access the database, upward, accepts the processing request, returns the processed
result to the upper layer, and returns according to the request type Success or failure results and other data. Moreover, the
module is highly flexible and can be easily modified and added. Includes:
** User module, which handles user registration, modification of basic data, changes in permissions,
query of netizen information.
** The layout module completes article publishing, article reading, article deletion, article
tagging, and read, modify, and delete permission checks. This module has the highest requirements for the database.
** Essence area module, including essence area articles, adding, deleting, and moving up and down directories
(?) Read, modify, and delete permissions check, the directory structure is one of the difficulties.
** Letter module, including sending new letters, reading and deleting letters, letterhead marking, notification of new letters
Notification
** Message module, including sending messages, receiving messages, new message notifications, message review,
Messages are stored in letters.
** System dynamic module, including the current number of people on the site, current dynamics, due to frequent changes,
It may be better to use shared memory to implement such data.
** In the chat module, can the two-person chat learn from the practice of icq, with both parties talking directly?
But it may be troublesome to save the chat results. At the same time, in order to be compatible with the telnet function, when
the upper service layer is telnet When, add special modules for processing.
** Chat room module, use shared memory or database? Opening a room, permissions inside
issue.
New functions can be added as needed. For example: the activity board module, but for non-
telnet terminals, it seems to have little meaning. . . . .
c. Service layer: directly talks to the client, calls the function module to obtain
data according to the client's request, and then sends the data back to the client. According to the type of client, develop different
service modules, and try to Properly abstract so that different service layers can share
modules of the system function layer. Specifically include:


++ The cq66 server adopts the original cq66 method and re-plans the protocol to support all functions of the system function
layer, but it must use a specialized client program (cq66). If it can be done to
It is better to be compatible with the lower version. The client program needs to be upgraded with the upgrade of the server. Users may have
some inconvenience. If necessary, encryption function can be added during the transmission process, similar to ssh.
++ Telnet server uses the old bbs method. Some functions are not supported. The client does not need to be
upgraded. The server needs to save the client's status and judge the
status transfer based on the client's keys. , and obtain the required data (such as reading an article), then
request the data from the system functional layer, and then process the data (such as adding the top row,
the last row) and then The returned data can be modified on the existing bbsd. It can save the design of the io module
but it is more difficult. Except for the better article, it is difficult to modify other aspects, but it is too laborious to write from scratch
.
++ The httpd server requires fewer functions and is relatively simple. Originally, it would be OK to directly call mysql
The database can be directly used. PHP can be used directly, but considering the principle of layering, it is recommended to still use C programming
I wonder if it can be modified based on the original implementation using cgi? Probably not.
Key points and difficulties of the system:
a. Database design, does mysql support a large number of tables? For example, tens of thousands? Each
user has at least one table, and then each version has one table. The table structure in the essence area may be more complex.
But it should always be clearer and more efficient than the current bbs file structure. You can trust mysql for sorting
and cache functions.
b. The size limit of the text field in MySQL is to limit an article to no larger than 64k.
And from an efficiency point of view, it may be better to store an article in blocks of up to 2k.
In this way, when When a telnet user reads an article, the telnet server does not need to query the database
every time to read dozens of kilobytes of data, and then pass 2k of them to the user. This can partially compensate for the fact that the database field
cannot be read from the middle like a file. Take a portion. However, the management of article field data
is more complicated.
2. System development plan:
Consider the user module and layout module first, and plan the data structure. It should be easy to
combine with the existing bbsd. And then consider other modules? . . . . . . .
(//I will write the following when I have time... Go to sleep first...hmm......)
3. Database design
4. User module design
5. Layout module design
6. bbsd and cq66 server-side modification
7. Preliminary test plan.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532070.htmlTechArticle1. System architecture: Adopts modular thinking and is divided into 3 layers: a. Data storage layer: use mysql to store all data of bbs, including user information, article data, user letters, user messages...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

How to optimize MySQL query performance in PHP? How to optimize MySQL query performance in PHP? Jun 03, 2024 pm 08:11 PM

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

Honor Magic V3 debuts AI defocus eye protection technology: effectively alleviates the development of myopia Honor Magic V3 debuts AI defocus eye protection technology: effectively alleviates the development of myopia Jul 18, 2024 am 09:27 AM

According to news on July 12, the Honor Magic V3 series was officially released today, equipped with the new Honor Vision Soothing Oasis eye protection screen. While the screen itself has high specifications and high quality, it also pioneered the introduction of AI active eye protection technology. It is reported that the traditional way to alleviate myopia is "myopia glasses". The power of myopia glasses is evenly distributed to ensure that the central area of ​​​​sight is imaged on the retina, but the peripheral area is imaged behind the retina. The retina senses that the image is behind, promoting the eye axis direction. grow later, thereby deepening the degree. At present, one of the main ways to alleviate the development of myopia is the "defocus lens". The central area has a normal power, and the peripheral area is adjusted through optical design partitions, so that the image in the peripheral area falls in front of the retina.

How to use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Jun 02, 2024 pm 02:58 PM

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

How to insert data into a MySQL table using PHP? How to insert data into a MySQL table using PHP? Jun 02, 2024 pm 02:26 PM

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values ​​to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

How steep is the learning curve of golang framework architecture? How steep is the learning curve of golang framework architecture? Jun 05, 2024 pm 06:59 PM

The learning curve of the Go framework architecture depends on familiarity with the Go language and back-end development and the complexity of the chosen framework: a good understanding of the basics of the Go language. It helps to have backend development experience. Frameworks that differ in complexity lead to differences in learning curves.

See all articles