1 / 16

Concurrency Control

Concurrency Control. Overview of Database Concurrency Control. Lecture Objectives. Learn the basic concepts associated with concurrency control in a relational database environment. Learn about serial and serializable schedules. Learn the basic concurrency control protocols

ailis
Download Presentation

Concurrency Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Concurrency Control Overview of Database Concurrency Control BACS 485—Database Management Concurrency Control

  2. Lecture Objectives • Learn the basic concepts associated with concurrency control in a relational database environment. • Learn about serial and serializable schedules. • Learn the basic concurrency control protocols • Learn the basics of locks and timestamps as there are used in concurrency control. BACS 485—Database Management Concurrency Control

  3. Concurrency Background • Modern databases gain their usefulness by sharing data among many users. • The cost of sharing data is concurrency problems. • Modern DBMSs deal with concurrency problems by controlling the interaction among users to maintain database consistency (integrity). BACS 485—Database Management Concurrency Control

  4. Concurrency Background • There are 5 basic background concepts related to concurrency control: • Multiprogramming • Data Sharing • Concurrent access vs. integrity conflict • Transactions • Levels of concurrency control BACS 485—Database Management Concurrency Control

  5. Multiprogramming • Multiprogramming is the process of interleaving (shuffling) the operations of several programs in order to better utilize the system resources. • By quickly switching “contexts”, the illusion of simultaneous execution is possible on a single CPU computer. BACS 485—Database Management Concurrency Control

  6. Data Sharing • Database systems share data to reduce redundancy and gain better control through centralization. • Shared data that is dynamic (i.e., update, insert, delete) causes concurrency problems in database environments. • Strictly “read only” shared data does not cause concurrency problems. BACS 485—Database Management Concurrency Control

  7. Concurrency vs. Integrity • There is a conflict between total concurrent data access and database integrity. • The more concurrency that takes place, the potentially worse the integrity. • Conversely, the better the integrity, the less concurrency is possible. • The goal is to achieve a reasonable balance. BACS 485—Database Management Concurrency Control

  8. Transactions • Transactions are a logical unit of work in the database. • By executing transactions, the database moves from one consistent state to another. • Transactions are important is several areas of database theory (including concurrency). BACS 485—Database Management Concurrency Control

  9. Transactions • Good transactions have the following characteristics: • Atomic – performed totally or not at all • Consistency preservation – consistent state is maintained before and after the transaction is executed. • Permanence – Changes that are “committed” are permanent. They cannot be lost. • Isolation – Transaction updates should not be visible outside of the transaction. • Serializability – Running interleaved transactions should produce the same result as running them in some serial order. BACS 485—Database Management Concurrency Control

  10. Levels of Control • The concurrency mechanisms that will be discussed in this slide set apply to multiple levels of the database. • Specifically, they can apply to: • Data-item level • Tuple level • Table level • Extent level • Full database BACS 485—Database Management Concurrency Control

  11. Uncontrolled Concurrency • Uncontrolled concurrency implies that the transactions are interleaved randomly. • This causes 3 classic problems: • Lost update problem • Temporary update problem • Incorrect summary problem BACS 485—Database Management Concurrency Control

  12. Lost Update Problem BACS 485—Database Management Concurrency Control

  13. Temporary Update Problem BACS 485—Database Management Concurrency Control

  14. Incorrect Summary Problem BACS 485—Database Management Concurrency Control

  15. How do you avoid these problems? • You can avoid the problems of uncontrolled concurrency by generating “serializable schedules.” • A “schedule” is a plan for transaction execution. • A “serial schedule” is one where there is no concurrency (one transaction after another). • A serializable schedule is one that allows instruction interleaving while still giving serial schedule results. BACS 486—Advanced Database Management Concurrency Control

  16. Locks and Protocols • Types of simple Locks • Exclusive Locks • Shared Locks (read locks) • Update Locks • Lock Problems • Deadlock • Livelock BACS 486—Advanced Database Management Concurrency Control

More Related