1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 15: Data Replication with Network Partitions & Transaction Processing Systems.

Slides:



Advertisements
Similar presentations
ICS 434 Advanced Database Systems
Advertisements

Message Queues COMP3017 Advanced Databases Dr Nicholas Gibbins –
Netscape Application Server Application Server for Business-Critical Applications Presented By : Khalid Ahmed DS Fall 98.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 12: Three-Phase Commits (3PC) Professor Chen Li.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
ICS 421 Spring 2010 Distributed Transactions Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/16/20101Lipyeow.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
CS 582 / CMPE 481 Distributed Systems
Distributed Database Management Systems
Introduction to Web Database Processing
1 ICS 214B: Transaction Processing and Distributed Data Management Replication Techniques.
1 Distributed Databases CS347 Lecture 16 June 6, 2001.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
Ch 12 Distributed Systems Architectures
12 Chapter 12 Client/Server Systems Hachim Haddouti.
The Architecture of Transaction Processing Systems
©Silberschatz, Korth and Sudarshan19.1Database System Concepts Lecture-10 Distributed Database System A distributed database system consists of loosely.
2/27/ Queued Transaction Processing CSE593 Transaction Processing Philip A. Bernstein Copyright ©1999 Philip A. Bernstein.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 17 Client-Server Processing, Parallel Database Processing,
4/25/ Application Server Issues for the Project CSEP 545 Transaction Processing for E-Commerce Philip A. Bernstein Copyright ©2003 Philip A. Bernstein.
Distributed Databases
Client-Server Processing and Distributed Databases
The Client/Server Database Environment
Client/Server Architectures
IS 4506 Database Connectivity.  Overview Two and Three-Tier C/S Architecture ASP Database Connection ODBC - Connection to DBMS Overview of transaction.
Highly Available ACID Memory Vijayshankar Raman. Introduction §Why ACID memory? l non-database apps: want updates to critical data to be atomic and persistent.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Database Architectures and the Web
Client/Server Databases and the Oracle 10g Relational Database
Client Server Technologies Middleware Technologies Ganesh Panchanathan Alex Verstak.
04/18/2005Yan Huang - CSCI5330 Database Implementation – Distributed Database Systems Distributed Database Systems.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Csi315csi315 Client/Server Models. Client/Server Environment LAN or WAN Server Data Berson, Fig 1.4, p.8 clients network.
Introduction  Client/Server technology is seen by many as the solution to the difficulty of linking together the various departments of corporation.
Unit – I CLIENT / SERVER ARCHITECTURE. Unit Structure  Evolution of Client/Server Architecture  Client/Server Model  Characteristics of Client/Server.
Client-Server Processing, Parallel Database Processing and Distributed Database Systems. KEVIN ROBERTS ANIKET MURLIDHARAN.
MACIASZEK, L.A. (2001): Requirements Analysis and System Design. Developing Information Systems with UML, Addison Wesley Chapter 6 - Tutorial Guided Tutorial.
Week 5 Lecture Distributed Database Management Systems Samuel ConnSamuel Conn, Asst Professor Suggestions for using the Lecture Slides.
The Client/Server Database Environment Ployphan Sornsuwit KPRU Ref.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
5/22/ Business Process Management CSEP 545 Transaction Processing Philip A. Bernstein Copyright ©2007 Philip A. Bernstein.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Architecture.
IM NTU Distributed Information Systems 2004 Replication Management -- 1 Replication Management Yih-Kuen Tsay Dept. of Information Management National Taiwan.
Databases Illuminated
CS CS 5150 Software Engineering Lecture 13 System Architecture and Design 1.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
TM 8-1 Copyright © 1999 Addison Wesley Longman, Inc. Client/Server and Middleware.
EEC 688/788 Secure and Dependable Computing Lecture 9 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
CSC 480 Software Engineering Lecture 17 Nov 4, 2002.
Highly Available Services and Transactions with Replicated Data Jason Lenthe.
Tzu-Han Wu Yi-Chi Chiang Han-Yang Ou
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
6. Application Server Issues for the Project
Databases and DBMSs Todd S. Bacastow January 2005.
rain technology (redundant array of independent nodes)
On-Line Transaction Processing
Dynamic Modeling of Banking System Case Study - I
Database Driven Websites
Data, Databases, and DBMSs
CS 347: Parallel and Distributed Data Management Notes 11: Network Partitions Hector Garcia-Molina CS347 Notes11.
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Lecture 21: Replication Control
EEC 688/788 Secure and Dependable Computing
Lecture 21: Replication Control
Presentation transcript:

