Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5: Sun: 1/5/1435 - Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &

Similar presentations


Presentation on theme: "Lecture 5: Sun: 1/5/1435 - Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &"— Presentation transcript:

1 Lecture 5: Sun: 1/5/1435 - Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas k.albasheir@sau.edu.sa CS- 492 : Distributed system & Parallel Processing

2 A Distributed Algorithm (1) Three different cases: 1. If the receiver is not accessing the resource and does not want to access it, it sends back an OK message to the sender. 2. If the receiver already has access to the resource, it simply does not reply. Instead, it queues the request. 3. If the receiver wants to access the resource as well but has not yet done so, it compares the timestamp of the incoming message with the one contained in the message that it has sent everyone. The lowest one wins.

3 A Distributed Algorithm (3) (b) Process 0 has the lowest timestamp, so it wins.

4 A Token Ring Algorithm (a) An unordered group of processes on a network. (b) A logical ring constructed in software.

5 A Comparison of the Four Algorithms A comparison of three mutual exclusion algorithms.

6 Election Algorithms The Bully Algorithm 1. P sends an ELECTION message to all processes with higher numbers. 2. If no one responds, P wins the election and becomes coordinator. 3. If one of the higher-ups answers, it takes over. P’s job is done.

7 The Bully Algorithm (1) The bully election algorithm. (a) Process 4 holds an election. (b) Processes 5 and 6 respond, telling 4 to stop. (c) Now 5 and 6 each hold an election.

8 The Bully Algorithm (2) The bully election algorithm. (d) Process 6 tells 5 to stop. (e) Process 6 wins and tells everyone.

9 A Ring Algorithm Figure 6-21. Election algorithm using a ring.

10 Definitions 4 Distributed Database: A single logical database that is spread physically across computers in multiple locations that are connected by a data communications link 4 Decentralized Database: A collection of independent databases on non-networked computers

11 Reasons for Distributed Database 4 Business unit autonomy and distribution 4 Data sharing 4 Data communication costs 4 Data communication reliability and costs 4 Multiple application vendors 4 Database recovery 4 Transaction and analytic processing

12 Distributed database environments

13 Distributed Database Options 4 Homogeneous - Same DBMS at each node –Autonomous - Independent DBMSs –Non-autonomous - Central, coordinating DBMS –Easy to manage, difficult to enforce 4 Heterogeneous - Different DBMSs at different nodes –Systems – With full or partial DBMS functionality –Gateways - Simple paths are created to other databases without the benefits of one logical database –Difficult to manage, preferred by independent organizations

14 Distributed Database Options 4 Systems - Supports some or all functionality of one logical database –Full DBMS Functionality - All distributed DB functions –Partial-Multi database - Some distributed DB functions Federated - Supports local databases for unique data requests –Loose Integration - Local dbs have their own schemas –Tight Integration - Local dbs use common schema Unfederated - Requires all access to go through a central, coordinating module

15 Homogeneous, Non-Autonomous Database 4 Data is distributed across all the nodes 4 Same DBMS at each node 4 All data is managed by the distributed DBMS (no exclusively local data) 4 All access is through one, global schema 4 The global schema is the union of all the local schema

16 Identical DBMSs Homogeneous Database

17 Typical Heterogeneous Environment 4 Data distributed across all the nodes 4 Different DBMSs may be used at each node 4 Local access is done using the local DBMS and schema 4 Remote access is done using the global schema

18 Typical Heterogeneous Environment Non-identical DBMSs

19 Major Objectives 4 Location Transparency –User does not have to know the location of the data –Data requests automatically forwarded to appropriate sites 4 Local Autonomy –Local site can operate with its database when network connections fail –Each site controls its own data, security, logging, recovery

20 Significant Trade-Offs 4 Synchronous Distributed Database – All copies of the same data are always identical –Data updates are immediately applied to all copies throughout network –Good for data integrity –High overhead  slow response times 4 Asynchronous Distributed Database –Some data inconsistency is tolerated –Data update propagation is delayed –Lower data integrity –Less overhead  faster response time

21 Advantages of Distributed Database over Centralized Databases 4 Increased reliability/availability 4 Local control over data 4 Modular growth 4 Lower communication costs 4 Faster response for certain queries

22 Disadvantages of Distributed Database Compared to Centralized Databases 4 Software cost and complexity 4 Processing overhead 4 Data integrity exposure 4 Slower response for certain queries

23 Options for Distributing a Database 4 Data replication –Copies of data distributed to different sites 4 Horizontal partitioning –Different rows of a table distributed to different sites 4 Vertical partitioning –Different columns of a table distributed to different sites 4 Combinations of the above

24 Distributed processing system for a manufacturing company

25 Five Distributed Database Organizations  Centralized database, distributed access  Replication with periodic snapshot update  Replication with near real-time synchronization of updates  Partitioned, one logical database  Partitioned, independent, nonintegrated segments

26 Factors in Choice of Distributed Strategy 4 Funding, autonomy, security 4 Site data referencing patterns 4 Growth and expansion needs 4 Technological capabilities 4 Costs of managing complex technologies 4 Need for reliable service


Download ppt "Lecture 5: Sun: 1/5/1435 - Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &"

Similar presentations


Ads by Google