The Architecture of Database Systems: An Introduction to Three-Level Schema and Two-Level Image



The architecture of the database system: three-level schema and two-level image

For the three-level schema and two-level image of the database, we may not be unfamiliar. The three-level schema refers to the outer schema, the schema and the inner schema. The two-level image refers to the outer mode/mode image and the mode/inner mode image.

Next, we introduce the three-level mode:

External mode:

Definition: External mode, also known as user mode, is a description of the logical structure and characteristics of local data that database users (including applications and end users) can see and use. A data view is a logical representation of data related to an application.

Understanding :

1. A database can have multiple external schemas

. 2. External schemas are user views

. 3. External schemas are a powerful measure to ensure data security.

Schema :

Definition: Schema, also known as conceptual schema and logical schema, corresponds to the conceptual level. It is a global logical structure constructed by the database designer by synthesizing the data of all users and constructed according to a unified viewpoint. It is the overall logical structure and characteristics of all data in the database. Description is the public data view (global view) of all users, which is described, defined, embodied and reflected by the data schema description language (DDL) provided by the database management system, reflecting the overall view of the database system.

Understand:

1. A database has only one schema

2. It is a logical view of database data

3. The database schema is based on a certain data model

4. When defining a schema, it is not only necessary to define the logical structure of the data (such as data records by Data item composition, data item name, type, value range, etc.), and to define data-related security, integrity requirements, and define the connection between these data.

Inner mode:

Definition: Internal mode, also known as storage mode, is a description of the physical structure and storage mode of data, and is the representation of data within the database (for example, whether the storage mode of records is stored sequentially, stored in a B-tree structure or stored in hash mode) , how the index is organized, whether the data is compressed and stored, whether it is encrypted, and what is the structure of the data storage record)

Understand:

1. A database has only one internal schema

2. A table may be composed of multiple files, such as data files, indexes File

It is a method for the database management system (DBMS) to effectively organize and manage the data in the database.

Its purposes are:

1. In order to reduce data redundancy and realize data sharing

2. In order to improve access efficiency and performance

Database image: external Mode/mode mapping mode/internal mode mapping

External mode/mode mapping:

defined in the external mode description

Linking the local logical structure with the mode describing the global logical structure

Guaranteed logical independence

When the mode changes, as long as the external mode/ If the schema image is changed accordingly to keep the external schema unchanged, the application program based on the external schema will not be affected, thus ensuring the logical independence between the data and the program, that is, the logical independence of the data.

Schema/internal schema mapping:

Defined in schema

description Links the schema describing the global logical structure with the internal schema describing the physical structure

Guarantees physical independence

When the internal schema changes, such as storage devices or storage methods, as long as the schema/ Make corresponding changes to the internal mode image, so that the mode remains unchanged, and the application remains unchanged.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326390182&siteId=291194637