1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 15: Data Replication with Network Partitions & Transaction Processing Systems Professor Chen Li

ICS214BNotes 152 Network partitions Groups of nodes may be isolated or nodes may be slow in responding PP Net

ICS214BNotes 153 Network Partitions No replicated data –Quorum-based 3PC  abort, commit quorums Replicated data –at most one operational group  coterie  propagation of updates

ICS214BNotes 154 Quorums C 1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} A 1 = {{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d}} Important property: X  C 1   Y  A 1 X  Y  Ø Y  A 1   X  C 1 X  Y  Ø. a b.. c. d

ICS214BNotes 155 Some quorums can be implemented with vote assignments To commit  3 To abort  2 Votes to commit + votes to abort > total votes Why? a b.. c. d

ICS214BNotes 156 Not all quorums can be implemented via votes C 2 = {{a,b}, {c,d}} A 2 = {{a,c}, {a,d}, {b,c}, {b,d}} a b d c

ICS214BNotes 157 Proof C 2 = {{a,b}, {c,d}} A 2 = {{a,c}, {a,d}, {b,c}, {b,d}} Suppose it can be implemented via votes Let each site symbol represent its vote Let x be the commit threshold Let y be the abort threshold Commit:Abort: a + b >= x a + c >= y y > c + d x > b + d c + d >= x a + d >= y y > a + b x > b + c b + c >= y x > a + d b + d >= y x > a + c 2y > 2(a+b+c+d) >= 2x 4x > 4(a+b+c+d) >= 4y

ICS214BNotes 158 Another Proof C 2 = {{a,b}, {c,d}} A 2 = {{a,c}, {a,d}, {b,c}, {b,d}} Commit:Abort: a + b >= x a + c >= y c + d >= x a + d >= y b + c >= y b + d >= y 2 * () + 1 * () 4(a+b+c+d) >= 4x + 4y a+b+c+d >= x + y  contradiction!

ICS214BNotes 159 Partitions and data replication Options: (1) All copies required for updates (2) Group may update, but at most one (at a time) (3) Any group may update

ICS214BNotes 1510 Updates by at most one group Coterie C 1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} C 2 = {{a,b}, {a,c}, {a,d}, {b,c,d}} X 1 = {{a,b}, {c,d}} not valid Important property: S  C   G  C, S  G  Ø. a b.. c. d

ICS214BNotes 1511 Reading replicated data C 1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} R 1 = {{a,b}, {a,c}, {a,d},{b,c}, {b,d}, {c,d}} C 2 = R 2 = {{a,b}, {a,c}, {a,d}, {b,c,d}}. a b.. c. d

ICS214BNotes 1512 Reading replicated data - Votes C 1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} R 1 = {{a,b}, {a,c}, {a,d},{b,c}, {b,d}, {c,d}}. a b.. c. d to write get 3 votes (V w ) to read get 2 votes (V R )

ICS214BNotes 1513 Reading replicated data - Votes C 2 = R 2 = {{a,b}, {a,c}, {a,d}, {b,c,d}}. a b.. c. d to write get 3 votes (V w ) to read get 3 votes (V R )

ICS214BNotes 1514 A Problem Example: a 3-node system, 1 vote each node, replicated data Now: T 1. aT 1 is committed at a,b. But after T1 writes data at b before it writes data at a, the network gets repartitioned. T 1. b. c

ICS214BNotes 1515 Later: T 1. aT 2 reads at c (not seeing T 1 );. b. cthen writes and commits at a, c Then c doesn’t see T1!

ICS214BNotes 1516 Solution Each node keeps list of committed transactions Whenever a new quorum is formed –Compare sequence numbers to see which node has the latest updates –All node apply latest updates –Then resume processing

ICS214BNotes 1517 Network Partitions: Summary No replicated data –abort, commit quorums Replicated data –at most one operational group  coterie  propagation of updates

ICS214BNotes 1518 Next: Transaction Processing Systems

ICS214BNotes 1519 Basic concepts Business Transactions –Real-world interaction On-line Transactions –execution of program that performs some function(s) of business transaction –steps:  get inputs  do work (access DB’s)  produce response

ICS214BNotes 1520 Example applications ATMs –E.g., 1 trans per minute per ATM  60 ATMs  1 trans/sec Stock exchange

