1 / 44

Parallel and Distributed Databases

Parallel and Distributed Databases. LECTURE PLAN Parallel DBMS - What and Why? What is a Client/Server DBMS? Why do we need Distributed DBMSs? Date’s rules for a Distributed DBMS Benefits of a Distributed DBMS Issues associated with a Distributed DBMS

willis
Télécharger la présentation

Parallel and Distributed Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Parallel and Distributed Databases

  2. LECTURE PLAN • Parallel DBMS - What and Why? • What is a Client/Server DBMS? • Why do we need Distributed DBMSs? • Date’s rules for a Distributed DBMS • Benefits of a Distributed DBMS • Issues associated with a Distributed DBMS • Disadvantages of a Distributed DBMS

  3. PARALLEL DATABASE SYSTEM

  4. PARALLEL DBMSs WHY DO WE NEED THEM? • More and More Data! • We have databases that hold a high amount of • data, in the order of 1012 bytes: • 10,000,000,000,000bytes! • Faster and Faster Access! • We have data applications that need to process • data at very high speeds: • 10,000s transactions per second! SINGLE-PROCESSOR DBMS AREN’T UP TO THE JOB!

  5. PARALLEL DBMSs BENEFITS OF A PARALLEL DBMS • Improves Response Time. INTERQUERY PARALLELISM It is possible to process a number of transactions in parallel with each other. • Improves Throughput. INTRAQUERY PARALLELISM It is possible to process ‘sub-tasks’ of a transaction in parallel with each other.

  6. PARALLEL DBMSs HOW TO MEASURE THE BENEFITS • Speed-Up. As you multiply resources by a certain factor, the time taken to execute a transaction should be reduced by the same factor: 10 seconds to scan a DB of 10,000 records using 1 CPU 1 second to scan a DB of 10,000 records using 10 CPUs • Scale-up. As you multiply resources the size of a task that can be executed in a given time should be increased by the same factor. 1 second to scan a DB of 1,000 records using 1 CPU 1 second to scan a DB of 10,000 records using 10 CPUs

  7. PARALLEL DBMSs SPEED-UP 2000/Sec 1600/Sec Sub-linear speed-up 1000/Sec 16 CPUs 10 CPUs 5 CPUs Linear speed-up (ideal) Number of transactions/second Number of CPUs

  8. PARALLEL DBMSs 1000/Sec 900/Sec Sub-linear scale-up 10 CPUs 2 GB Database 5 CPUs 1 GB Database SCALE-UP Linear scale-up (ideal) Number of transactions/second Number of CPUs, Database size

  9. X X CPU CPU CPU CPU CPU CPU X Shared Memory – Parallel Database Architecture MEMORY X

  10. M M M M M M X X CPU CPU CPU CPU CPU CPU X Shared Disk – Parallel Database Architecture

  11. M M M M M CPU CPU CPU CPU CPU Shared Nothing – Parallel Database Architecture

  12. MAINFRAME DATABASE SYSTEM

  13. DUMB DUMB DUMB TERMINALS MAINFRAME COMPUTER SPECIALISED NETWORK CONNECTION PRESENTATION LOGIC BUSINESS LOGIC DATA LOGIC

  14. CLIENT/SERVER DATABASE SYSTEM

  15. CLIENT/SERVER DBMS • Manages user interface • Accepts user data • Processes application/business logic • Generates database requests (SQL) • Transmits database requests to server • Receives results from server • Formats results according to application logic • Present results to the user CLIENT PROCESS

  16. CLIENT/SERVER DBMS • Accepts database requests • Processes database requests • Performs integrity checks • Handles concurrent access • Optimises queries • Performs security checks • Enacts recovery routines • Transmits result of database request to client SERVER PROCESS

  17. CLIENT#1 CLIENT#2 D/BASE NETWORK CLIENT#3  Data Request  Data Response CLIENT/SERVER DBMS ARCHITECTURE  SERVER   DBMS    DATA LOGIC PRESENTATION LOGIC BUSINESS LOGIC (FAT CLIENT)

  18. CLIENT#1 CLIENT#2 NETWORK CLIENT#3  Data Request  Data Response CLIENT/SERVER DBMS ARCHITECTURE  SERVER  D/BASE  PL/SQL DBMS    BUSINESS LOGIC DATA LOGIC PRESENTATION LOGIC (THIN CLIENT)

  19. DISTRIBUTED PROCESSING ARCHITECTURE CLIENT CLIENT CLIENT CLIENT CLIENT LAN LAN CLIENT CLIENT CLIENT WIDE AREA NETWORK Stratford Leyton CLIENT CLIENT CLIENT CLIENT LAN LAN DBMS CLIENT CLIENT CLIENT CLIENT Leytonstone Barking

  20. DISTRIBUTED DATABASE SYSTEM

  21. DISTRIBUTED DATABASES WHAT IS A DISTRIBUTED DATABASE? • A distributed database system is a collection of logically related databases that co-operate in a transparent manner. • Transparent implies that each user within the system may access all of the data within all of the databases as if they were a single database • There should be ‘location independence’ i.e.- as the user is unaware of where the data is located it is possible to move the data from one physical location to another without affecting the user.

  22. DISTRIBUTED DATABASE ARCHITECTURE CLIENT CLIENT CLIENT CLIENT CLIENT CLIENT LAN DBMS DBMS CLIENT CLIENT CLIENT WIDE AREA NETWORK Leyton Stratford CLIENT CLIENT CLIENT CLIENT CLIENT LAN DBMS DBMS CLIENT CLIENT CLIENT CLIENT Leytonstone Barking

  23. M:N CLIENT/SERVER DBMS ARCHITECTURE NETWORK SERVER #1 CLIENT#1 D/BASE DBMS CLIENT#2 SERVER #2 D/BASE CLIENT#3 DBMS NOT TRANSPARENT!

  24. COMPONENTS OF A DDBMS Site 1 DDBMS DC LDBMS GSC DB Computer Network GSC DDBMS LDBMS =Local DBMS DC = Data Communications GSC = Global Systems Catalog DDBMS = Distributed DBMS DC Site 2

  25. DISTRIBUTED DATABASES ADVANTAGES • Reduced Communication Overhead • Most data access is local, less expensive and performs • better. • Improved Processing Power • Instead of one server handling the full database, we now • have a collection of machines handling the same database. • Removal of Reliance on a Central Site • If a server fails, then the only part of the system that is • affected is the relevant local site. The rest of the system • remains functional and available.

  26. DISTRIBUTED DATABASES ADVANTAGES • Expandability • It is easier to accommodate increasing the size of the • global (logical) database. • Local autonomy • The database is brought nearer to its users. This can effect • a cultural change as it allows potentially greater control • over local data .

  27. DISTRIBUTED DATABASES DATE’S TWELVE RULES FOR A DDBMS • A distributed system looks exactly like • a non-distributed system to the user! • Local autonomy • No reliance on a central site • Continuous operation • Location independence • Fragmentation independence • Replication independence • Distributed query independence • Distributed transaction processing • Hardware independence • Operating system independence • Network independence • Database independence

  28. DISTRIBUTED DATABASES ISSUES • Data Allocation • Data Fragmentation • Distributed Catalogue Management • Distributed Transactions • Distributed Queries – (see chapter 20)

  29. DISTRIBUTED DATABASES DATA ALLOCATION METRICS • Locality of reference Is the data near to the sites that need it? • Reliability and availability Does the strategy improve fault tolerance and accessibility? • Performance Does the strategy result in bottlenecks or under-utilisation of resources? • Storage costs How does the strategy effect the availability and cost of data storage? • Communication costs How much network traffic will result from the strategy?

  30. DISTRIBUTED DATABASES DATA ALLOCATION STRATEGIES CENTRALISED Lowest Locality of Reference Lowest Reliability/Availability Lowest Storage Costs Performance Unsatisfactory Communication Costs Highest

  31. DISTRIBUTED DATABASES DATA ALLOCATION STRATEGIES PARTITIONED/FRAGMENTED High Locality of Reference Low (item) – High (system) Reliability/Availability Lowest Storage Costs Performance Satisfactory Communication Costs Low

  32. DISTRIBUTED DATABASES DATA ALLOCATION STRATEGIES COMPLETE REPLICATION Highest Locality of Reference Highest Reliability/Availability Highest Storage Costs Performance High High (update) – Low (read) Communication Costs

  33. DISTRIBUTED DATABASES DATA ALLOCATION STRATEGIES SELECTIVE REPLICATION High Locality of Reference Low (item) – High (system) Reliability/Availability Average Storage Costs Performance Satisfactory Communication Costs Low

  34. DISTRIBUTED DATABASES WHY FRAGMENT DATA? • Usage Applications are usually interested in ‘views’ not whole relations. • Efficiency It’s more efficient if data is close to where it is frequently used. • Parallelism It is possible to run several ‘sub-queries’ in tandem. • Security Data not required by local applications is not stored at the local site.

  35. DISTRIBUTED DATABASES HORIZONTAL DATA FRAGMENTATION BALANCE ACCOUNT CUSTOMER BRANCH 200 JONES STRATFORD 1000.00 324 GRAY BARKING 200.00 345 SMITH STRATFORD 23.17 350 GREEN BARKING 340.14 400 ONO BARKING 500.00 456 KHAN STRATFORD 333.00 Horizontal Fragmentation: Consists of a Restriction on a Relation. e.g.,(branch = ‘Stratford’ Account)

  36. DISTRIBUTED DATABASES HORIZONTAL DATA FRAGMENTATION BRANCH BRANCH ACCT NO. ACCT NO. CUSTOMER CUSTOMER BALANCE BALANCE 324 200 GRAY JONES STRATFORD BARKING 200.00 1000.00 350 345 SMITH GREEN STRATFORD BARKING 340.14 23.17 400 456 KHAN ONO BARKING STRATFORD 500.00 333.00 STRATFORD BRANCH BARKING BRANCH

  37. DISTRIBUTED DATABASES VERTICAL DATA FRAGMENTATION S# NAME SITE PHONE NO LOGIN PASSWORD 200 JONES STRATFORD 0208-500-9000 JON200T XXYY22 324 GRAY BARKING 0208-545-7528 GRA324S ZZEE56 456 KHAN STRATFORD 0208-500-5821 KHA456T KJTR78 Vertical Fragmentation: Consists of a Projection on a Relation. e.g.,(S#, NAME, SITE, PHONE NO Student)

  38. DISTRIBUTED DATABASES VERTICAL DATA FRAGMENTATION SITE S# NAME PHONE NO. 200 JONES STRATFORD 0208-500-9000 324 GRAY BARKING 0208-545-7528 456 KHAN STRATFORD 0208-500-5821 STUDENT ADMINISTRATION NETWORK ADMINISTRATION PASSWORD S# LOGIN-ID 200 JON200T XXYY22 324 GRA324S ZZEE56 456 KHA456T KJTR78

  39. DISTRIBUTED DATABASES DISTRIBUTED CATALOG MANAGEMENT • Centralised Global Catalog • One site maintains the full global catalog. All changes to • any local system catalog have to be propagated to the site • maintaining the global catalog. Bad performance, single • point of failure, compromises site autonomy. • Dispersed Catalog • There is no physical global catalog. Each time a remote • data item is required, the catalogues from ALL other sites • are examined for the item. This has severe performance • penalties.

  40. DISTRIBUTED DATABASES DISTRIBUTED CATALOG MANAGEMENT • Replicated Global Catalog • Each site maintains its own global catalog. Although this • greatly speeds up remote data location, it is very • inefficient to maintain. A detail of every data item added, • changed or deleted locally has to be propagated to ALL • other sites . • Local-Master Catalog • Each site maintains both its local system catalog as well • as a catalog of all of its data items that are replicated at • other sites. This avoids compromising site autonomy, is • fairly efficient, and is not a single point of failure.

  41. DISTRIBUTED DATABASES ATOMIC DISTRIBUTED TRANSACTION DISTRIBUTED TRANSACTIONS Stratford Client (a) Stratford DBMS Stratford Client Stratford DB X Stratford Client (b) Barking DBMS Barking DB Global Transaction (a) Debit Stratford A/C £500 (b) Credit Barking A/C £350 (c) Credit Leyton A/C £150 (c) Leyton DBMS Leyton DB

  42. TWO-PHASE COMMIT (2PC) - OK

  43. TWO-PHASE COMMIT (2PC) - ABORT ‘Global Abort’

  44. DISTRIBUTED DATABASES DISADVANTAGES OF DDBMSs • Architectural complexity. • Cost. • Security. • Integrity control more difficult. • Lack of standards. • Lack of experience. • Database design more complex.

More Related