Transactional Information Systems:

Slides:



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

Database Architectures and the Web
Chapter 6 E-commerce Payment Systems. Traditional Payment Systems Cash Checking Transfers Credit Card Accounts Stored Value Accounts Accumulating Balance.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Concurrency Control and Recovery In real life: users access the database concurrently, and systems crash. Concurrent access to the database also improves.
Distributed Systems Architectures
Chapter 13 Physical Architecture Layer Design
1 Transaction Management Overview Yanlei Diao UMass Amherst March 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Ch 12 Distributed Systems Architectures
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction n Why Database Systems? n Data Models n Data Definition Language.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
COMP 5138 Relational Database Management Systems Semester 2, 2007 Lecture 8A Transaction Concept.
INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 21 (6/E) CHAPTER 17 (5/E)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Transaction Management: Concurrency Control CS634 Class 16, Apr 2, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Slide 1 Physical Architecture Layer Design Chapter 13.
Transactions. 421B: Database Systems - Transactions 2 Transaction Processing q Most of the information systems in businesses are transaction based (databases.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 9B Doing Business in the Online World.
Faculty of Computer & Information
DISTRIBUTED COMPUTING Introduction Dr. Yingwu Zhu.
Database Design – Lecture 18 Client/Server, Data Warehouse and E-Commerce Database Design.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
History & Motivations –RDBMS History & Motivations (cont’d) … … Concurrent Access Handling Failures Shared Data User.
Transaction Processing Concepts Muheet Ahmed Butt.
What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently and safely. Provide.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chap 1. What Is It All About? 정강수.
CS 325 Spring ‘09 Chapter 1 Goals:
Transactional Information Systems:
Contents. Goal and Overview. Ingredients. The Page Model.
On-Line Transaction Processing
Multimedia Laboratory
Database Architectures and the Web
Chapter 1: Introduction
Transactional Information Systems - Chapter 2. ML Lab 나 용 찬
Doing Business in the Online World
Computational Models Database Lab Minji Jo.
Chapter 1: Introduction
Chap 1. What is it all About ??
Transactional Information Systems:
Introduction to NewSQL
Database Architectures and the Web
McGraw-Hill Technology Education
CS122B: Projects in Databases and Web Applications Winter 2018
Transactional Information Systems:
Introduction to Databases Transparencies
Transactions.
Outline Introduction Background Distributed DBMS Architecture
What Should a DBMS Do? How will we do all this??
Transaction Processing Concepts
Transactional Information Systems:
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Lecture 13: Transactions in SQL
Lecture 20: Intro to Transactions & Logging II
Chapter 1: Introduction
Transactional Information Systems:
Chapter 17: Application Recovery
ECT455 Website Engineering
Chapter 1: Introduction
Chapter 1: Introduction
Transactional Information Systems:
Chapter 1: Introduction
Transactional Information Systems:
Chapter 1: Introduction
CS122B: Projects in Databases and Web Applications Winter 2019
CS122B: Projects in Databases and Web Applications Spring 2018
Lecture 11: Transactions in SQL
Presentation transcript:

Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery Gerhard Weikum and Gottfried Vossen © 2002 Morgan Kaufmann ISBN 1-55860-508-8 “Teamwork is essential. It allows you to blame someone else.”(Anonymous) 12/15/2017 Transactional Information Systems

Part I: Background and Motivation 1 What Is It All About? 2 Computational Models 12/15/2017 Transactional Information Systems

Chapter 1: What Is It All About? 1.2 Application Examples 1.3 System Paradigms 1.4 Virtues of Transactions 1.5 Architecture of Database Servers 1.6 Lessons Learned “If I had had more time, I could written you a shorter letter” (Blaise Pascal) 12/15/2017 Transactional Information Systems

Transactional Information Systems Application Examples OLTP, e.g., funds transfer E-commerce, e.g., Internet book store Workflow, e.g., travel planning & booking 12/15/2017 Transactional Information Systems

OLTP Example: Debit/Credit void main ( ) { EXEC SQL BEGIN DECLARE SECTION int b /*balance*/, a /*accountid*/, amount; EXEC SQL END DECLARE SECTION; /* read user input */ scanf (“%d %d”, &a, &amount); /* read account balance */ EXEC SQL Select Balance into :b From Account Where Account_Id = :a; /* add amount (positive for debit, negative for credit) */ b = b + amount; /* write account balance back into database */ EXEC SQL Update Account Set Balance = :b Where Account_Id = :a; EXEC SQL Commit Work; } Bank operation: traditional teller or home PC with Internet access or credit card reader at a merchant or a cyber cash carrier 12/15/2017 Transactional Information Systems

OLTP Example 1.1: Concurrent Executions P1 Time P2 Select Balance Into :b1 From Account 1 Where Account_Id = :a /* b1=0, a.Balance=100, b2=0 */ Select Balance Into :b2 2 From Account /* b1=100, a.Balance=100, b2=100 */ b1 = b1-50 3 /* b1=50, a.Balance=100, b2=100 */ 4 b2 = b2 +100 /* b1=50, a.Balance=100, b2=200 */ Update Account Set Balance = :b1 5 /* b1=50, a.Balance=50, b2=200 */ 6 Set Balance = :b2 /* b1=50, a.Balance=200, b2=200 */ Should have been 150 Observation: concurrency or parallelism may cause inconsistencies, requires concurrency control for “isolation” 12/15/2017 Transactional Information Systems

OLTP Example 1.2: Funds Transfer void main ( ) { /* read user input */ scanf (“%d %d %d”, &sourceid, &targetid, &amount); /* subtract amount from source account */ EXEC SQL Update Account Set Balance = Balance - :amount Where Account_Id = :sourceid; /* add amount to target account */ Set Balance = Balance + :amount Where Account_Id = :targetid; EXEC SQL Commit Work; } Observation: failures may cause inconsistencies, require recovery for “atomicity” and “durability” 12/15/2017 Transactional Information Systems

Transactional Information Systems E-Commerce Example Shopping at Internet book store: client connects to the book store's server and starts browsing and querying the store's catalog client fills electronic shopping cart upon check-out client makes decision on items to purchase client provides information for definitive order (including credit card or cyber cash info) merchant's server forwards payment info to customer's bank credit or card company or cyber cash clearinghouse when payment is accepted, shipping of ordered items is initiated by the merchant's server and client is notified Observations: distributed, heterogeneous system with general information/document/mail servers and transactional effects on persistent data and messages Last shopping step: it should all happen or none of it 12/15/2017 Transactional Information Systems

Transactional Information Systems Workflow Example Workflows are (the computerized part of) business processes, consisting of a set of (automated or intellectual) activities with specified control and data flow between them (e.g., specified as a state chart or Petri net) Conference travel planning: Select a conference, based on subject, program, time, and place. If no suitable conference is found, then the process is terminated. Check out the cost of the trip to this conference. Check out the registration fee for the conference. Compare total cost of attending the conference to allowed budget, and decide to attend only if the cost is within the budget. Observations: activities spawn transactions on information servers, workflow state must be failure-resilient, long-lived workflows are not isolated 12/15/2017 Transactional Information Systems

Example: Travel Planning Workflow CheckConfFee / Budget:=1000; Trials:=1; Go Select Conference Select Tutorials Compute Fee [Cost  Budget] / Cost = ConfFee + TravelCost Check Cost [ConfFound] / Cost:=0 Check Áirfare [Cost > Budget & Trials  3] [!ConfFound] Check Hotel No CheckTravelCost [Cost > Budget & Trials < 3] / Trials++ 12/15/2017 Transactional Information Systems

Transactional Information Systems Introduction Application Examples System Paradigms Virtues of Transactions Architecture of Database Servers Lessons Learned “If I had had more time, I could written you a shorter letter” (Blaise Pascal) 12/15/2017 Transactional Information Systems

3-Tier System Architectures Clients: presentation (GUI, Internet browser) Application server: 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) 12/15/2017 Transactional Information Systems

