Jerry Post McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Database Management Systems Chapter 10 Distributed.

Slides:



Advertisements
Similar presentations
Database System Concepts and Architecture
Advertisements

Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 13 (Web): Distributed Databases
Distributed Database Management Systems
Introduction to Web Database Processing
Overview Distributed vs. decentralized Why distributed databases
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Introduction to Web Interface Technology (CSE2030)
12 Chapter 12 Client/Server Systems Hachim Haddouti.
Data Storage and Data Processing Architectures The difficulty is in the choice George Moore, 1900.
The Architecture of Transaction Processing Systems
Chapter 12 Distributed Database Management Systems
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 17 Client-Server Processing, Parallel Database Processing,
System Analysis and Design
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Centralized and Client/Server Architecture and Classification of DBMS
DATABASE MANAGEMENT SYSTEMS 2 ANGELITO I. CUNANAN JR.
Distributed Databases
Jerry Post Copyright © 2013 DATABASE Database Management Systems Chapter 11 Distributed Databases 1.
Lecture The Client/Server Database Environment
Client-Server Processing and Distributed Databases
The Client/Server Database Environment
Introduction to Databases Transparencies 1. ©Pearson Education 2009 Objectives Common uses of database systems. Meaning of the term database. Meaning.
1 Introduction to Web Development. Web Basics The Web consists of computers on the Internet connected to each other in a specific way Used in all levels.
INTRODUCTION TO WEB DATABASE PROGRAMMING
DATABASE 1 Distributed Databases  Definition  Advantages / Uses  Problems / Complications  Client-Server / SQL Server  Microsoft Access Britain Germany.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
1 Distributed and Parallel Databases. 2 Distributed Databases Distributed Systems goal: –to offer local DB autonomy at geographically distributed locations.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Data Storage and Data Processing Architectures The difficulty is in the choice George Moore, 1900.
Lecture On Database Analysis and Design By- Jesmin Akhter Lecturer, IIT, Jahangirnagar University.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
Section 2 Section 2.1 Identify hardware Describe processing components Compare and contrast input and output devices Compare and contrast storage devices.
MET280: Computing for Bioinformatics Introduction to databases What is a database? Not a spreadsheet. Data types and uses DBMS (DataBase Management System)
DBSYSTEMS Distributed Database Systems University of Manitoba Asper School of Business 3500 DBMS Bob Travica Updated of 24.
Session-8 Data Management for Decision Support
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 12 Distributed Database Management Systems.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
The Client/Server Database Environment Ployphan Sornsuwit KPRU Ref.
Personal Computer - Stand- Alone Database  Database (or files) reside on a PC - on the hard disk.  Applications run on the same PC and directly access.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
Oracle's Distributed Database Bora Yasa. Definition A Distributed Database is a set of databases stored on multiple computers at different locations and.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 10: Distributed Databases Jerry Post Copyright © 2003.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 2-1 Data Models Data Model: A set.
Databases Illuminated
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
Distributed database system
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 15: Reliability and Security in Database Servers Instructor’s.
Topic Distributed DBMS Database Management Systems Fall 2012 Presented by: Osama Ben Omran.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
Chapter 13 Client/Server Database and Distributed Database Fundamentals of Database Management Systems by Mark L. Gillenson, Ph.D. University of Memphis.
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
Distributed Databases
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 10: Distributed Databases and the Internet All Powder.
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 9: Database Administration All Powder Board and Ski.
The Client-Server Model
The Client/Server Database Environment
The Client/Server Database Environment
The Client/Server Database Environment
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
An Introduction to Computer Networking
Introduction to Databases Transparencies
Distributed Databases
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Introduction of Week 14 Return assignment 12-1
Presentation transcript:

Jerry Post McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. Database Management Systems Chapter 10 Distributed Databases and the Internet

DATABASE 2 Distributed Databases  Definition  Advantages / Uses  Problems / Complications  Client-Server / SQL Server  Microsoft Access Britain Germany France Italy SELECT Sales FROM Britain.Sales UNION SELECT Sales FROM France.Sales UNION SELECT Sales FROM Italy.Sales

DATABASE 3 Distributed Database Definition  Multiple independent databases  Each DBMS is a complete DBMS (engine, queries, locking, transactions, etc.)  Usually on different machines.  Usually in different locations.  Connected by a network.  Might be different environments  Hardware  Operating System  DBMS Software Database Zeus Database Apollo Database Athena United States England France

DATABASE 4 Distributed Database Rules  C.J. Date  Rule 0: Transparency: the user should not know or care that the database is distributed.  Local autonomy.  No reliance on a central site.  Continuous operation.  Location independence.  Fragmentation independence (physical storage).  Replication independence.  Distributed query processing.  Distributed transaction management.  Hardware independence.  Operating system independence.  Network independence.  DBMS independence.

