BBS design based on mysql (1)_PHP tutorial
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.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.