3-Tier Reference Architecture Stored Data (Pages) Server Application Clients Users . . . Program 1 Program 2 ... Objects encapsulated data exposed Request Reply 12/15/2017 Transactional Information Systems

Transactional Information Systems System Federations Data Servers Application Clients Users . . . ... 12/15/2017 Transactional Information Systems

Transactional Information Systems Introduction Application Examples System Paradigms Virtues of Transactions Architecture of Database Servers Lessons Learned “If I had had more time, I could written you a shorter letter” (Blaise Pascal) 12/15/2017 Transactional Information Systems

ACID Properties of Transactions Atomicity: all-or-nothing effect, simple (but not completely transparent) failure handling Consistency-preservation: transaction abort upon consistency violation Isolation: only consistent data visible as if single-user mode, concurrency is masked to app developers Durability (persistence): committed effects are failure-resilient Transaction programming interface (“ACID contract”) begin transaction commit transaction (“commit work” in SQL) rollback transaction (“rollback work” in SQL) 12/15/2017 Transactional Information Systems

Requirements on Transactional Servers Server components: Concurrency Control guarantees isolation Recovery: guarantees atomicity and durability Performance: high throughput (committed transactions per second) short response time Reliability: (almost) never lose data despite failures Availability: very short downtime almost continuous, 24x7, service 12/15/2017 Transactional Information Systems

Transactional Information Systems Introduction Application Examples System Paradigms Virtues of Transactions Architecture of Database Servers Lessons Learned “If I had had more time, I could written you a shorter letter” (Blaise Pascal) 12/15/2017 Transactional Information Systems

Database System Layers Server Clients . . . Requests Language & Interface Layer Query Decomposition & Optimization Layer Query Execution Layer Access Layer Storage Layer Data Accesses Request Execution Threads 12/15/2017 Transactional Information Systems

Transactional Information Systems Storage Structures Database Extent Table Page Page Header Slot Array Ben 55 Las Vegas ... Sue 23 Seattle Joe 29 San Antonio free space forwarding RID --- Extents 12/15/2017 Transactional Information Systems

Transactional Information Systems Access Structures Adam Bill Dick Eve Hank Jane Bob Jill Tom Root Node Leaf Nodes RIDs B+-tree Search tree interface: lookup <index> where <indexed field> = <search key> lookup <index> where <indexed field> between <lower bound> and <higher bound> 12/15/2017 Transactional Information Systems

Transactional Information Systems Query Execution Plans Select Name, City, Zipcode, Street From Person Where Age < 30 And City = "Austin" Index Scan on CityIndex RID Access Fetch Person Record Filtering Projection Index Scan on AgeIndex on CityIndex RID List Intersection RID Access Fetch Person Record Projection 12/15/2017 Transactional Information Systems

Transactional Information Systems Introduction Application Examples System Paradigms Virtues of Transactions Architecture of Database Servers Lessons Learned “If I had had more time, I could written you a shorter letter” (Blaise Pascal) 12/15/2017 Transactional Information Systems

Transactional Information Systems Lessons Learned Benefits of ACID contract: For users: federation-wide data consistency For application developers: ease of programming Server obligations: Concurrency control Recovery 12/15/2017 Transactional Information Systems