Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Chapter 1 Transactions and transactional properties.

Slides:



Advertisements
Similar presentations
1 Senn, Information Technology, 3 rd Edition © 2004 Pearson Prentice Hall James A. Senns Information Technology, 3 rd Edition Chapter 7 Enterprise Databases.
Advertisements

1 Concurrency: Deadlock and Starvation Chapter 6.
Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 2 Chapter 2 Model for transactions.
Universität Karlsruhe (TH) © 2007 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 9 Chapter 9 Distributed Transactions: Characteristics.
Universität Karlsruhe (TH) TAV 10© 2007 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. Böhm Chapter 10 Distributed Transactions: Synchronization.
Chapter 1: The Database Environment
Distributed Systems Architectures
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Transactional Workflow Chapter 9. © Jim Gray, Andreas Reuter Transaction Processing - Concepts and Techniques WICS August 2 - 6, What Is the Problem.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
UNITED NATIONS Shipment Details Report – January 2006.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Data recovery 1. 2 Recovery - introduction recovery restoring a system, after an error or failure, to a state that was previously known as correct have.
1 Term 2, 2004, Lecture 6, TransactionsMarian Ursu, Department of Computing, Goldsmiths College Transactions 3.
Database Systems: Design, Implementation, and Management
Week 2 The Object-Oriented Approach to Requirements
Testing Workflow Purpose
Distributed DBMS© M. T. Özsu & P. Valduriez Ch.10/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
VOORBLAD.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Lecture plan Transaction processing Concurrency control
Database System Concepts and Architecture
© 2012 National Heart Foundation of Australia. Slide 2.
Chapter 9: The Client/Server Database Environment
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Indra Budi Transaction Indra Budi
Executional Architecture
Global Analysis and Distributed Systems Software Architecture Lecture # 5-6.
DB analyzer utility An overview 1. DB Analyzer An application used to track discrepancies and other reports in Sanchay Post Constantly updated by SDC.
25 seconds left…...
Januar MDMDFSSMDMDFSSS
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Database Administration
PSSA Preparation.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
Chapter 16: Recovery System
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Transaction Processing IS698 Min Song. 2 What is a Transaction?  When an event in the real world changes the state of the enterprise, a transaction is.
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 2 Chapter 2 Model for transactions.
Chapter 9 Transaction Management and Concurrency Control
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
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.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 1) Academic Year 2014 Spring.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
Chapter 15 Recovery. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.15-2 Topics in this Chapter Transactions Transaction Recovery System.
Chapter 15: Transactions Loc Hoang CS 157B. Definition n A transaction is a discrete unit of work that must be completely processed or not processed at.
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Transaction Processing Concepts Muheet Ahmed Butt.
18 September 2008CIS 340 # 1 Last Covered (almost)(almost) Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using.
SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL.
Transactional Information Systems:
ACID PROPERTIES.
Transactional Information Systems:
Outline Introduction Background Distributed DBMS Architecture
Database Security Transactions
Lecture 20: Intro to Transactions & Logging II
Presentation transcript:

Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Chapter 1 Transactions and transactional properties

2 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 3-Tier Reference Architecture Stored Data (Pages) Data Server Application Server Clients Users... Application Program 1 Application Program 2... Objects encapsulated data exposed data RequestReply RequestReply © Weikum, Vossen, 2002

3 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 3-Tier Reference Architecture © Weikum, Vossen, 2002 Clients: presentation (GUI, Internet browser) Application server: business processes application programs (business objects, servlets) request brokering (TP monitor, ORB, Web server) based on middleware (CORBA, DCOM, EJB, SOAP, etc.) Data server: database / (ADT) object / document / mail / etc. servers Specialization to 2-Tier Client-Server Architecture: Client-server with fat clients (app on client + ODBC) Client-server with thin clients (app on server, e.g., stored proc)

4 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Process abstraction Stored Data (Pages) Data Server Application Server Clients Users... Application Program 1 Application Program 2... Objects encapsulated data exposed data RequestReply RequestReply © Weikum, Vossen, 2002 Business process Process step 4Process step 3Process step 2Process step 1Process step 5 Computing process Resource manager 1Resource manager 2Resource manager 3Resource manager 4

