290 likes | 442 Views
ICS 214B: Transaction Processing and Distributed Data Management. Lecture 16: Heterogeneous Distributed Databases Professor Chen Li. Heterogeneous DB systems Federated DB systems Multi-DB systems. DB. DB. DB. Integration. Multi-database systems. Heterogeneity caused by autonomy
E N D
ICS 214B: Transaction Processing and Distributed Data Management Lecture 16: Heterogeneous Distributed Databases Professor Chen Li
Heterogeneous DB systems • Federated DB systems • Multi-DB systems DB DB DB Integration Notes 16
Multi-database systems • Heterogeneity caused by autonomy • Different departments, companies, schools… • Sources of heterogeneity • Data model • Query language • Schema • Transaction Processing • Autonomous execution Notes 16
D1 D2 Dn Sn S1 S2 GS MDBMS (Mediator) GUI U1 U2 Un DBMS1 DBMS2 DBMSn ... Notes 16
Interoperability • Schema integration • Query Processing • Transaction Processing Notes 16
Global schema S1 S2 ... Sn T1 T2 Tn InS1 InS2 InSn Integrator GS Notes 16
Example: S1: relational E (ENO, ENAME, TITLE) D (DNO, DNAME) W (ENO, DNO) S (TITLE, SALARY) Hypergraph representation S Salary E ENO, ENAME, TITLE W DNO, Dname D Notes 16
S2: Object Oriented DEPT EMPLOYS ENGR DEPT-NAME BUDGET MGR E# NAME ADDRESS TITLE SALARY Notes 16
ER model for S1: N M ENO ENAME DNO E W D TITLE SALARY DNAME Notes 16
Or maybe? ENO ENAME DNO E W D pay DNAME TITLE S SALARY Notes 16
ER model for S2 E# NAME DEPT-NAME N 1 ENGR Y DEPT ADDR TITLE BUDGET MGR SALARY Notes 16
DEPT INTEGRATION: DNO DEPT-NAME D D BUDGET MGR DNAME S2 S1 Notes 16
DNO DEPT-NAME D D BUDGET MGR DNAME DNO DEPT-NAME D NICKNAME BUDGET MGR Notes 16
EMPLOYEE INTEGRATION: ENO ENAME E# NAME E ENGR ADDR TITLE SALARY TITLE SALARY Notes 16
ENO ENAME E# NAME E ENGR ADDR TITLE SALARY TITLE SALARY ENO ENAME subset E ENGR ADDR SALARY TITLE Notes 16
One issue: matching attributes Another issue: matching values Example: Salary at A is weekly in dollars Salary at B is monthly in pounds Salary at C is Rate hours-worked Notes 16
Works-in relationship: N M N 1 E D E D W W Notes 16
One option: N M E D W Notes 16
N M works in Another option: E D N 1 pays Notes 16
Query processing Query Subquery 1 … Subquery n Notes 16
Example DEPT-NAME DNO Site 1 DNO NICKNAME(DNAME) Site 2 DEPT_NAME BUDGET MGR Site 3: DNO DEPT_NAME D NICKNAME MGR BUDGET Notes 16
Find nickname & budget for DNO=55 Site 1: find nickname for DNO=55 Site 3: find dept_name for DNO=55 Site 2: find budget for dept_name= Notes 16
Example ENO ENAME • Find ENO, SALARY for TITLE = E ENGR ADDR SALARY TITLE Notes 16
Site 1: find E(ENO, SALARY) for TITLE = Site 2: find ENGR(E#, SALARY) for TITLE = Assume the salaries are consistent Notes 16
Updates Update GS u1 u2 un ... Notes 16
May be hard Example: ENAME in S1 is 10 bytes ENAME in S2 is 20 bytes ENAME in GS is 20 bytes Insert ENAME = “Smith” Notes 16
Typically Updates done using local schemas Notes 16
Query Optimization At each site: • Different statistics • Different algorithms for Q.P. • Different exported functionality Notes 16
VERY HARD • In heterogeneous DBMS: • Integration • Query Processing/Optimization is an art… Notes 16