3/6/99 1 Advanced Transaction Models CSE593 - Transaction Processing Philip A. Bernstein.

Slides:



Advertisements
Similar presentations
More About Transaction Management Chapter 10. Contents Transactions that Read Uncommitted Data View Serializability Resolving Deadlocks Distributed Databases.
Advertisements

Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 5: Tree-based Concurrency Control and Validation Currency Control Professor.
COS 461 Fall 1997 Transaction Processing u normal systems lose their state when they crash u many applications need better behavior u today’s topic: how.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. –Because disk accesses are.
Data and Database Administration Chapter 12. Outline What is Concurrency Control? Background Serializability  Locking mechanisms.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Transactions and Locking Rose-Hulman Institute of Technology Curt Clifton.
Distributed Systems Fall 2010 Transactions and concurrency control.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Chapter 15 Transaction Management. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Transaction basics Concurrency.
Transaction Management and Concurrency Control
Database management concepts Database Management Systems (DBMS) An example of a database (relational) Database schema (e.g. relational) Data independence.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
1 ACID Properties of Transactions Chapter Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
Transaction Management
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
ICS (062)CC in Adv. DB Applications1 Concurrency Control in Advanced Database Applications Dr. Muhammad Shafique 31 March 2007.
© 1998 Singh & Huhns1 Database Integration. © 1998 Singh & Huhns2 Dimensions of Integration Existence of global schema Location transparency: same view.
Transaction Management and Concurrency Control
TRANSACTION PROCESSING TECHNIQUES BY SON NGUYEN VIJAY RAO.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
4/25/ Application Server Issues for the Project CSEP 545 Transaction Processing for E-Commerce Philip A. Bernstein Copyright ©2003 Philip A. Bernstein.
AXML Transactions Debmalya Biswas. 16th AprSEIW Transactions A transaction can be considered as a group of operations encapsulated by the operations.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Transaction Communications Yi Sun. Outline Transaction ACID Property Distributed transaction Two phase commit protocol Nested transaction.
TRANSACTIONS. Objectives Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction.
Distributed Transactions
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
Concurrency Control in Database Operating Systems.
5/22/ Business Process Management CSEP 545 Transaction Processing Philip A. Bernstein Copyright ©2007 Philip A. Bernstein.
1 Concurrency Control II: Locking and Isolation Levels.
 Distributed file systems having transaction facility need to support distributed transaction service.  A distributed transaction service is an extension.
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
Lecture 13 Advanced Transaction Models. 2 Protocols considered so far are suitable for types of transactions that arise in traditional business applications,
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Module 11: Managing Transactions and Locks
2/28/ Queued Transaction Processing CSE593 Transaction Processing Philip A. Bernstein Copyright ©2001 Philip A. Bernstein.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Synchronization CSCI 4900/6900. Transactions Protects data and allows processes to access and modify multiple data items as a single atomic transaction.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
1 Concurrency Control. 2 Why Have Concurrent Processes? v Better transaction throughput, response time v Done via better utilization of resources: –While.
Business Process Execution Language (BPEL) Pınar Tekin.
6. Application Server Issues for the Project
Transaction Management and Concurrency Control
Transaction Management
Database management concepts
Transaction Management
Chapter 10 Transaction Management and Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Transaction Processing Concepts
Database Security Transactions
Database management concepts
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Transaction management
Transaction Management
Transaction Management Overview
Presentation transcript:

3/6/99 1 Advanced Transaction Models CSE593 - Transaction Processing Philip A. Bernstein

3/6/99 2 Outline 1. Introduction 2. Multi-transaction Requests 3. Nested Transactions 4. A Quick Research Survey

3/6/ Introduction For over 15 years, people have investigated how to extend the transaction abstraction to broaden its applicability Most of this work is still at the research stage or has undergone limited commercial deployment Still, it’s worth understanding where the technology is headed

3/6/ Multi-Transaction Requests Some requests cannot execute as one transaction because –it executes too long (causing lock contention) or –Resources don’t support a compatible 2-phase commit protocol. Transaction may run too long because –It requires display I/O with user –People or machines are unavailable (hotel reservation system, manager who approves the request) –It requires long-running real-world actions (get 2 estimates before settling an insurance claim) –Subsystems’ transactions must be ACID (placing an order, scheduling a shipment, reporting commission)

3/6/99 5 Workflow A multi-transaction request is called a workflow Specialized workflow products are being offered. –IBM Flowmark, Action, JetForm, Wang/Kodak,... They have special features, such as –flowgraph language for describing processes consisting of steps, with preconditions for moving between steps –representation of organizational structure and roles (manual step can be performed by a person in a role, with complex role resolution procedure) –tracing of steps, locating in-flight workflows –ad hoc workflow, integrated with (case mgmt)

3/6/99 6 Managing Workflow with Queues Each workflow step is a request Send the request to the queue of the server that can process the request Server outputs request(s) for the next step(s) of the workflow Submit expense claim Validate claim Get Manager Approval Authorize Payment Request Automatic Deposit notification

3/6/99 7 Workflows Can Violate Atomicity and Isolation Since a workflow runs as many transactions, –it may not be serializable relative to other workflows –it may not be all-or-nothing Consider a money transfer run as 2 txns, T 1 & T 2 –Conflicting money transfers could run between T 1 & T 2 –A failure after T 1 might prevent T 2 from running –These problems require application-specific logic –E.g. T 2 must send ack to T 1 ’s node. If T 1 ’s node times out waiting for the ack, it takes action, possibly compensating for T 1

3/6/99 8 Automated Compensation In a workflow specification, for each step, identify a compensation. Specification is called a saga. If a workflow stops making progress, run compensations for all committed steps, in reverse order (like txn abort). Need to ensure that each compensation’s input is available (e.g. log it) and that it definitely can run (enforce constraints until workflow completes). Concept is still at the research stage.

