Home Backend Development PHP Tutorial BBS design based on mysql (1)_PHP tutorial

BBS design based on mysql (1)_PHP tutorial

Jul 21, 2016 pm 04:03 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 questions:
whether to use files to assist database planning .
b. System functional layer: completes the basic functions of bbs, composed of multiple parallel modules, downward
calling mysql functions to access the database, upward, accepting processing requests, and returning the processed
results to the upper layer. According to the request type, return Success or failure results and other data. Moreover,
the module is highly flexible and can be easily modified and added. Including:
** User module, 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 marking
, and read, modify, and delete permission checks. This module has the highest requirements for the database.
** The essence area module includes articles in the essence area, adding, deleting, and moving up and down directories.
(?) Read, modify, and delete permission checks. The directory structure is one of the difficulties.
** Letter module, including sending new letters, reading and deleting letters, letter mark, 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 this type of 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
problem.
New functions can be added as needed. For example: activity signage module, but for non-
Telnet terminals, it seems to have little meaning. . . . .
c. Service layer: Talk directly to the client. According to the client's request, call the function module to obtain
data, and then send the data back to the client. According to the type of client, develop different
service modules respectively, and try our best to Properly abstract so that different service layers can share
modules of the system function layer. Specifically include:
++ cq66 server, adopt the original cq66 method, and re-plan the protocol to support all functions of the system function
, but use a special client program (cq66), if it can be done It would be better to be compatible with
downwards. 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 according to the client's keys. , and obtain the required data (such as reading an article), and 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 Returning 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 article, it is more difficult to modify, but it is too laborious to write from scratch
.
++ The httpd server requires fewer functions and is relatively simple. Originally, calling mysql directly
The database is also fine. You can directly use PHP, but considering the principle of layering, it is recommended to still use C to compile
🎜> 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 text fields 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
Read dozens of kilobytes of data, and then pass 2k of them to the user, which can partially compensate for the database fields
which 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 bed 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/316248.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
4 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

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

70B model generates 1,000 tokens in seconds, code rewriting surpasses GPT-4o, from the Cursor team, a code artifact invested by OpenAI 70B model generates 1,000 tokens in seconds, code rewriting surpasses GPT-4o, from the Cursor team, a code artifact invested by OpenAI Jun 13, 2024 pm 03:47 PM

70B model, 1000 tokens can be generated in seconds, which translates into nearly 4000 characters! The researchers fine-tuned Llama3 and introduced an acceleration algorithm. Compared with the native version, the speed is 13 times faster! Not only is it fast, its performance on code rewriting tasks even surpasses GPT-4o. This achievement comes from anysphere, the team behind the popular AI programming artifact Cursor, and OpenAI also participated in the investment. You must know that on Groq, a well-known fast inference acceleration framework, the inference speed of 70BLlama3 is only more than 300 tokens per second. With the speed of Cursor, it can be said that it achieves near-instant complete code file editing. Some people call it a good guy, if you put Curs

AI startups collectively switched jobs to OpenAI, and the security team regrouped after Ilya left! AI startups collectively switched jobs to OpenAI, and the security team regrouped after Ilya left! Jun 08, 2024 pm 01:00 PM

Last week, amid the internal wave of resignations and external criticism, OpenAI was plagued by internal and external troubles: - The infringement of the widow sister sparked global heated discussions - Employees signing "overlord clauses" were exposed one after another - Netizens listed Ultraman's "seven deadly sins" Rumors refuting: According to leaked information and documents obtained by Vox, OpenAI’s senior leadership, including Altman, was well aware of these equity recovery provisions and signed off on them. In addition, there is a serious and urgent issue facing OpenAI - AI safety. The recent departures of five security-related employees, including two of its most prominent employees, and the dissolution of the "Super Alignment" team have once again put OpenAI's security issues in the spotlight. Fortune magazine reported that OpenA

New stacking process! Xiaomi MIX Fold 4 is equipped with Jinshajiang 'three-dimensional special-shaped' battery for the first time New stacking process! Xiaomi MIX Fold 4 is equipped with Jinshajiang 'three-dimensional special-shaped' battery for the first time Jul 20, 2024 am 03:20 AM

According to news on July 19, Xiaomi MIX Fold 4, the first flagship folding new phone, was officially released tonight and is equipped with a "three-dimensional special-shaped battery" for the first time. According to reports, Xiaomi MIX Fold4 has achieved a major breakthrough in battery technology and designed an innovative "three-dimensional special-shaped battery" specifically for folding screens. Traditional folding screen devices mostly use conventional square batteries, which have low space utilization efficiency. In order to solve this problem, Xiaomi did not use the common winding battery cells, but developed a new lamination process to create a new form of battery, which greatly improved the space utilization. Battery Technology Innovation In order to accurately alternately stack positive and negative electrode sheets and ensure the safe embedding of lithium ions, Xiaomi has developed a new ultrasonic welding machine and lamination machine to improve welding and cutting accuracy.

Huawei will launch the Xuanji sensing system in the field of smart wearables, which can assess the user's emotional state based on heart rate Huawei will launch the Xuanji sensing system in the field of smart wearables, which can assess the user's emotional state based on heart rate Aug 29, 2024 pm 03:30 PM

Recently, Huawei announced that it will launch a new smart wearable product equipped with Xuanji sensing system in September, which is expected to be Huawei's latest smart watch. This new product will integrate advanced emotional health monitoring functions. The Xuanji Perception System provides users with a comprehensive health assessment with its six characteristics - accuracy, comprehensiveness, speed, flexibility, openness and scalability. The system uses a super-sensing module and optimizes the multi-channel optical path architecture technology, which greatly improves the monitoring accuracy of basic indicators such as heart rate, blood oxygen and respiration rate. In addition, the Xuanji Sensing System has also expanded the research on emotional states based on heart rate data. It is not limited to physiological indicators, but can also evaluate the user's emotional state and stress level. It supports the monitoring of more than 60 sports health indicators, covering cardiovascular, respiratory, neurological, endocrine,

See all articles