《Englishh--第 1 章 概述(1.3.数据库系统结构)课件》由会员分享,可在线阅读,更多相关《Englishh--第 1 章 概述(1.3.数据库系统结构)课件(30页珍藏版)》请在金锄头文库上搜索。
1、DataBase and Function Analysis 数据库与功能分析,School of Computer and communication Engineering Tianjin University of Technology,董晨,dc_,Chapter 1 Introduction,1.1 Overview 1.2 Data model 1.3 Database architecture 1.4 Composition 1.5 Summary,1.3 DataBase Architecture,From DBMS view (Internal) 3-tier archite
2、cture From end user view (External) : Single user Master/slave Distributed Clientserver Browseapplication serverDB server Others,DataBase Architecture,1.3.1 DBMS schema 1.3.2 3-tire schema architecture 1.3.3 2-tire mapping and data independency,1.3.1 Schema,“type” and “value” Type (型) Specification
3、on structure and attribute of a type of data 值(Value) A concrete value of type Example Student record type: (SNO,NAME,SEX,DEPT,AGE,BirthPlace) A value of record: (900201,Li Ming,Male,Computer,22,Jiangsu),Concept of DB schema,Schema(模式) Logical structure Description of characteristics Description of
4、“type” Reflect data structure and data relationship Stable relatively Instance(实例) A concrete value Reflect DB state in a time Many instance to a schema Change with DB update,Concept of DB schema,Example:“CourseSelection” database schema include student record, course record and course selection rec
5、ord. An instance of student database in 2003 All registered student in 2003 All courses opened in school All records on course selection The 2002 DB instance is different from 2003 DB instance,DataBase Architecture,1.3.1 DBMS schema 1.3.2 3-tire schema architecture 1.3.3 2-tire mapping and data inde
6、pendency,1.3.2 3-tire schema architecture,Schema(模式) External Schema(外模式) Internal Schema(内模式),3-tire schema architecture,Fig 1.28 3-tire schema architecture,一、 Schema(模式),Schema(logical schema) Description on data logical structure and characteristics Common data view of all user data,inclusive com
7、mon requirement of all users A database has only one schema Schemas position Middle tier of database system architecture Have no relation to physical storage and hardware Have no relation to application program, developing tools and programming language,Schema(模式),Schema definition Logical structure
8、 Data relation Demands on data security and integration,二、 External Schema(外模式),External schema(外模式)(subschema or user schema) Description on local logical structure and data characteristics, which are utilized by users (programmer and end user). User-based data view, logical expression related to a
9、pplication.,External Schema,Position of external schema Between schema and application Relation of schema and external schema:1:m External schema is often subset of schema A database can have many external schema To the same data of a schema, its structure, type, size, security level can be differen
10、t Relation between external schema and application:1:m An external schema can be used by multiple application An application uses only one external schema,External Schema,Usage Guarantee databases security A user can only access the data according to external schema,三、 Internal Schema(内模式),Internal
11、schema(storage schema) Description on physical structure and storage methods Internal expression method of database Storage method sequential storage, B-tree, hash, etc. Index methods If compressed If encrypted Regulation about storage record structure One database has only one internal schema,Inter
12、nal Schema,Example: if student records are stored based on heap structure, the inserted new record is always placed at the end.,Internal Schema,Store by ascending order, as figure 1.29(b) Store by student age,if S3 is 16 years old, as 1.29(c),Fig 1.29 Different storage methods,DataBase Architecture,
13、1.3.1 DBMS schema 1.3.2 3-tire schema architecture 1.3.3 2-tire mapping and data independency,1.3.3 Two-level mapping and three abstractive level,Three abstractive level Three schema levels 2-tire mapping External schemaschema Schemainternal schema 2-tire mapping help to apply the connection of the
14、three abstractive levels,3-tire schema structure,一、External schemaschema mapping,Schema:global logical structure External schema:local logical structure A schema can have many external schema To each external schema, database has a map which defines the mapping relation between external schema and s
15、chema. Mapping definition is often included in the description of external schema,External schemaschema mapping,Keep logical independency of data When schema changed, DBA modify schema/external schema mapping to make external schema unchanged. Application depends on external schema, and application
16、program neednt be changed. Logical independency: the independency between data and program.,二、Schemainternal schema mapping,It define the relation between data global logical structure and storage structure. Schemainternal schema mapping is unique. It is often defined in schema description.,Schemainternal schema mapping,Physical independency When storage structure changed, DBA modify schema/internal schema mapping to make schema unchanged. Application depends on external schema, then application