Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Databases “Fundamentals”

Similar presentations


Presentation on theme: "Distributed Databases “Fundamentals”"— Presentation transcript:

1 Distributed Databases “Fundamentals”
Course outlines Distributed Database concepts Distributed Database System – an overview Data Distribution – Advantages and benefits Types of Distributed Databases Heterogeneous and Homogeneous Databases Distributed DBMS Architectures Distributed Data Storage Data Replication Data Fragmentation Distributed Catalog Management Data transparency - Naming of Data Items Transparency and updates

2 Distributed Database Concepts
A transaction can be executed by multiple networked computers in a unified manner. A distributed database (DDB) processes Unit of execution (a transaction) in a distributed manner. A distributed database (DDB) can be defined as a collection of multiple logically related database distributed over a computer network, and a distributed database management system as a software system that manages a distributed database while making the distribution transparent to the user.

3 Distributed Database System – An overview
A distributed database system consists of loosely coupled sites that share no physical component Data is stored at several interconnected machines (also referred to as sites or nodes. Distributed Data Independence: Database systems DBMS that run on each site are independent of each other Users should not have to know where data is located. Distributed Transaction Atomicity: Transactions may access data at one or more sites - Local / Global transaction Users should be able to write transactions accessing multiple sites just like local transactions. S1 S2 S3 network

4 Distributed Database System - Example
Distributed Database – an overview Distributed Database System - Example A typical Distributed Database Consider the EMPLOYEE, PROJECT, and WORKS_ON tables Empolyee (EmpNo, EmpName, Address, Birthdate, DeptNo) Project (ProjNo, ProjName, ProjLocation) WorksOn (EmpNo, ProjNo, Hours) Those tables may be fragmented horizontally and stored with possible replication as shown below. There are five different computer sites San Francisco Los Angeles Atlanta Chicago And New York Distributed data Transparency is required Distribution and Network transparency: Users do not have to worry about operational details of the network.

5 Data Distribution – Advantages and benefits
Distributed Database – an overview Data Distribution – Advantages and benefits Distribution and Network transparency: Users do not have to worry about operational details of the network. There is Location transparency, which refers to freedom of issuing command from any location without affecting its working. Then there is Naming transparency, which allows access to any names object (files, relations, etc.) from any location. Increased reliability and availability: Reliability refers to system live time, that is, system is running efficiently most of the time. Availability is the probability that the system is continuously available (usable or accessible) during a time interval. A distributed database system has multiple nodes (computers) and if one fails then others are available to do the job. Improved performance: A distributed DBMS fragments the database to keep data closer to where it is needed most. This reduces data management (access and modification) time significantly. Easier expansion (scalability): Allows new nodes (computers) to be added anytime without chaining the entire configuration.

6 Types of Distributed Databases (1/2)
Distributed Database System Types of Distributed Databases (1/2) Homogeneous distributed database: All sites have identical software (DBMS) Are aware of each other and agree to cooperate in processing user requests. Each site surrenders part of its autonomy in terms of right to change schemas or software Appears to user as a single system, hiding details of distribution The underlying operating system may be different. For example, all sites run Oracle or DB2, or Sybase or some other database system. The underlying operating systems can be a mixture of Linux, Window, Unix, etc.

7 Types of Distributed Databases (2/2)
Distributed Database System Types of Distributed Databases (2/2) Heterogeneous distributed database Different sites run/use different DBMSs (RDBMSs or even non-relational DBMSs). Difference in schema is a major problem for query processing Difference in software is a major problem for transaction processing Sites may not be aware of each other and may provide only limited facilities for cooperation in transaction processing DBMS1 DBMS2 DBMSn gateway Federated: Each site may run different database system but the data access is managed through a single conceptual schema. This implies that the degree of local autonomy is minimum. Each site must adhere to a centralized access policy. There may be a global schema. Multidatabase: There is no one conceptual global schema. For data access a schema is constructed dynamically as needed by the application software. See chapter 11 

8 Distributed DBMS Architectures
Distributed Database System Distributed DBMS Architectures Query Server Client Client-Server Client ships query to single site. All query processing at server. Thin vs. fat clients. Set-oriented communication, client side caching. Clients reach server for desired service, but server does reach clients. The server software is responsible for local data management at a site, much like centralized DBMS software. The client software is responsible for most of the distribution function. The communication software manages communication among clients and servers. Collaborating-Server Query can span multiple sites. Server Query

9 Distributed Data Storage
Distributed Database System Distributed Data Storage Assume relational data model Fragmentation: Relation is partitioned into several fragments stored in distinct sites Horizontal: Usually disjoint. Vertical: Lossless-join; tids. Replication: System maintains multiple copies of data, stored in different sites, Gives increased availability (fault tolerance). Faster query evaluation. Synchronous vs. Asynchronous - Vary in how current copies are. Replication and fragmentation can be combined Relation is partitioned into several fragments: system maintains several identical replicas of each such fragment. t1 t2 t3 tn ...

10 Data Replication Distributed Data Storage Advantages Disadvantages
A relation or fragment of a relation is replicated if it is stored redundantly in two or more sites. Full replication of a relation is the case where the relation is stored at all sites. Fully redundant databases are those in which every site contains a copy of the entire database. Advantages Availability: failure of site containing a replicated relation r does not result in unavailability of r. Parallelism: queries on r may be processed by several nodes in parallel. Reduced data transfer: relation r is available locally at each site containing a replica of r. Disadvantages Increased cost of updates: each replica of relation r must be updated. Increased complexity of concurrency control: concurrent updates to distinct replicas may lead to inconsistent data unless special concurrency control mechanisms are implemented (primary copy based solution) network S1 S2 R1, R2 R1, R3

11 Data Fragmentation Distributed Data Storage
Split of relation r into logically related fragments (parts) r1, r2, …, rn which contain sufficient information to reconstruct relation r. A relation can be fragmented in two ways: Horizontal fragmentation: each tuple of r is assigned to one or more fragments Vertical fragmentation: the schema for relation r is split into several smaller schemas All schemas must contain a common key to ensure lossless join property. A special attribute, the tuple-id attribute may be added to each schema to serve as a key. Advantages Horizontal: allows parallel processing on fragments of a relation allows a relation to be split so that tuples are located where they are most frequently accessed Vertical: allows tuples to be split so that each part is stored where it is most frequently accessed tuple-id attribute allows efficient joining of vertical fragments allows parallel processing on a relation

12 Data Fragmentation – An example
Distributed Data Storage-Data Fragmentation Data Fragmentation – An example Horizontal Fragmentation of account (b-name, acc-id, balance) account2= b-name=“Valleyview” (account) account1= b-name=“Hillside” (account) b-name acc-id balance Valleyview A-177 A-402 A-408 A-639 205 10000 1123 750 b-name acc-id balance Hillside A-305 A-226 A-155 500 336 62 Vertical Fragmentation of employee (b-name, cust-name, acc-id, balance) B-name Cust-name Tuple-id Hillside Valleyview Lowman Camp Kahn Green 1 2 3 4 5 6 7 Acc-id Balance Tuple-id A-305 A-226 A-177 A-402 A-155 A-408 A-639 500 336 205 10000 62 1123 750 1 2 3 4 5 6 7 deposit1=b-name, cust-name, tuple-id (employee) deposit2= acc-id, balance, tuple-id (employee)

13 Distributed Catalog Management
Distributed Data Storage – principals Distributed Catalog Management Must keep track of how data is distributed across sites. Must be able to name each replica of each fragment. To preserve local autonomy: <local-name, birth-site> Site Catalog: Describes all objects (fragments, replicas) at a site Keeps track of replicas of relations created at this site. To find a relation, look up its birth-site catalog. Birth-site never changes, even if relation is moved.

14 Data Transparency Data transparency: Naming of Data Items - Criteria
Distributed Data Storage Data Transparency Data transparency: Degree to which system user may remain unaware of the details of how and where the data items are stored in a distributed system Consider transparency issues in relation to: Fragmentation/Replication and Location transparency Naming of Data Items - Criteria Every data item must have a system-wide unique name. It should be possible to find the location of data items efficiently. It should be possible to change the location of data items transparently. Each site should be able to create new data items autonomously.

15 Data Transparency- Naming of Data Items
Distributed Data Storage – Data transparency Data Transparency- Naming of Data Items Centralized Scheme “Name Server” Structure: name server assigns all names each site maintains a record of local data items sites ask name server to locate non-local data items Advantages: satisfies naming criteria 1-3 Disadvantages: does not satisfy naming criterion 4 name server is a potential performance bottleneck name server is a single point of failure Use of Aliases –alternative to Centralized Scheme each site prefixes its own site identifier to any name that it generates i.e., site17.account. “having a unique identifier”, and avoids problems associated with central control. fails to achieve network transparency. Solution: Create a set of aliases for data items; Store the mapping of aliases to the real names at each site. user can be unaware of the physical location of a data item, and is unaffected if the data item is moved from one site to another.

16 Transparency and Updates
Data Transparency- Naming of Data Items insertions should be in accordance with the distributed catalog Transparency and Updates Must ensure that all replicas of a data item are updated and that all affected fragments are updated. Consider that: The account relation is horizontally fragmented as follow: insertion of the (“Valleyview”, A-733, 600) into account Muching the tuple (“Valleyview”, A-733, 600) with the applied catalog Tuple inserted into account2 The deposit relation is vertical fragmented as follow: Insert the tuple (“Valleyview”, A-733, ‘Jones”, 600) into deposit The tuple must be split into two fragments: one to be inserted into deposit1 one to be inserted into deposit2 If deposit is replicated, the tuple (“Valleyview”, A-733, “Jones”600) must be inserted in all replicas Problem:  If deposit is accessed concurrently it is possible that one replica will be updated earlier than another! account1 = b-name= “Hillside” (account) account2 = b-name= “Valleyview”(account) deposit1=b-name, cust-name, tuple-id (employee) deposit2= acc-id, balance, tuple-id (employee)


Download ppt "Distributed Databases “Fundamentals”"

Similar presentations


Ads by Google