3/6/99 9 Pseudo-conversations A conversational transaction interacts with its user during its execution. Since this is long-running, it should run as multiple requests Since there are exactly two participants, just pass the request back and forth –request carries all workflow context –request is recoverable, e.g. send/receive is logged or request is stored in shared disk area This is a simpler mechanism than queues

3/6/99 10 Fault Tolerance By Logging Device I/O Consider a transaction all of whose operations are undoable. Log all of the transaction’s interaction with the outside world. If the transaction fails, replay it. During the replay, –get input from the log –validate that output is identical to what was logged. –If the output diverges from the log, then start asking for live input (and the ignore rest of the log). A variation of this is used by Digital’s RTR

3/6/ Nested Transactions All important concepts in computer science are recursive – why not transactions? –Transactions can have subtransactions, which can have subtransactions, etc. Nested transactions generalize savepoints –Savepoints allow sequential transactions to be backed out partially … the work between two savepoints is a subtransaction –Nested transactions allow a tree of concurrent transactions where each subtransaction can be aborted

3/6/99 12 Nested Transaction Rules Each transaction or subtransaction is bracketed by Start and Commit or Abort. If a program is not executing a transaction, then Start creates a new top-level transaction If a program is executing inside a transaction, then Start creates a subtransaction. Example - BookTrip is a top-level transaction –It calls three subroutines, BookFlight, BookCar, BookHotel, each of which is bracketed by Start and Commit/Abort and thus executes as a subtransaction.

3/6/99 13 Nested Transaction Rules (cont’d) Commit and Abort by a top-level transaction have the usual semantics If a subtransaction aborts, then all of its operations and subtransactions are undone. Until it commits, a subtransaction’s updated data items are only visible to its subtransactions After a subtransaction S commits, S’s updates are visible to other subtransactions of S’s parent. –E.g. After BookFlight commits, its updates are visible to BookCar and BookHotel, but not before it commits.

3/6/99 14 Nested Transaction Semantics Top-level transactions are like flat transactions. –They’re ACID and bracketed by Start, Commit, Abort. Subtransaction abort is a new feature. Subtransactions of the same parent are isolated from one another (= SR w.r.t. one another)

3/6/99 15 Applications Not as many as you’d think … Allows you to construct ACID operations out of ACI components A good abstraction for OO applications –Objects call sub-objects –Interesting language integration in Argus [Liskov 88] A good abstraction for parallel DB systems –Can decompose an operation into ACI sub-operations

3/6/99 16 Implementation Each resource manager accessed by a nested transaction needs special capabilities –Subtransaction start - so it knows which operations are relevant to a given subtransaction –Each operation on the RM must have the subtransaction’s transaction identifier –Subtransaction abort - to undo updates of a given subtransaction –Subtransaction commit - to make its updated data visible to other subtransactions (subtransaction’s parent inherits its locks)

3/6/99 17 Implementation (cont’d) Implementation of subtransaction abort affects the logging algorithm and 2-phase commit implementation

3/6/99 18 Multi-Level Transactions Nested transactions with a twist: –Each subtransaction “type” has an associated undo action To abort a transaction, you –undo the transaction’s atomic operations –undo its committed subtransactions –abort its active subtransactions Useful for multi-step DB system operations, e.g. –B-tree splits –operations that update a record and an index

3/6/99 19 Commercial Support Nested transactions were a hot research topic in the early-mid 1980’s, but has not caught on (yet) in products. Transarc’s Encina TP monitor supports nested transactions, with some Transarc RMs. No commercial DB systems support nested transactions. No standard 2-phase commit protocols support it.

3/6/ A Quick Research Survey There is a big research literature in extended transaction models. It comes roughly in 4 flavors –active databases –workflow models –design transaction models –theoretical models

3/6/99 21 Active Databases SQL systems support triggers –consists of a predicate (WHERE clause) and action –attach it to certain operations on a table (INSERT, DELETE, UPDATE) –when the operation runs, check which triggers’ predicates are true and run them Generalization is Event-Condition-Action rules This is a foundational mechanism for multi-txn requests, since it encapsulates declarative behavior about how txns can affect one another.

3/6/99 22 Workflow Models There are proposals for combinations of dataflow programs and atomicity models (compensation, preconditions for next steps, recoverability) E.g. ConTract model [Wachter, Reuter] –workflow state information after each (transaction) step is recoverable –after a failure, active workflows can be reinstantiated and continue running –stores database invariants to ensure workflow is forward recoverable

3/6/99 23 Design Transactions Concurrent design activities between designers must be coordinated. Transaction models for this application usually break the ACID rules. I find them unappealing. My preferred model uses versioned configurations –Configuration contains a set of related design objects that must be mutually consistent. –Designer checks out a set of objects to a workspace configuration (maybe incrementally). –When finished, the set of objects is checked back into a new version of the shared configuration (this is atomic w.r.t. other check-ins)

3/6/99 24 Design Transactions (cont’d) –If the configuration version changed since the designer’s original checkout, then the checkin must merge conflicting results. (Essentially, optimistic locking fails. Rather than abort, you merge the inconsistent updates) –Workspace configuration represents the long transaction C1 C2 C3 W AL W Sue checkout checkin merge

3/6/99 25 Theoretical Models Define dependencies between transactions (that comprise a larger atomic unit) –commit dependency - if T 1 and T 2 both commit, then T 1 commits first –strong commit dependency - if T 1 commits, then T 2 commits –abort dependency, termination dependency, …. Two good models for this –ACTA [Chrysanthis, Ramamritham] –temporal logic and finite automata [Klein] Can write axiomatic definitions of txn models using dependencies, maybe leading to implementations.