ICS214BNotes 1521 Transaction Processing System (TPS) servers clients Presentation manager Presentation manager transaction programs workflow control resource managers

ICS214BNotes 1522 TP Monitor The “operating system” for the TPS Functions: –manage processes that run trans. programs –load balancing –commit distributed transactions –route requests from clients to servers –etc.

ICS214BNotes 1523 TP monitor architecture Presentation server Workflow controller Transaction server Transaction server Network manager queues …. requests net

ICS214BNotes 1524 Two-tier Three-tier Client database server presentation workflow transaction servers

ICS214BNotes 1525 transactional communications TP monitor = “glue” and “veneer” TP application programs operating system services communi- cation services database system services user interface services TP monitor API veneer... request routing 2 phase commit

ICS214BNotes 1526 TP monitor functions: presentation communication clients-servers workflow management commit coordination process management security queue management...

ICS214BNotes 1527 Presentation services user interaction constructing requests authentication communication logging

ICS214BNotes 1528 User interaction Fred Smith check-in reservation query = Go Airlines = agent: task: do it

ICS214BNotes 1529 Flight no: Passenger: Date =Check In = today Storm heading our way!! Announcements: Search for passenger

ICS214BNotes 1530 Old-fashioned approach for client Display menu box of screen Wait for user inputsend msg to server Code that does everything -----

ICS214BNotes 1531 Client using TP monitor services: Check in schema: Flight: ___ Date: ___ Do_check_in schema: Flight: ___ Date: ___ DISPLAY_FORM (CHECK_IN); some logic [no date validation?] SEND_REQ (DO_CHECK_IN); some logic (what next?)......

ICS214BNotes 1532 Data validation in forms Best done using cached copy of valid values OK for static values e.g.: product codes, flight numbers Not OK for dynamic values e.g.: seats left in plane; account balance do this validation at server (can access DB)

ICS214BNotes 1533 Authentication: 2 levels user clientserver Do I know/trust user? Do I know/trust client?

ICS214BNotes 1534 Process Management REQ client server code that does the work more code db ?

ICS214BNotes 1535 OS Solution client1 server clientX Code for all REQ’s process 1 process X db...  Problem: too many processes….. does not scale!

ICS214BNotes 1536 Old fashioned TP solution client1 server clientX db... - code for all REQ’s - threading implementation... single process: todo waiting

ICS214BNotes 1537  Problem: –complexity –need all application code in one process

ICS214BNotes 1538 Server processes client1 server clientX db... db code for req#1 code for req#2 workflow/ routing

ICS214BNotes 1539 Can be generalized: client1 clientX... db... db code for req#1 code for req#2 routing

ICS214BNotes 1540 Routing ? REQ Consider factors such as load balancing, failures…

ICS214BNotes 1541 do work NEXT: Inter-process communication router server process another process (eg DBMS) do work

ICS214BNotes 1542 Transactional RPC Transaction info (e.g., TRANS ID) is passed with calls Execution of server code becomes part of transaction client: start-trans call commit... server work... DB T 35 ( T 35 ) lock data for T 35 involve all resources for T 35

ICS214BNotes 1543 credit _card Example: client : start- trans pay_cc debit_bank commit... pay _cc work... debit _bank work accounts... T lock commit changes to credit_card and accounts

ICS214BNotes 1544 Fault tolerance in RPC Timeout: retry? give up? client: server : ____ work ____ call NO REPLY timeout: ??

ICS214BNotes 1545 Motivation for queues (a) server unavailable (b) server loses request clientserver clientserver ? req

ICS214BNotes 1546 client (c) client down (d) queues also useful for - load balancing - request priorities server ? req ans Motivation for queues

ICS214BNotes 1547 serverclient req queue enqueuedequeue other clients other servers (load balancing)

ICS214BNotes 1548 Trans#3: start_trans: dequeue (Q2) decode reply process output commi t client server Trans#1: start_trans: get inputs construct req enqueue (Q1) commit Trans#2: start_trans: dequeue (Q1); process req; enqueue (Q2); commit Q1: request queue Q2: reply queue

ICS214BNotes 1549 TP monitors and the web http web browser web server TP system daemon TP monitor client TP monitor protocol

ICS214BNotes 1550 Summary of TPS Architecture –Presentation services –Routing and workflow control –Process management Communication services –RPC –Queues