Home php教程 php手册 基于mysql的bbs设计一

基于mysql的bbs设计一

Jun 13, 2016 am 10:25 AM
bbs mysql one use based on storage Thought data Architecture Modular of system design use

1。系统架构:
采用模块化思想,分为3层:
a。数据存储层:使用mysql来存放bbs的所有数据,包括用户信息,
文章数据,用户信件,用户消息,系统数据(?),关键问题:
数据库的规划,是否用文件来辅助。
b。系统功能层:完成bbs的基本功能,由多个并列模块组成,向下
调用mysql的函数访问数据库,向上,接受处理请求,将处理的
结果返回上层,根据请求类型,返回成败结果和其他数据。而且
模块高度灵活,可以方便的修改增加。包括:
** 用户模块,处理用户的注册,基本数据的修改,权限的变化,
网友信息的查询。
** 版面模块,完成文章发表,文章的读取,文章的删除,文章
的加标记,读改删权限检查,此模块对数据库的要求最高。
** 精华区模块,包括精华区的文章,目录的增加,删除,上下移 动
(?)读改删权限检查,目录结构是其中的难点。
** 信件模块,包括发新信件,读删信件,信笺标记,新信件的通

** 消息模块,包括发送消息,接受消息,新消息通知,消息回顾,
消息存信件。
** 系统动态模块,包括当前上站人数,当前动态,由于变动频繁,
此类数据用共享内存实现可能更好。
** 聊天模块,双人聊天是否能借鉴icq的做法,由双方直接通话,
但聊天结果存信件可能较麻烦,同时,为兼容telnet功能,当
上层服务层为telnet时,增加专门的模块来进行处理。
** 聊天室模块,利用共享内存还是数据库?开房间,里面的权限
问题。
根据需要,还能增加新的功能。例如:活动看板模块,但对于非
telnet终端,意义好象不大。。。。。
c。服务层:直接和客户机对话,根据客户机的请求,调用功能模块取得
数据,然后将数据发送回客户端,根据客户端的类型,分别开发不同
的服务模块,并且尽可能合理进行抽象,使对不同的服务层,能共用
系统功能层的模块。具体包括:


++ cq66服务端,采取原cq66的方式,并重新规划协议,支持系统功能
层的所有功能,但要用专门的客户端程序(cq66),如果能做到向
下兼容则更好,客户端程序要随服务端的升级而升级,用户可能有
点不便。有需要可以在传输过程中加入加密功能,类似ssh。
++ telnet服务端,采用旧bbs的方式,有些功能不支持,客户端无须
升级,服务器端要保存客户方的状态,并根据客户端的按键来判断
状态的转移,并由此得出所需的数据,(例如阅读某篇文章),然
后再向系统功能层请求数据,然后将数据加以处理(例如加上顶行,
尾行)然后返回数据,可以在现有的bbsd上修改,可以省去io模块
的设计但难度较大,除文章方面好一点外,其他比较难改,但从头
写起太费力。
++ httpd服务端,所需的功能更少,相对较简单,本来直接调用mysql
数据库也行,直接可以用php,但考虑到分层的原则,建议仍用c编
cgi的方式实现不知能不能在原来的基础上修改呢?估计不行。
系统的关键和难点:
a。数据库的设计,mysql支持大量的table吗?例如几万?每个
用户至少一个表,然后每个版一个表,精华区的表结构可能更复杂。
但应该总会比现在bbs的文件结构清晰一些,效率也高一点吧,排序
和cache的功能可以信赖mysql吧。
b。mysql中文本字段的大小限制,限制一篇文章不得大于64k不过分吧,
而且从效率的角度,将一篇文章以最大2k的块为单位存放可能更好,
这样,当telnet用户看文章时,telnet服务器不用每次都查询数据库
读取几十k的数据,再将其中的某2k传给用户,可局部补偿数据库字段
不能象文件那样从中间读取一部分。不过这样文章字段数据的管理
比较复杂。
2。系统开发计划:
先考虑用户模块和版面模块,规划好数据结构,应该很容易和现有bbsd结合
起来的。然后再考虑其他模块?。。。。。。。
(//以下有空再写。。。。。先睡觉去。。hmm.........)
3。数据库设计
4。用户模块设计
5。版面模块设计
6。bbsd和cq66服务器端改造
7。初步测试计划 。
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

Video Face Swap

Video Face Swap

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

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)

Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

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.

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

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.

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

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

Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

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.

Solve database connection problem: a practical case of using minii/db library Solve database connection problem: a practical case of using minii/db library Apr 18, 2025 am 07:09 AM

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.

How to install mysql in centos7 How to install mysql in centos7 Apr 14, 2025 pm 08:30 PM

The key to installing MySQL elegantly is to add the official MySQL repository. The specific steps are as follows: Download the MySQL official GPG key to prevent phishing attacks. Add MySQL repository file: rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm Update yum repository cache: yum update installation MySQL: yum install mysql-server startup MySQL service: systemctl start mysqld set up booting

Laravel framework installation method Laravel framework installation method Apr 18, 2025 pm 12:54 PM

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.

MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

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.

See all articles