Database-Database system architecture

Source: Internet
Author: User

Database system Architecture

From the point of view of database management system, the database system usually adopts three-level pattern structure, which is the system structure inside the database system.

From the point of view of the database end user (the architecture outside the database system), the structure of the database system is divided into:
Single-User structure
Distributed architecture
Client/server
Browser/Application Server/database server multilayer structure, etc.

The concept of database system pattern

Concepts of "type" and "value"
Type (type)
Description of the structure and properties of a class of data
VALUES (value)
is a specific assignment of a type
For example
Student Record Type:
(School number, name, gender, department, age, birthplace)
A record value:
(900201, Li Ming, Male, computer, 22, Jiangsu)
Schema (Schema)
Description of database logical structure and characteristics
A description of the type
Reflects the structure of the data and its linkages
The pattern is relatively stable
Example (Instance)
A specific value of the pattern
reflect the state of a database at a time
There can be many instances of the same pattern
The instance changes as the data in the database is updated

Mode

Mode (also called logical mode)
A description of the logical structure and characteristics of all data in a database
Common Data View for all users, combining the needs of all users
There is only one schema for a database
The status of the pattern: the middle tier of the database system schema structure
Independent of the physical storage details and hardware environment of the data
Independent of specific applications, development tools, and advanced programming languages
Definition of a pattern
Logical structure of the data (name, type, value range, etc.) of the data item
The link between data
Data-related security, integrity requirements

Pattern instances

Teaching Database Schema (second previous instance)
Teacher (teacher number, name, title)
Primary key: Teacher number
Course (course number, course name, teacher number, textbook)
Primary key: Course extra key: Teacher number
Student (school number, name, gender, teacher number)
Primary key: Learn extra key: Teacher number
Elective Course (School number, course number, score)
Primary key: (school number, course number)
Foreign key 1: School number, foreign key 2: Course number

[example) Create Student student table create  table  Student (Sno char  (9 ) primary  key , Sname char  (20 ") not  null , Ssex Span class= "Hljs-keyword" >char  (2 ), Sage number , sdept char  (20 )) Tablespace USERS;   
[例]  创建课程Course表              CREATE TABLE Course                (Cno  CHAR(4)  PRIMARY KEY,                 Cname  CHAR(40) NOT NULL,                      Cpno  CHAR(4) ,                 Ccredit  NUMBER,                 FOREIGN KEY Cpno REFERENCES Course(              Cno))                 TABLESPACE USERS;
[Example] Create elective course SC table CREATE TABLE SC (Sno CHAR(9)  not NULL, Cno CHAR(4)  not NULL, Grade Grade, 
     
      primary 
      key (SNO,CNO), 
      FOREIGN 
      key (Sno) 
      REFERENCES St Udent (Sno), 
      FOREIGN 
      KEY (Cno) 
      REFERENCES Course (Cno)) TAB Lespace USERS;
     
External mode

External mode (also known as sub-mode or user mode)
A description of the logical structure and characteristics of local data used by database users, including application and end users
A data view of a database user, which is a logical representation of the data associated with an application
The position of the outer mode: between the pattern and the application
The relationship between mode and external mode: one-to-many
Outer mode is usually a subset of patterns
A database can have multiple external schemas. Reflects the different user's application needs, the way of looking at the data, the requirements of the data confidentiality
The structure, type, length, level of secrecy in the external mode can be different for the same data in the pattern
The relationship between external models and applications: one-to-many
The same out-of-the-way mode can also be used by multiple application systems for a single user
But an application can only use one external mode
Use of external mode
A powerful measure to ensure database security
Each user can only see and access the data in the corresponding out-of-mode

建立计算机系学生的视图 CS_Student              CREATE VIEW CS_Student    AS     SELECT  *    FROM   Student    WHERE  Sdept=‘CS‘;
Internal mode

Internal mode (also known as storage mode)
Is the description of the data physical structure and storage method
Is how the data is represented inside the database
How the records are stored (stored sequentially, stored in accordance with the B-tree structure,
Stored by hash method)
How indexes are organized
Whether the data is compressed storage
Data is encrypted
Rules for the structure of data storage records
A database has only one internal mode

Mode/Internal mode image

The pattern/Internal pattern image defines the correspondence between the global logical structure of the data and the storage structure.
The schema/inner mode image in the database is unique.
The image definition is usually included in the schema description.
Ensure the physical independence of the data
When the storage structure of the database changes (for example, a different storage structure is selected), the database administrator modifies the mode/inner mode image so that the pattern remains unchanged
The application is not affected. The physical independence of data and program is ensured, and the physical independence of data is referred to.
Database schema
That is, the global logical structure is the center and key of the database
Separate from other levels of the database
When designing a database schema structure, you should first determine the logical schema of the database
Internal mode of the database
The global logical structure that relies on it
Database-independent user view, out-of-the-box mode
Separate from the specific storage device
The data structures defined in the global logical structure and their linkages are organized according to a certain physical storage strategy to achieve better time and space efficiency.

Out-of-database mode
For specific applications
Defined above the logical pattern
Independent of storage mode and storage device
When the application requirements change greatly, the corresponding external mode can not meet its view requirements, the external model has to make corresponding changes
A specific application
The data structures described in the external schema are compiled
dependent on a specific external pattern
Independent of the schema and storage structure of the database
Different applications can sometimes share the same external mode
Two-level image of the database
Guaranteed stability of the out-of-database model
The stability of the application is guaranteed from the bottom level, and the application generally does not need to be modified unless the application requirements themselves change

The independence between the data and the program, so that the definition and description of the data can be separated from the application

Data access is managed by the DBMS
Users do not have to consider details such as access paths
Simplifies application development
Significantly reduces application maintenance and modification

Database Administrator (DBA)

Specific Responsibilities:
1. Determining the content and structure of information in the database
2. Determine the storage structure and access policy of the database
3. Define security requirements and integrity constraints for your data
4. Monitoring the use and operation of the database
Periodic dump Database
Data files
Log file
System failure Recovery
Media failure Recovery
Monitoring Audit files
5. Improvement and reorganization of the database
Performance Monitoring and tuning
Regularly re-organizes databases to improve system performance
When demand increases and changes, the database needs to be re-structured

Database-Database system architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.