5 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Process abstraction Computing process 1 Resource manager 1 Process step 1 Resource manager 2Resource manager 3Resource manager 4 Process step 2Process step 3Process step 4 Process step 3Process step 2Process step 1Process step 5 Computing process 2 Business process 1 Business process 2

6 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Transactions (1) Computing process 1 Resource manager 1 Process step 1 Resource manager 2Resource manager 3Resource manager 4 Process step 2Process step 3Process step 4 Process step 3Process step 2Process step 1Process step 5 Computing process 2 Consistent Database transaction

7 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Transactions (2) Computing process 1 Resource manager 1 Process step 1 Resource manager 2Resource manager 3Resource manager 4 Process step 2Process step 3Process step 4 Process step 3Process step 2Process step 1Process step 5 Computing process 2 database transaction application transaction

8 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 ACID properties Aatomicity Cconsistency Iisolation Ddurability

9 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Consistency (1) Ideal: full and up-to-date agreement between database and miniworld semantic consistency min 100% Legitimate states as a result of executing operators while interpretating the database schema formal consistency Consistency constraints for further narrowing of the state space Transactional procedures Sequence of operations for procedural control of consistency

10 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 A transaction is consistent if upon termination it produced a consistent database state. Consistency (2) Database transaction (for short: transaction): Execution of a transactional procedure on a single database. A consequence: Consistency is only defined after completing the transaction. Application transaction: Consistent performance of a business process. A consequence: Coordination of several database transactions needed.

11 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 ACID properties Aatomicity Cconsistency Iisolation Ddurability

12 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Atomicity (1) Computing process 1 Resource manager 1 Process step 1 Resource manager 2Resource manager 3Resource manager 4 Process step 2Process step 3Process step 4 Process step 3Process step 2Process step 1Process step 5 Computing process 2 database transactions application transaction Persistency: The effect of a completed transaction cannot be lost again. Failure resilience: A transaction reaches a well-defined consistent state even in the presence of disturbances.

13 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 old consisten t database state successful transaction new consisten t database state Atomicity (2) persistent failed transaction in- consisten t database state volatile ?? consisten t database state persistent

14 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 old consisten t database state successful transaction new consisten t database state Atomicity (3) persistent failed transaction in- consisten t database state volatile ?? consisten t database state persistent persistency event : design a transactional procedure such that it will terminate once its results must no longer become obsolete. Examples of errors and failures: Incorrect input; programming errors; incorrect database management software; crashes of processor or memory hardware or of operating systems. Without failures the database is continuously updated.

15 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 old consisten t database state successful transaction new consisten t database state Atomicity (4) persistent failed transaction in- consisten t database state volatile Standard solution in case of failure. all- or- nothing A transaction is atomic if it has the all-or-nothing property.

16 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 ACID properties Aatomicity Cconsistency Iisolation Ddurability

17 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Computing process 1 Resource manager 1 Process step 1 Isolation (1) Resource manager 2Resource manager 3Resource manager 4 Process step 2Process step 3Process step 4 Process step 3Process step 2Process step 1Process step 5 Computing process 2 Threat to consistency: If several client transactions attempt to access the same resource concurrently (compete for the same resource) they may interact in undesirable ways: they are in conflict.

18 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Isolation (2) Needed: Synchronization protocol that avoids conflicts between concurrent and competing client transactions within a database management system (DBMS): conflict resilience. Correctness: Concurrent database transactions are correctly synchronized if each one proceeds as if there was no competition, that is, if the only inconsistencies visible to a client are those caused by its own transaction, and each transaction again reaches a persistent database state.

19 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 ACID properties Aatomicity Cconsistency Iisolation Ddurability

20 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Durability (1) Computing process 1 Resource manager 1 Process step 1 Resource manager 2Resource manager 3Resource manager 4 Process step 2Process step 3Process step 4 Process step 3Process step 2Process step 1Process step 5 Computing process 2 Durability: Survival in case of loss non-volatile data: Make sure that the effect of a transaction never gets lost. Persistency: Make sure on completion of a transaction that its effect cannot be lost.

