4. Distributed dbms architecture Chapter 4 Distributed dbms Architecture
1 4. Distributed DBMS Architecture Chapter 4 Distributed DBMS Architecture
Outline TO-Down Design of DDBMS Architecture Schema and Distribution Transparency Bottom-up Design of DDBMS Architecture Architectural Alternatives for dDBMss Three Reference architectures for a ddbms e, client/server, peer-to-peer distributed DBMs, muli-databases) Global Directory/Dictionary
2 Outline To-Down Design of DDBMS Architecture Schema and Distribution Transparency Bottom-up Design of DDBMS Architecture Architectural Alternatives for DDBMSs Three Reference Architectures for a DDBMS (i.e., client/server, peer-to-peer distributed DBMS, multi-databases) Global Directory/Dictionary
Introduction Architecture defines the structure of the system components identified functions of each component defined interrelationships and interactions between components defined
3 Introduction Architecture defines the structure of the system components identified functions of each component defined interrelationships and interactions between components defined
Reference model(参考模型) Reference Model a conceptual framework whose purpose is to divide standardization work into manageable pieces and to show at a general level how these pieces are related to one another Three approaches to define a reference model ① Component-based Components of the system are defined together with the interrelationships between components Good for design and implementation of the system
4 Reference Model(参考模型) Reference Model A conceptual framework whose purpose is to divide standardization work into manageable pieces and to show at a general level how these pieces are related to one another. Three approaches to define a reference model ① Component-based – Components of the system are defined together with the interrelationships between components – Good for design and implementation of the system
Reference Model(cont ② Function- based Classes of users are identified together with the functionality that the system will provide for each class The objectives of the system are clearly identified. But how do you achieve these objectives? ③Data- based Identify different types of data and specify the functional units that will realize and/or use data according to these views The ANSI/SPARC architecture discussed next belongs to this category
5 Reference Model (cont.) ② Function-based – Classes of users are identified together with the functionality that the system will provide for each class – The objectives of the system are clearly identified. But how do you achieve these objectives? ③ Data-based – Identify different types of data and specify the functional units that will realize and/or use data according to these views. – The ANSI/SPARC architecture discussed next belongs to this category
ANSySPARC Architecture Users External External External External Schema View View View Conceptual Conceptual Schema lew Internal Internal Schema Vi lew 6
6 ANSI/SPARC Architecture External View External View External View Conceptual View Internal View External Schema Users Conceptual Schema Internal Schema
Conceptual Schema(概念模式) RELATION EMP RELATION PAY KEY=ENO) KEY=ITITLE ATTRIBUTES=( ATTRIBUTES=[ ENo: CHARACER(9 TITLE CHARACER(10) ENAME: CHARACER(15) SAL: NUMERIC (6) TITLE CHARACER(10) RELATION ASG RELATION PROJECT[ KEY=ENO, PNO] KEY=PNO) ATTRIBUTES=[ ATTRIBUTES=( ENo: CHARACER(9 PNo CHARACER(7) PNo CHARACER(7) PNAME CHARACER(20) RESP: CHARACER(10) BUDGET: NEMERIC(7) DUR NUMERIC(6) 7
7 Conceptual Schema (概念模式) RELATION EMP [ KEY = {ENO} ATTRIBUTES = { ENO : CHARACER(9) ENAME : CHARACER(15) TITLE : CHARACER(10) } ] RELATION PAY [ KEY = {TITLE} ATTRIBUTES = { TITLE : CHARACER(10) SAL : NUMERIC(6) } ] RELATION PROJECT [ KEY = {PNO} ATTRIBUTES = { PNO : CHARACER(7) PNAME : CHARACER(20) BUDGET : NEMERIC(7) } ] RELATION ASG [ KEY = {ENO,PNO} ATTRIBUTES= { ENO : CHARACER(9) PNO : CHARACER(7) RESP : CHARACER(10) DUR : NUMERIC(6) } ]
Internal schema(内部模式) RELATION EMP KEY=ENO] ATTRIBUTES=C ENo CHARACER(9) ENAME CHARACER(15) TITLE CHARACER(10) INTERNAL REL EMPL INDEXON E CALL EMINX FIEDLS=[ HEADER: BYTE( E# BYTE(9) ENAME: BYTE(15) TIT BYTE(10)
8 Internal Schema (内部模式) RELATION EMP [ KEY = {ENO} ATTRIBUTES = { ENO : CHARACER(9) ENAME : CHARACER(15) TITLE : CHARACER(10) } ] INTERNAL_REL EMPL [ INDEX ON E# CALL EMINX FIEDLS = { HEADER : BYTE(1) E# : BYTE(9) ENAME : BYTE(15) TIT : BYTE(10) } ]
External view(外部模式)- Example1 Create a budGET view from the Proj relation CREAT VIEW BUDGET (PNAME, BUD) AS SELECT PNAME BUDGET FROM PROJ
9 External View(外部模式 ) – Example 1 CREAT VIEW BUDGET(PNAME, BUD) AS SELECT PNAME, BUDGET FROM PROJ Create a BUDGET view from the PROJ relation
External view(外部模式)- Example2 Create a Payroll view from relations EMP and PAy CREAT VIEW PAYROLL(ENO, ENAME, SAL) AS SELECT EMP. ENO. EMP ENAME PAY, SAL FROM EMP PAY WHERE EMP TITLE= PAY, TITLE
10 External View(外部模式 ) – Example 2 CREAT VIEW PAYROLL(ENO, ENAME, SAL) AS SELECT EMP.ENO, EMP.ENAME, PAY.SAL FROM EMP, PAY WHERE EMP.TITLE = PAY.TITLE Create a Payroll view from relations EMP and PAY