1 / 34

Real-Time Database: Scheduling and Concurrency Control

Real-Time Database: Scheduling and Concurrency Control. Paper Sources (1). On Real-Time Databases: Concurrency Control and Scheduling Survey paper Traditional Database Concurrency Control RTDB Scheduling and Concurrency Control New semantics for RTDB. Paper Sources (2).

tadhg
Download Presentation

Real-Time Database: Scheduling and 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. Real-Time Database: Scheduling and Concurrency Control

  2. Paper Sources (1) • On Real-Time Databases: Concurrency Control and Scheduling • Survey paper • Traditional Database Concurrency Control • RTDB Scheduling and Concurrency Control • New semantics for RTDB

  3. Paper Sources (2) • Scheduling Real-Time Transactions: A Performance Evaluation • Performance comparison paper • Admission Control • Scheduling • Concurrency Control • Main memory based vs. Disk based Database

  4. Database and Real-Time (1) • Traditional Database • Data Consistency • Transaction Serializability • Traditional Concurrency Control mechanisms • Locking based • Timestamp Ordering • Serialization Graph

  5. Database and Real-Time (2) • Real-Time System • Hard real-time • Soft real-time • Scheduling Algorithms • Earliest Deadline First (ED) • Least Slack Time (LS) • First Come First Serve (FCFS) • Others

  6. Preliminary about RTDB (1) • Difference between traditional database and RTDB • Constraints on data items • Constraints on transactions • Different performance goals • Different correctness definition • Difference between other real-time system and RTDB • Data consistency • Predictability of data requirement

  7. Preliminary about RTDB (2) • Problems with RT-database • hard to predict execution time • Hard to predict data access requirement • I/O • Integration with Concurrency Control

  8. Preliminary about RTDB (3) • Hard Real-time System • Special requirements • Guarantee to meet deadlines • Possible solutions • Advanced knowledge of resource and data requirement • Relaxed serializability requirement • Relaxed data consistency requirement

  9. Data Consistency (1) • External Consistency • Relationship between data and the real world • Temporal Consistency • Relationship between data

  10. Data Consistency (2) • Periodic updates • Convert consistency metrics into upper & lower bounds for update transaction periods • Trading serializability for external consistency

  11. Data Consistency (3) • Transaction Compatibility Table (TCT) • Better for pre-run-time analysis • Epsilon Serializability (ESR) • Limited degree of inconsistency

  12. Concurrency Control (1) • Conflict Detection • Conflict Resolution • Serialization Rule and Order • Run Policy

  13. Concurrency Control (2) • Conflict Detection • Lock-based scheme • This is the CC scheme most RTDBs use • Read lock, Write lock and Weak lock • Granularity of locks • Timestamp Ordering • Serialization Graph

  14. Concurrency Control (3) • Conflict Resolution • Choices: • blocking, abort, multiversioning,, dynamically adjusting the serialization order • 2PL and Variations • Wait or Abort? • With or without Priority? • Cascading blocking • Multiversioning • Two versions • Multiversions

  15. Concurrency Control (4) • Conflict Resolution • OCC and variations • Resource waste • Pure OCC: delayed abort • Broadcast OCC: immediate abort • Combination of OCC and 2PL • Locking with Deferred Blocking (LDB) • Nonblocking phase and blocking phase

  16. Concurrency Control (5) • Serialization Rule and Order • With or without readjusting serialization order? • Start time order: TSC • Completion time order: OCC • Access order: 2PL • Dynamic order: Dynamic timestamp allocation, Timestamp interval allocation • A mixed read-write behavior • Time-stamp History

  17. Concurrency Control (6) • Run Policy • Buffer Retention effect • Different Concurrency Control schemes could be applied to the first-run and rerun transactions

  18. Scheduling RT Transactions (1) • Old methods fit new scenario? • Locking mechanisms • Timestamp Ordering • OCC • Conflict! • Single conflict • Conflict with a set • Fairness! • Long transactions • Almost finished transactions

  19. Scheduling RT Transactions (2) • How to solve the problem? • Priority • Priority from the scheduling point of view • A mapping problem • EDF • Weighted Priority

  20. Scheduling RT Transactions (3) • Locking Mechanisms • Priority Inversion • Priority Inheritance • Priority Ceiling • Convex Ceiling • 2PL with High Priority (2PL-HP) • Conditional Priority Inheritance (CPI) • Other Mechanisms • OCC, Multiversioning, etc.

  21. Scheduling RT Transactions (4) • Interaction between system load and scheduling • Lower load situation • EDF • High load situation • LS • Adaptive Earliest Deadline (AED) • Adaptive Earliest Virtual Deadline (AEVD)

  22. Scheduling RT Transactions (5) • I/O Issues in RTDB • Disk Access Scheduling • Elevator Scan • EDF • Combination of two mechanisms • Read/Write policy • Non-deferred Write • Deferred Write

  23. Scheduling RT Transactions (6) • Run Policy • Prefetching • First Run • Get all the data into main memory • Estimation • Second Run • Interaction with other re-run transactions • Interaction with first-run transactions

  24. Performance Evaluation (1) • Evaluation Metrics • Overload management • AE/ NT/ FD • Priority Assignment • FCFS/ ED/ LS • Concurrency Control • W/ WP/ HP/ CR • I/O Scheduling • FIFO/ P

  25. Performance Evaluation (2) • System model • Single processor • Disk-based database • Main memory buffer • High Workload • Transaction model • Release time r • Deadline d • Runtime estimate e

  26. Performance Evaluation (3) • Database Model • Page-based granularity • Promise Serializability • Locking mechanism • No write-back to disk when abort

  27. Performance Evaluation (4) • Overload Management • Observant vs. Predictive • All Eligible (AE) • Not Tardy (NT) • Feasible Deadlines (FD) • I/O Scheduling • First In First Out (FIFO) • Priority

  28. Performance Evaluation (5) • Priority Assignment • deadline vs. service • First Come First Serve (FCFS) • Earliest Deadline (ED) • Least Slack (LS) • Static evaluation • Continuous Evaluation

  29. Performance Evaluation (6) • Concurrency Control • Priority Inversion • Wait or Abort • Wait (W) • Wait Promote (WP) • High Priority (HP) • Conditional Restart (CR) • One-to-one conflict assumption

  30. Performance Evaluation (7) • Simulation Model

  31. Result for Memory-Resident DB (1) • For Priority Assignments • ED performs better at lower load • LS performs better at higher load • LS permits a greater degree of concurrency than ED • However, higher concurrency might lead to more lock conflicts

  32. Result for Memory-Resident DB (2) • Run Time Estimation Error • Random • Biased • For overload management: FD • For priority policy: LS • Static evaluation • Dynamic evaluation • For concurrency control: CR • E=0 (WP) • E>>R (HP)

  33. Result for Memory-Resident DB (3) • Other points • Importance of overload management • WP and CR matches LS well • HP causes too many aborts at high load • LS/W and LS/HP are more sensitive to rate of conflict • Cost of restart

  34. Result for Disk-Resident DB • Consistent with MM experiment results • Priority inheritance preferred • For Sudden Workload Increase, ED/HP is the best • Effect of memory size

More Related