DATABASE 5 Distributed Features  Each database can continue to run even if portion fails.  Data and hardware can be moved without affecting operations or users.  Expanding operations.  Performance issues.  System expansion and upgrades.  Add new section without affecting others.  Upgrade hardware, network and DBMS.

DATABASE 6 Advantages and Applications  Business operations are often distributed  Work and data are segmented by department.  Work and data are segmented by geographical location.  Improved performance  Most updates and queries are performed locally.  Maintain local control and responsibility over data.  Can still combine data across the system.  Scalability and expansion  Add on, not replacement. local transactions future expansion

DATABASE 7 Creating a Distributed Database  Design administration plan.  Choose hardware and DBMS vendor, and network.  Set up network and DBMS connections.  Choose locations for data.  Choose replication strategy.  Create backup plan and strategy.  Create local views and synonyms.  Perform stress test: loads and failures.

DATABASE 8 Distributed Query Processing  Networks are slow  Drives: MB per sec.  LANs: 1-10 MB per sec ( mbps).  WANs: MB per sec.  Faster is possible but expensive!  SANs: MB per sec.  Goal is to minimize transmissions.  Each system must be capable of evaluating queries--preferably SQL.  Results depend heavily on how the system joins tables MB MB MB Disk drive LAN WAN

DATABASE 9 Customers(C#, …) 1,000,000 NY Products(P#, Color…) 10,000,000 Sales(S#, C#, Sdate) 20,000,000 SaleItem(S#, P#,…) 50,000,000 Chicago LA Distributed Query Processing  Example  NY: Customers: 1 M rows  LA: Production: 10 M rows  Chicago: Sales: 20 M rows  Query: List customers who bought blue products on March 1  Bad idea #1 Transfer all rows to Chicago Then JOIN and select.  Better idea #2 (probably) Transfer blue products from LA to Chicago  Better idea #3 Get sale items on March 1 Get blue products from LA Send C# to NY P# sold on March 1 Blue P# sold on March 1 C# list from desired P# Matching Customer data

DATABASE 10 Data Replication  Goals  Minimize transmissions  Improve performance  Support heavy multiuser access.  Problems  Updating copies Bulk transmissions Site unavailable  Concurrency Easier for two people to change the same data at the same time.  Decision support systems.  Data warehouse. Britain: Customers & Sales France: Customers & Sales Spain: Customers & Sales Britain Britain: Customers & Sales France: Customers & Sales Spain: Customers & Sales Spain Update data. Market research & data corrections. Periodic updates

DATABASE 11 Concurrency and Locks  Each DBMS must maintain lock facility.  To update, each DBMS must utilize and recognize other lock mechanisms and return codes.  Each DBMS must have a deadlock resolution protocol that recognizes the distributed databases.  Random wait.  Optimistic updates.  Two-phase commit. DBMS #1 Accounts Jones8898 DBMS #2 Accounts Jones3561 Transaction A Locked Waiting Transaction B Waiting Locked

DATABASE 12 Transactions & Two-Phase Commit  Two (or more) separate lock managers.  DBMS initiating update serves as the coordinator.  Two phases  Coordinator sends message and data to all machines to “get ready.”  Local machines save data in logs, verify update status and return message.  If all locals report OK, then coordinator writes log and instructs others to proceed. If any fail, it sends Rollback message. Database 1 Initiate Transaction Database 2 Database 3 1. Prepare to commit. All agree? 2. Commit Lock tables. Save log. Update all tables.

DATABASE 13 Distributed Transaction Managers Transaction Processing Monitor Transaction Manager Resource Manager Transaction Manager Resource Manager Transaction Manager Resource Manager DBMS The distributed transaction coordinator/transaction processing monitor handles the transaction decisions and coordinates across the participating systems.

DATABASE 14 Distributed Design Questions

DATABASE 15 Distributed Databases In Oracle  Database Links  Full database names.  CONNECT command.  Linking through synonyms.  CREATE SYNONYM …  Central control over permissions.  Linking through Views/queries.  CREATE VIEW AS …  Can assign local permissions.  Linking through stored procedures.  DELETE …  Strong control over actions. Server database View Synonym: Employee Procedure: DELETE FROM Employee WHERE... user permissions User can only run procedure. No other access.

DATABASE 16 Client-Server Server Clients Shared Database Front-end User Interface

DATABASE 17 LAN File Server  Not a distributed database.  Data file stored on server.  Server is passive, appears as giant disk drive to PC.  PC processes all data.  Retrieves all needed data across the network.  Performance improvements.  Indexes are crucial.  Store some data on each PC (replication).  Store applications on PC (graphics & forms).  Convert to SQL-Server File Server DBMS data file Application Shared Data SELECT Name, SaleDate FROM Customer INNER JOIN Sales ON Customer.C# = Sales.C# WHERE SaleDate BETWEEN #1-Mar-97# AND #9-Mar-97#; All data from all tables are read by PC, which performs JOIN and WHERE test. If available, reads index first.

DATABASE 18 LAN File Server: Slow File Server CustIDName… 115Jenkins… 125Juarez... Order... MyFile.mdb Forms SELECT * FROM Customer WHERE City = “Sandy” DBMS software transferred. Application and query transferred. One row at a time transferred, until all rows are examined.

DATABASE 19 Client-Server Databases  One machine machine is dominant (server) and handles data for many clients.  Client machines handle front-end tasks and small data tables that are not shared. File Server DBMS SQL Server Shared Data application SELECT... Send SQL statement. Return matching data.

DATABASE 20 ADO and Direct Connections Database Server Visual Basic application DBMS transport ADO Client Computer DBMS transport Server Computer SELECT … Results The Database vendor provides its own data transport (e.g,. Oracle or SQL Server) installed on the server and the client. ADO provides a driver that connects your application to the transport services. ODBC can serve as the data transport if nothing else is available

DATABASE 21 Three-Tier Client-Server  Server Databases  Client front-end  Middle  Locate databases  Business rules  Program code Client Middleware Database Servers Application. Front-end. User Interface. Databases. Transactions. Legacy applications. Database links. Business rules. Program code.

DATABASE 22 Database Independence on the Client New DBMSOriginal DBMS Application ADO

DATABASE 23 Database Independence with Queries SELECT SaleID, SaleDate, CustomerID, CustomerName FROM SaleCustomer SELECT SaleID, SaleDate, CustomerID, LastName || ‘, ‘ || FirstName AS CustomerName FROM Sale, Customer WHERE Sale.CustomerID=Customer.CustomerID SELECT SaleID, SaleDate, CustomerID, LastName + ‘, ‘ + FirstName AS CustomerName FROM Sale INNER JOIN Customer ON Sale.CustomerID = Customer.CustomerID Independent Application Query: works with any DBMS Saved Oracle Query Saved SQL Server Query

DATABASE 24 The Internet as Client-Server Client Browser Server Web Server Router Internet HTML pages Forms Graphics request information

DATABASE 25 HTML Limited Clients My main page My text goes in paragraphs. Additional tags set boldface and Italic. Tables are more complicated and use a set of tags for rows and columns. First cell Second cell Next row Second column There are form tags to create input forms for collecting data. But you need CGI program code to convert and use the input data.

DATABASE 26 HTML Output

DATABASE 27 Web Server Database Fundamentals Client/Browser Web Server HTML form 1 Data DBMS 2 Form.html Query Database Result Query Template + Code Program code Page = Template + Result Result Page Form CGI String 0 Request Server/Form.html HTML Form

DATABASE 28 Database Example: Client Side 0 Request Server/Form.html 1 2 Server 3 Results Call ASP page Initial form

DATABASE 29 Client-Server Data Transfer Order Form Order Date Customer 12-Aug Jones, Martha Order ID 1015 What if there are 10,000 customers? How much time to load the combo box? How do you refresh/reload the combo box? Alternatives?

DATABASE 30 Latency time Server Client Generate form Form received User delay Receive form data Transmission delay

DATABASE 31 XML: Transferring Data Order: OrderID, OrderDate, ShippingCost, Comment Item: ItemID, Description, Quantity, Cost Many XML files contain hierarchical data. Item: ItemID, Description, Quantity, Cost

DATABASE 32 XML: Schema Definition xsd Partial file, generated by.NET xsd.exe

DATABASE 33 XML Data Example 1 3/6/2004 $33.54 Need immediately. 30 Flea Collar-Dog- Medium 208 $ Aquarium Filter & Pump 8 $24.65 XML: extensible markup language

DATABASE 34 XML Example in Explorer

DATABASE 35 Java and JDBC Connection con = DriverManager.getConnection( "jdbc.myDriver:myDBName", “myLogin”, “myPassword”); Statement smt = con.CreateStatement(); ResultSet rst = smt.executeQuery( “SELECT AnimalID, Name, Category, Breed FROM Animal”); while (rst.next()) { int iAnimal = rst.getInt(“AnimalID”); String sName = rst.getString(“Name”); String sCategory = rst.getString(“Category”); String sBreed = rst.getString(“Breed”); \\ Now do something with these four variables }

Database Management Systems McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. End of Chapter 10