2 Introduction Chapter 1 Introduction 1 Outline v

  • Slides: 59
Download presentation
2. Introduction Chapter 1 Introduction 1

2. Introduction Chapter 1 Introduction 1

Outline v v What is a distributed database system? Promises of DDBSs Complicating Factors

Outline v v What is a distributed database system? Promises of DDBSs Complicating Factors Problem Areas 2

From File System to DBMS Program 1 Deposit/ Withdraw Program 2 Transfer Program 3

From File System to DBMS Program 1 Deposit/ Withdraw Program 2 Transfer Program 3 Print stmt File 1: current accounts File 2: saving accounts File 3: customers Program 2 Transfer Program 3 D B M S • Description • Store • Manipulation • Control Bank Database Print stmt Program 4 Customer Information 3

Example v Multinational manufacturing company: w head quarters in New York w manufacturing plants

Example v Multinational manufacturing company: w head quarters in New York w manufacturing plants in Chicago and Montreal w warehouses in Phoenix and Edmonton w R&D facilities in San Francisco v Data and Information: w employee records (working location) w projects (R&D) w engineering data (manufacturing plants, R&D) w inventory (manufacturing, warehouse) 4

Features v Data are distributed over sites (e. g. employee, inventory). v Queries (e.

Features v Data are distributed over sites (e. g. employee, inventory). v Queries (e. g. “get employees who are younger than 45”) involve more than one site. 5

Distributed Database System Technology Database Technology Computer Networks integration distributed computing Distributed Database System

Distributed Database System Technology Database Technology Computer Networks integration distributed computing Distributed Database System v The key is integration, not centralization v Distributed database technology attempts to achieve integration 6 without centralization.

DDBS = Database + Network v Distributed database system technology is the union of

DDBS = Database + Network v Distributed database system technology is the union of what appear to be diametrically opposed approaches to data processing w DDBS = database + network w Database integrates operational data of an enterprise to provide a centralized and controlled access to that data. w Computer network promotes a work mode that goes against all centralization efforts and facilitates distributed computing. 7

Distributed Computing v A distributed computing system consists of w a number of autonomous

Distributed Computing v A distributed computing system consists of w a number of autonomous processing elements (not necessarily homogeneous), which – are interconnected by a computer network; – cooperate in performing their assigned tasks. v What is distributed? w w Processing Logic Function Data Control All these are necessary and important for distributed database technology. 8

What is a Distributed Database System? v A distributed database (DDB) is a collection

What is a Distributed Database System? v A distributed database (DDB) is a collection of multiple, logically interrelated databases, distributed over a computer network w i. e. , storing data on multiple computers (nodes) over the network v A distributed database management system (DDBMS) is the software that w manages the DDB; w provides an access mechanism that makes this distribution transparent to the users. v Distributed database system (DDBS): w DDBS = DDB + DDBMS 9

What is not a DDBS? v A timesharing computing system v A loosely or

What is not a DDBS? v A timesharing computing system v A loosely or tightly coupled multiprocessor system v A database system which resides at one of the nodes of a network of computers w This is a centralized database on a network node 10

Centralized DBMS on a Network Site 4 Site 2 Site 1 Communication Network Site

Centralized DBMS on a Network Site 4 Site 2 Site 1 Communication Network Site 3 Site 5 Site 6 v Data resides only at one node. v Database management is the same as in a centralized DBMS. v Remote processing, single-server multiple-clients 11

Distributed DBMS Environment Site 4 Site 2 Site 1 Communication Network Site 3 Site

Distributed DBMS Environment Site 4 Site 2 Site 1 Communication Network Site 3 Site 5 Site 6 12

Applications of DDBMS v Manufacturing – especially multi-plant manufacturing v Military command control v

Applications of DDBMS v Manufacturing – especially multi-plant manufacturing v Military command control v Airlines v Hotel chains v Any organization which has a decentralized organization structure 13

Reasons for Data Distribution v Several factors leading to the development of DDBS w

Reasons for Data Distribution v Several factors leading to the development of DDBS w Distributed nature of some database applications w Increased reliability and availability w Allowing data sharing while maintaining some measure of local control w Improved performance 14

Implicit Assumptions v Data stored at a number of sites. w Each site has

Implicit Assumptions v Data stored at a number of sites. w Each site has processing power v Processors at different sites are interconnected by a computer network v Distributed database is a database, not a collection of files w Data logically related as exhibited in the users’ access patterns (e. g. , relational data model) v DDBMS is a fully-fledged DBMS w Not remote file systems 15

Design Issues of Distributed Systems v v v Must be transparent Provide flexibility Be

Design Issues of Distributed Systems v v v Must be transparent Provide flexibility Be reliable w Design should not require the simultaneous functioning of a substantial number of critical components w More redundancy, greater availability, and greater inconsistency w Fault tolerance, the ability to mask failures from the user v Good performance w Important (the rest are useless without this) w Balance number of messages and grain size of distributed computations v Scalable w A maximum for developing distributed systems w Avoid centralized components, tables, and algorithms w Only decentralized algorithms should be used 16

Characteristics of Decentralized Algorithms v No machine has complete information about the state of

Characteristics of Decentralized Algorithms v No machine has complete information about the state of the system. v Machines make decisions based only on locally available information. v Failure of one machine does not ruin the algorithm. v There is no implicit assumption of the existence of a global clock. 17

Promises of DDBSs v Transparent management of distributed, fragmented, and replicated data v Improved

Promises of DDBSs v Transparent management of distributed, fragmented, and replicated data v Improved reliability and availability through distributed transactions v Improved performance v Easier and more economical system expansion 18

Transparency v Transparency refers to separation of the high-level semantics of a system from

Transparency v Transparency refers to separation of the high-level semantics of a system from low-level implementation details. v Fundamental issue is to provide data independence in the distributed environment w Network (distribution) transparency w Replication transparency w Fragmentation transparency – Horizontal fragmentation: selection – Vertical fragmentation: projection – hybrid 19

Distributed Database – User View Distributed Database 20

Distributed Database – User View Distributed Database 20

Distributed DBMS – Reality DBMS Software User Query User Application Communication Subsystem DBMS Software

Distributed DBMS – Reality DBMS Software User Query User Application Communication Subsystem DBMS Software User Application User Query 21

ASG Example Relations EMP ENO PNO RESP DUR E 1 P 1 Manager 12

ASG Example Relations EMP ENO PNO RESP DUR E 1 P 1 Manager 12 E 2 P 1 Analyst 24 E 2 P 2 Analyst 6 E 3 P 3 Consultant 10 ENO ENAME TITLE E 1 J. Doe Elect. Eng. E 3 P 4 Programmer 48 E 2 M. Smith Syst. Anal. E 4 P 2 Manager 18 E 3 A. Lee Mech. Eng. E 5 P 2 Manager 24 E 4 J. Miller Programmer E 6 P 4 Engineer 48 E 5 B. Casey Syst. Anal. E 7 P 3 Engineer 36 E 6 L. Chu Elect. Eng. E 7 P 5 Engineer 23 E 7 R. Davis Mech. Eng. E 8 P 3 Manager 40 E 8 J. Jones Syst. Anal. PROJ PAY PNO PNAME BUDGET TITLE SAL P 1 Instrumentation 150000 Elect. Eng. 40000 P 2 Database Develop 135000 Syst. Anal. 34000 P 3 CAD/CAM 250000 Mech. Eng. 27000 P 4 Maintenance 310000 Programmer 24000 22

Transparent Access Tokyo Boston 0 Boston projects Boston employees Boston assignments Paris Communication Network

Transparent Access Tokyo Boston 0 Boston projects Boston employees Boston assignments Paris Communication Network Paris projects Paris employees Paris assignments Boston employees Montreal New. York Boston projects New York employees New York projects New York assignments Find the names and salaries of employees who are assigned to projects for over 12 weeks. Montreal projects Paris projects New York projects with budget > 200000 SELECT ENAME, SAL Montreal employees FROM EMP, ASG, PAY Montreal assignments WHERE DUR > 12 AND EMP. ENO = ASG. ENO 23 AND PAY. TITLE = EMP. TITLE

Improved Performance v Parallelism in execution w inter-query parallelism w intra-query parallelism v Since

Improved Performance v Parallelism in execution w inter-query parallelism w intra-query parallelism v Since each site handles only a portion of a database, the contention for CPU and I/O resources is not that severe. v Data localization reduces communication overheads. w Proximity of data to its points of use requires some support from fragmentation and replication 24

Parallelism Requirements v Have as much of the data required by each application at

Parallelism Requirements v Have as much of the data required by each application at the site where the application executes w Full replication v How about updates? w Updates to replicated data requires implementation of distributed concurrency control and commit protocol 25

Improved Reliability v Distributed DBMS can use replicated components to eliminate single point failure.

Improved Reliability v Distributed DBMS can use replicated components to eliminate single point failure. v Users can still access part of the distributed database with “proper care” even though some of the data is unreachable. v Distributed transactions facilitate maintenance of consistent database state even when failures occur. 26

Easier System Expansion v Ability to add new sites, data, and users over time

Easier System Expansion v Ability to add new sites, data, and users over time without major restructuring. v Huge centralized database systems (mainframes) are history (almost!). v Cloud computing will lead to natural distributed processing. v Some applications (such as, supply chain, large enterprise) are naturally distributed - centralized systems will just not work. 27

Disadvantages of DDBSs v Complexity w DDBS problems are inherently more complex than centralized

Disadvantages of DDBSs v Complexity w DDBS problems are inherently more complex than centralized DBMS ones v Cost w More hardware, software, and people costs v Distribution of control w Problems of synchronization and coordination to maintain data consistency v Security w Database security + network security v Difficult to convert w No tools to convert centralized DBMSs to DDBSs 28

Complicating Factors v Data may be replicated in a distributed environment, consequently the DDBS

Complicating Factors v Data may be replicated in a distributed environment, consequently the DDBS is responsible for w choosing one of the stored copies of the requested data for access in case of retrievals w making sure that the effect of an update is reflected on each and every copy of that data item v If there is site/link failure while an update is being executed, the DDBS must make sure that the effects will be reflected on the data residing at the failing or unreachable sites as soon as the system recovers from the failure. 29

Complicating Factors (cont. ) v Maintaining consistency of distributed/replicated data. v Since each site

Complicating Factors (cont. ) v Maintaining consistency of distributed/replicated data. v Since each site cannot have instantaneous information on the actions currently carried out in other sites, the synchronization of transactions at multiple sites is harder than a centralized system. 30

Distributed vs. Centralized DBS v v Distribution leads to increased complexity in the system

Distributed vs. Centralized DBS v v Distribution leads to increased complexity in the system design and implementation. DDBS must be able to provide additional functions to those of a centralized DBMS. w To access remote sites and transmit queries and data among various sites via a communication network w To keep track of the data distribution and replication in the DDBMS catalog w To devise execution strategies for queries and transactions that access data from more than one site w To decide on which copy of a replicated data item to access w To maintain the consistency of copies of a replicated data item w To maintain the global conceptual schema of the distributed database w To recover from individual site crashes and from new types of failures 31 such as failure of a communication link

Date’s 12 Rules for Distributed RDBMSs TO THE USER, A DISTRIBUTED SYSTEM SHOULD LOOK

Date’s 12 Rules for Distributed RDBMSs TO THE USER, A DISTRIBUTED SYSTEM SHOULD LOOK EXACTLY LIKE A NON-DISTRIBUTED SYSTEM. 1. Local autonomy 2. No reliance on a central site 8. Distributed transaction management 3. Continuous operation 9. Hardware independence 4. Location independence 5. Fragmentation independence 10. Operating system independence 6. Replication independence 11. Network independence 7. Distributed query processing 12. DBMS independence 32

Rule 1: Local Autonomy Sites should be autonomous to the maximum extent possible. v

Rule 1: Local Autonomy Sites should be autonomous to the maximum extent possible. v Local data is locally owned and managed, with local accountability w security consideration w integrity consideration Local operations remain purely local v All operations at a given site are controlled by that site v w no site X should depend on some other site Y for its successful functioning 33

Rule 1: Local Autonomy (cont. ) v In some situations, some slight loss of

Rule 1: Local Autonomy (cont. ) v In some situations, some slight loss of autonomy is inevitable. w fragmentation problem - Rule 5 w replication problem - Rule 6 w update of replicated relation - Rule 6 w multiple-site integrity constraint problem - Rule 7 w a problem of participation in a two-phase commit process - Rule 8 34

Rule 2: No Reliance on a Central Site There must not be any reliance

Rule 2: No Reliance on a Central Site There must not be any reliance on a central "master" site for some central service, such as centralized query processing or centralized transaction management, such that the entire system is dependent on that central site. v Reliance on a central site would be undesirable for at least the following two reasons: w that central site might be a bottleneck w the system would be vulnerable 35

Rule 2: No Reliance on a Central Site (cont. ) v In a distributed

Rule 2: No Reliance on a Central Site (cont. ) v In a distributed system, the following functions (among others) must therefore all be distributed: w Dictionary management w Query processing w Concurrency control w Recovery control 36

Rule 3: Continuous Operation There should ideally never be any need for a planned

Rule 3: Continuous Operation There should ideally never be any need for a planned entire system shutdown. v Incorporating a new site X into an existing distributed system D should not bring the entire system to a halt. v Incorporating a new site X into an existing distributed system D should not require any changes to existing user programs or terminal activities. 37

Rule 3: Continuous Operation (cont. ) v Removing an existing site X from the

Rule 3: Continuous Operation (cont. ) v Removing an existing site X from the distributed system should not cause any unnecessary interruptions in service. v Within the distributed system, it should be possible to create and destroy fragments and replicas of fragments dynamically. v It should be possible to upgrade the DBMS at any given component site to a newer release without taking the entire system down. 38

Rule 4: Location Independence (Transparency) Users should not have to know where data is

Rule 4: Location Independence (Transparency) Users should not have to know where data is physically stored, but rather should be able to behave - at least from a logical standpoint - as if the data were all stored at their own local site. Simplify user programs and terminal activities v Allow data to migrate from site to site v It is easier to provide location independence for simple retrieval operations than it is for update operations v Distributed data naming scheme and corresponding support from the dictionary subsystem v 39

Rule 4: Location Independence (Transparency) (cont. ) v User naming scheme w User U

Rule 4: Location Independence (Transparency) (cont. ) v User naming scheme w User U has to have a valid logon ID at each of multiple sites to operate w User profile for each valid logon ID in the dictionary w Granting of access privileges at each component site 40

Rule 5: Fragmentation v A distributed system supports data fragmentation if a given relation

Rule 5: Fragmentation v A distributed system supports data fragmentation if a given relation can be divided into pieces or "fragments" for physical storage purposes. v Fragmentation is desirable for performance reason. w Horizontal and/or Vertical fragmentation New York Segment Physical storage New York London Segment Physical storage London 41

Independence (Transparency) Users should be able to behave (at least from a logical standpoint)

Independence (Transparency) Users should be able to behave (at least from a logical standpoint) as if the data were in fact not fragmented at all. v A system that supports data fragmentation should also support fragmentation independence (also known as fragmentation transparency). v Fragmentation independence (like location independence) is desirable because it simplifies user programs and terminal activities. 42

Independence (Transparency) (cont. ) v Fragmentation independence implies that users should normally be presented

Independence (Transparency) (cont. ) v Fragmentation independence implies that users should normally be presented with a view of the data in which the fragments are logically combined together by means of suitable joins and unions. 43

Rule 6: Replication Independence (Transparency) v v A distributed system supports data replication if

Rule 6: Replication Independence (Transparency) v v A distributed system supports data replication if a given relation (more generally, a given fragment of a relation) can be represented at the physical level by many distinct stored copies or replicas, at many distinct sites. New. York Segment Replication is desirable for at least two reasons § § Performance Availability London Segment Replica of New York Segment Replica of London Segment 44

Rule 6: Replication Independence (Transparency) (cont. ) User should be able to behave as

Rule 6: Replication Independence (Transparency) (cont. ) User should be able to behave as if the data were in fact not replicated at all. v User should be able to behave as if the data were in fact not replicated at all. v Replication, like fragmentation, should be ``transparent to the user'‘. v Update propagation problem v Replication independence (like location and fragmentation independence) is desirable because it simplifies user programs and terminal activities. 45

Rule 7: Distributed Query Processing It is crucially important for distributed database systems to

Rule 7: Distributed Query Processing It is crucially important for distributed database systems to choose a good strategy for distributed query processing. v Query processing in a distributed system involves w local CPU and I/O activities at several distinct sites w some amount of data communication among those sites w energy, cost, … v Amount of data communication is a major performance factor. v Query compilation ahead of time 46

Rule 8: Distributed Transaction Management Two major aspects of transaction management, recovery control and

Rule 8: Distributed Transaction Management Two major aspects of transaction management, recovery control and concurrency control, require extended treatment in a distributed environment. v In a distributed system, a single transaction can involve the execution of code at multiple sites and can thus involve updates at multiple sites. v Each transaction is therefore said to consist of multiple "agents, " where an agent is the process performed on behalf of a given transaction at a given site. v Deadlock problem may be incurred. 47

Rule 9: Hardware Independence (Transparency) User should be presented with a “single-system image'' regardless

Rule 9: Hardware Independence (Transparency) User should be presented with a “single-system image'' regardless of any particular hardware platform. v It is desirable to be able to run the same DBMS on different hardware systems. v It is desirable to have those different hardware systems all participate as equal partners (where appropriate) in a distributed system. v It is assumed that the same DBMS is running on all those different hardware systems. 48

Rule 10: Operating System Independence It is obviously desirable, not only to be able

Rule 10: Operating System Independence It is obviously desirable, not only to be able to run the same DBMS on different hardware systems, but also to be able to run it on different operating systems - even different operating systems on the same hardware. v From a commercial point of view, the most important operating system environments, and hence the ones that (at a minimum) the DBMS should support, are probably MVS/XA, MVS/ESA, VM/CMS, VAX/VMS, UNIX (various flavors), OS/2, MS/DOS, Windows, … 49

Rule 11: Network Independence It is obviously desirable to be able to support a

Rule 11: Network Independence It is obviously desirable to be able to support a variety of disparate communication networks. v v v From the viewpoint of the distributed DBMS, the network is merely the provider of a reliable message transmission service. “Reliable" here means that, if the network accepts a message from site X for delivery to site Y, then it will eventually deliver that message to site Y. Messages will not be garbled, will not be delivered more than once, and will be delivered in the order sent. The network should also be responsible for site authentication. Ideally the system should support both local and wide area networks. A distributed system should support a variety of different 50 network architectures.

Rule 12: DBMS Independence Ideally a distributed system should provide DBMS independence (or transparency).

Rule 12: DBMS Independence Ideally a distributed system should provide DBMS independence (or transparency). 51

Distributed DBMS Issues v Distributed Database Design v Distributed Query Processing v Distributed Directory

Distributed DBMS Issues v Distributed Database Design v Distributed Query Processing v Distributed Directory Management v Distributed Concurrency Control v Distributed Deadlock Management v Reliability of Distributed Databases 52

Distributed Database Design v The problem is how the database and the applications that

Distributed Database Design v The problem is how the database and the applications that run against it should be placed across the sites. v Two fundamental design issues: w fragmentation (the separation of the database into partitions called fragments) w allocation (distribution) – the optimum distribution of fragments. The general problem is NP hard. – Replicated & non-replicated allocation 53

Distributed Query Processing v Query processing deals with designing algorithms that analyze queries and

Distributed Query Processing v Query processing deals with designing algorithms that analyze queries and convert them into a series of data manipulation operations. v The problem is how to decide on strategy for executing each query over the network in the most cost effective way. The objective is to optimize where the inherent parallelism is used to improve the performance of executing the transaction. w min {cost = data transmission + local processing + … } 54

Distributed Directory Management v A directory contains information (such as descriptions and locations) about

Distributed Directory Management v A directory contains information (such as descriptions and locations) about data items in the database. v A directory may be global to the entire DDBS, or local to each site, distributed, multiple copies, etc. 55

Distributed Concurrency Control v Concurrency control involves w synchronization of accesses to the distributed

Distributed Concurrency Control v Concurrency control involves w synchronization of accesses to the distributed database, such that the integrity of the database is maintained. w Consistency of multiple copies of the database (mutual consistency) and isolation of transactions’ effects. v Deadlock management 56

Reliability of Distributed DBMS v It is important that mechanisms be provided to ensure

Reliability of Distributed DBMS v It is important that mechanisms be provided to ensure the consistency of the database as well as to detect failures and recover from them. v This may be extremely difficult in the case of network partitioning, where the sites are divided into two or more groups with no communication among them. 57

Relationship among Topics Directory Management Query Processing Distributed DB Design Reliability Concurrency Control Deadlock

Relationship among Topics Directory Management Query Processing Distributed DB Design Reliability Concurrency Control Deadlock Management 58

Question & Answer 59

Question & Answer 59