Home Database Mysql Tutorial 数据库系统的结构

数据库系统的结构

Jun 07, 2016 pm 05:43 PM
database system structure

我学数据库(7)--数据库系统的结构 在软件行业,软件是讲究结构的,数据库管理系统毕竟是一个软件,所以也讲结构。考察数据库系统的结构可以从多种不同的角度或不同的层次。 从系统本身来讲,数据库系统通常采用三级模式结构,也就是系统内部的结构。如果从数

我学数据库(7)--数据库系统的结构

  在软件行业,软件是讲究结构的,数据库管理系统毕竟是一个软件,所以也讲结构。考察数据库系统的结构可以从多种不同的角度或不同的层次。

  从系统本身来讲,数据库系统通常采用三级模式结构,也就是系统内部的结构。如果从数据库最终用户角度来看,其结构又分单用户结构、主从式结构、分布式结构、C/S结构、B/S结构以及浏览器/应用服务器/数据库服务器结构等,即数据系统外部体系结构。

  按照先后,逐个对三级模式以及各种外部体系结构进行详细了解。在学习三级模式之前,先了解一下数据库系统的模式的概念。

  数据模型中有“型”和“值”的概念。型是指对某一类数据的结构和属性的说明,值是型的一个具体赋值。在前面的随笔当中也有提及,比如实体型和实体,以及实体集的概念。模式是数据库中全体数据的逻辑结构和特征的描述,也就是型的描述。模式的一个具体值成为模式的一个实例。一个模式可以有多个实例,比如学生信息数据库,假设A和B学校使用同一模式的数据库,A学校的信息库和B学校信息库肯定是不同的,因为学生信息是不一样的。模式是相对稳定的,实例是变动的,因为数据是不断的在更新。模式是数据的结构和联系,而实例反映的是数据库某一时刻的状态。基于不同数据模型的数据库管理系统种类很多,在不同操作系统之上,数据的存储结构也不同,但在体系结构上通常具有相同的特征,即采用三级模式结构并提供两级映像功能。

  数据库的三级模式结构是指数据库系统由外模式、模式和内模式三级构成,下图是数据库系统的三级模式结构:

 

         外模式也称子模式或用户模式,它是应用程序员和最终用户能够看见和使用的局部数据的逻辑结构和特征的描述,是数据库用户的数据视图,由图中也可以看出,外模式是与某一应用有关的数据的逻辑表示,而且一个数据库可以有好多个子模式,当然也可以看出,同一外模式可以有多个应用模式与之对应。由此可以得出,为了满足其他的需求可以在同一外模式上再添加其它的应用。但就不同应用来说,即使是使用的同一数据,在结构、类型以及安全级别等都可以不同。从上图中也可以看出,香港服务器,应用当中的任何一个都没有使用两个或以上外模式的。还有一个很有用的信息就是一个应用只能从对应外模式中取得数据而不能从其它的外模式中取数据,这就为保证数据库的安全提供了一个很有利的保护措施。

         模式也称逻辑模式,是数据的逻辑结构和特征的描述,是所有用户的公共数据视图。它是数据库系统模式结构的中间层次,不与数据的物理细节和硬件环境有关,也不与具体的应用程序以及高级程序设计语言有关。一个数据库只有一个模式,它将以一种数据模型为基础,统一考虑所有用户的需求,并将两者有机结合成一个逻辑整体。定义模式的时候需要定义数据的逻辑结构,而且还要定义数据之间的联系以及与安全性和完整性有关的要求。

         内模式也称存储模式,一个数据库只有有一个内模式,用来描述物理结构和存储方式,是数据在内部的表示方式。比如用堆存储记录或者CLUSTER存储,索引是B+树索引还是hash索引。

  这三级模式是对数据的三级抽象,可以让用户逻辑地抽象处理数据而不必关心数据的具体表示方式和存储方式。为了能够实现这三个层次的联系和转换,数据库管理系统提供了两层映像:外模式/模式映像和模式/内模式映像。

  在前面的随笔中提到过数据库系统对比手工管理数据以及文件系统的有点,其中一条便是数据独立性高,而正是两层映像功能保证了较高的数据独立性,数据独立性又分逻辑独立性和物理独立性。

  外模式/模式映像,前面写到模式是数据的全局逻辑结构,而外模式是数据的局部逻辑结构,一个模式可以有多个外模式。当模式改变时,如增加新的关系、属性等,之后由数据库管理员对各个外模式/模式映像进行调整,而不必去调整外模式。应用程序是根据外模式编写,这样应用程序无需更改,这就保证了数据与程序的逻辑独立性,即数据的逻辑独立性。

  数据库只有一个模式,也只有一个内模式,所以也就只有一个模式/内模式映像,它定义了全局逻辑结构与存储结构之间的对应关系。单数据的存储结构改变以后,数据库管理员可对模式/内模式映像做相应改变,模式不用改变,所以呢应用程序也不用改变。这就保证了数据的物理独立性。

  数据库系统一般由数据库、数据库管理系统及其开发工具、应用系统和数据库管理员构成。由于数据库系统数据量很大,加之DBMS功能很强大,所以数据库系统的硬件资源选择要求较高,比如要求有足够大的内存和磁盘空间等。数据库系统软件的主要有DBMS、操作系统、高级语言及其编译系统、以DBMS为中心的应用开发工具级为特定应用环境开发的数据库应用系统等。人员主要有数据库管理员、系统分析员和数据库设计人员、应用程序员和用户。(数据库管理员DBA,之后我会转发两篇关于DBA就业的文章,这两篇文章是我无聊的时候看到的,觉得不错,在这篇随笔之后分享给大家。)

  之后再来对对各种数据库系统外部体系结构做简要的了解。

  单用户结构:整个数据库系统(应用程序、DBMS、数据)装在一台计算机上,为一个用户独占,不同机器之间不能共享数据。

  主从式结构:一个主机带多个终端的多用户结构,数据库系统存放在主机上,香港空间,所有处理任务都由主机来完成,各个用户通过主机的终端并发地存取数据库,共享数据资源。

  分布式结构:数据库中的数据在逻辑上是一个整体,但物理地分布在计算机网络的不同结点上,网络中的每个结点都可以独立处理本地数据库中的数据,执行局部应用同时也可以同时存取和处理多个异地数据库中的数据,执行全局应用。

  C/S结构:把DBMS功能和应用分开,网络中某个(些)结点上的计算机专门用于执行DBMS功能,称为数据库服务器,简称服务器;其他结点上的计算机安装DBMS的外围应用开发工具,用户的应用系统,称为客户机。一种是集中的服务器结构,一台数据库服务器,多台客户机;一种是分布的服务器结构在网络中有多台数据库服务器,分布的服务器结构是客户/服务器与分布式数据库的结合。

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
1 months 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

How does Go language implement the addition, deletion, modification and query operations of the database? How does Go language implement the addition, deletion, modification and query operations of the database? Mar 27, 2024 pm 09:39 PM

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

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 does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

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,

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

See all articles