CSC314 Day 16 Transaction processing Concurrency Control 1.

Slides:



Advertisements
Similar presentations
Chapter 11: Data and Database Administration
Advertisements

Chapter 11: data and Database Administration
Data and Database Administration Chapter 12. Outline What is Concurrency Control? Background Serializability  Locking mechanisms.
© 2005 by Prentice Hall 1 Chapter 12: Data and Database Administration Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Database Administration Chapter Six DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Transaction Management and Concurrency Control
10 1 Chapter 10 Transaction Management and Concurrency Control Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 9 Managing Multi- User.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Data and Database Administration
DBMS Functions Data, Storage, Retrieval, and Update
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 18.
© 2007 by Prentice Hall 1 Chapter 12: Data and Database Administration Modern Database Management 8 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Chapter 9 Transaction Management and Concurrency Control
IS 4420 Database Fundamentals Chapter 12: Data and Database Administration Leon Chen.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction Management and Concurrency Control
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13: Data and Database Administration Modern Database Management 9 th Edition Jeffrey.
1 © Prentice Hall, 2002 Chapter 12: Data and Database Administration Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 11: Data and Database Administration Modern Database Management 10 h Edition Jeffrey.
Recovery & Concurrency Control. What is a Transaction?  A transaction is a logical unit of work that must be either entirely completed or aborted. 
Security and Transaction Nhi Tran CS 157B - Dr. Lee Fall, 2003.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z. Yang Course Website: 3220m.htm
1 IT420: Database Management and Organization Session Control Managing Multi-user Databases 24 March 2006 Adina Crăiniceanu
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
Concurrency Control. Objectives Management of Databases Concurrency Control Database Recovery Database Security Database Administration.
© 2002 by Prentice Hall 1 Database Administration David M. Kroenke Database Concepts 1e Chapter 6 6.
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
Data & Database Administration
1 Chapter 12: Data and Database Administration Modern Database Management Jeffrey A. Hoffer, Mary B. Prescott, Fred R. McFadden.
XA Transactions.
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall 6-1 Chapter Objectives Understand the need for and importance of database.
Chapter 20 Transaction Management Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation and Management, 4 th Edition,
Chapter 11 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 11: data and Database Administration Modern Database Management 11 th Edition.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Transaction Processing Concepts
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Transaction Management and Concurrent Control
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
10 Transaction Management and Concurrency Control MIS 304 Winter 2005.
©Bob Godfrey, 2002, 2005 Lecture 17: Transaction Integrity and Concurrency BSA206 Database Management Systems.
3 Database Systems: Design, Implementation, and Management CHAPTER 9 Transaction Management and Concurrency Control.
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 13: Data and Database Administration Modern Database Management 9 th Edition Jeffrey.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Copyright © 2016 Pearson Education, Inc. CHAPTER 12: DATA AND DATABASE ADMINISTRATION Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman,
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
Chapter 12: Data and Database Administration
Transaction Management and Concurrency Control
Chapter 12: Data and Database Administration
Transaction Management
Transaction Properties
Chapter 12: Data and Database Administration
Database Processing: David M. Kroenke’s Chapter Nine: Part One
Chapter 10 Transaction Management and Concurrency Control
Chapter 12: Data and Database Administration
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Database Administration
Presentation transcript:

CSC314 Day 16 Transaction processing Concurrency Control 1

Transaction ACID Properties Atomic – Transaction cannot be subdivided Consistent – Constraints don’t change from before transaction to after transaction Isolated – Database changes not revealed to users until after transaction has completed Durable – Database changes are permanent 2

3 Figure 11-9 Basic recovery techniques a) Rollback 3 Chapter 11 © 2013 Pearson Education, Inc. Publishing as Prentice Hall

4 Figure 11-9 Basic recovery techniques (cont.) b) Rollforward 4 Chapter 11 © 2013 Pearson Education, Inc. Publishing as Prentice Hall

5

Control concurrent Access  Problem–in a multi-user environment, simultaneous access to data can result in interference and data loss (lost update problem) Concurrency Control  Solution–Concurrency Control  The process of managing simultaneous operations against a database so that data integrity is maintained and the operations do not interfere with each other in a multi-user environment 6

7 Figure Lost update (no concurrency control in effect) Simultaneous access causes updates to cancel each other. A similar problem is the inconsistent read problem.

Concurrency Control Techniques Serializability – Finish one transaction before starting another Locking Mechanisms – The most common way of achieving serialization – Data that is retrieved for the purpose of updating is locked for the updater – No other user can perform update until unlocked 8

9 Figure 11-11: Updates with locking (concurrency control) This prevents the lost update problem 9 Chapter 11 © 2013 Pearson Education, Inc. Publishing as Prentice Hall

Locking Mechanisms Locking level: – Database–used during database updates – Table–used for bulk updates – Block or page–very commonly used – Record–only requested row; fairly commonly used – Field–requires significant overhead; impractical Types of locks: – Shared lock–Read but no update permitted. Used when just reading to prevent another user from placing an exclusive lock on the record – Exclusive lock–No access permitted. Used when preparing to update 10

Deadlock An impasse that results when two or more transactions have locked common resources, and each waits for the other to unlock their resources 11 Figure The problem of deadlock John and Marsha will wait forever for each other to release their locked resources!

Managing Deadlock Deadlock prevention: – Lock all records required at the beginning of a transaction – Two-phase locking protocol Growing phase Shrinking phase – May be difficult to determine all needed resources in advance Deadlock Resolution: – Allow deadlocks to occur – Mechanisms for detecting and breaking them Resource usage matrix 12

Versioning Optimistic approach to concurrency control Instead of locking Assumption is that simultaneous updates will be infrequent Each transaction can attempt an update as it wishes The system will reject an update when it senses a conflict Use of rollback and commit for this 13

14 Figure The use of versioning Better performance than locking 14 Chapter 11 © 2013 Pearson Education, Inc. Publishing as Prentice Hall

Data Dictionaries and Repositories Data dictionary – Documents data elements of a database System catalog – System-created database that describes all database objects Information Repository – Stores metadata describing data and data processing resources Information Repository Dictionary System (IRDS) – Software tool managing/controlling access to information repository 15

16 Figure Three components of the repository system architecture A schema of the repository information Software that manages the repository objects Where repository objects are stored Source: based on Bernstein, Chapter 11 © 2013 Pearson Education, Inc. Publishing as Prentice Hall

Database Performance Tuning  DBMS Installation  Setting installation parameters  Memory and Storage Space Usage  Set cache levels  Choose background processes  Data archiving  Input/output (I/O) Contention  Use striping  Distribution of heavily accessed files  CPU Usage – Monitor CPU load  Application tuning  Modification of SQL code in applications  Use of heartbeat queries 17

Cost of Downtime 18 Downtime is expensive

Data Availability How to ensure availability – Hardware failures–provide redundancy for fault tolerance – Loss of data–database mirroring – Human error–standard operating procedures, training, documentation – Maintenance downtime–automated and non- disruptive maintenance utilities – Network problems–careful traffic monitoring, firewalls, and routers 19