21 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Durability (2) Problem: Storing data for an unlimited time makes consistency an even harder problem because of the increased probability of disturbances or failures occurring, with a concomitant corruption or complete loss of the data. Sample threats: Failures of peripheral storage, storage media or processors; external events such as fire, water, climate; aging of media with ensuing destruction of the database. Durability: Overcome loss by somehow restoring an earlier, still useful database state. Persistency is a prerequisite for durability.

22 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (1) Aatomicity Cconsistency Iisolation Ddurability Transaction: resilient execution of a consistent state transition (single operator or transactional procedure) with persistency of the final state. Design time: Transactional procedure: Sequence of primitive operations considered as a unit of consistency and resilience. Runtime: Transaction (TA): Execution of a transactional procedure, guaranteeing consistency and resilience. Transaction management (TM): control of a set of potentially overlapping transactions with guarantees for consistency and robustness for all of them, taking into account further factors such as performance.

23 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (2) Aatomicity Cconsistency Iisolation Ddurability Transaction: resilient execution of a consistent state transition (single operator or transactional procedure) with persistency of the final state. Design time: Transactional procedure: Sequence of primitive operations considered as a unit of consistency and resilience. Runtime: Transaction (TA): Execution of a transactional procedure, guaranteeing consistency and resilience.

24 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (3) Basic assumption: The transaction itself is responsible for local consistency: If undisturbed a transaction effects a consistent transition, i.e., results in a consistent database state provided it started from a consistent database state.

25 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (4) Aatomicity Cconsistency Iisolation Ddurability Transaction: resilient execution of a consistent state transition (single operator or transactional procedure) with persistency of the final state. Design time: Transactional procedure: Sequence of primitive operations considered as a unit of consistency and resilience. Runtime: Transaction (TA): Execution of a transactional procedure, guaranteeing consistency and resilience.

26 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (5) Recovery: Enforcement of persistency und failure resilience. Atomicity: The transaction shows an external effect only as a whole. Prior to successful completion there is no observable effect (transiency), after successful completion the effect is generally visible (persistency). Responsibilities: Persistency: Transaction has already completed. Failure resilience: Transaction has lost control. Prime responsibility lies with the recovery manager as part of database management.

27 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (6) Aatomicity Cconsistency Iisolation Ddurability Transaction: resilient execution of a consistent state transition (single operator or transactional procedure) with persistency of the final state. Design time: Transactional procedure: Sequence of primitive operations considered as a unit of consistency and resilience. Runtime: Transaction (TA): Execution of a transactional procedure, guaranteeing consistency and resilience.

28 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (7) Local consistency is not sufficient to guarantee database consistency in a set of concurrent and competing transactions. We must enforce global consistency by conflict resilience: Isolation: Concurrent transactions execute as if each would have its resources all by itself (no mixing of state transitions). Other concurrently executing transactions remain invisible to a given transaction. Responsibilities: Conflict resilience: Transaction does not know other transactions. The responsibility rests with the Scheduler as part of database management.

29 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (8) Aatomicity Cconsistency Iisolation Ddurability Transaction: resilient execution of a consistent state transition (single operator or transactional procedure) with persistency of the final state. Design time: Transactional procedure: Sequence of primitive operations considered as a unit of consistency and resilience. Runtime: Transaction (TA): Execution of a transactional procedure, guaranteeing consistency and resilience.

30 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 Responsibilities (9) Durability: Long-duration persistency : The effect of a successfully completed transaction is forever preserved unless it is explicitly renounced by a further transaction. Since the transaction does no longer exist after completion and may have occurred a long time ago, the responsibility can only rest with a separate system component (archive management).

31 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 System architecture Transaction 1Transaction 2... Transaction n Scheduler Database Manager Database Backup/Recovery Manager restart Archive Manager restore AtomicityDurability Consistency Isolation

32 © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 1 ACID good for all seasons? Useful for standard commercial applications where: transactions are independent and of short duration (e.g., debit/credit transactions), correctness requirements are high. Less useful for: cooperating applications (e.g., CAD): Strict isolation makes no sense in cooperative development (e.g., collaborative design of an automobile engine), because intermediate results should be shared by other engineers. long-lasting sessions (e.g., Internet reservations): For long- duration, resource-intensive transactions a complete undo of all work so far according to atomicity seems unacceptable.