360 likes | 586 Views
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).
E N D
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) • Scheduling Real-Time Transactions: A Performance Evaluation • Performance comparison paper • Admission Control • Scheduling • Concurrency Control • Main memory based vs. Disk based Database
Database and Real-Time (1) • Traditional Database • Data Consistency • Transaction Serializability • Traditional Concurrency Control mechanisms • Locking based • Timestamp Ordering • Serialization Graph
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
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
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
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
Data Consistency (1) • External Consistency • Relationship between data and the real world • Temporal Consistency • Relationship between data
Data Consistency (2) • Periodic updates • Convert consistency metrics into upper & lower bounds for update transaction periods • Trading serializability for external consistency
Data Consistency (3) • Transaction Compatibility Table (TCT) • Better for pre-run-time analysis • Epsilon Serializability (ESR) • Limited degree of inconsistency
Concurrency Control (1) • Conflict Detection • Conflict Resolution • Serialization Rule and Order • Run Policy
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
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
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
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
Concurrency Control (6) • Run Policy • Buffer Retention effect • Different Concurrency Control schemes could be applied to the first-run and rerun transactions
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
Scheduling RT Transactions (2) • How to solve the problem? • Priority • Priority from the scheduling point of view • A mapping problem • EDF • Weighted Priority
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.
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)
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
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
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
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
Performance Evaluation (3) • Database Model • Page-based granularity • Promise Serializability • Locking mechanism • No write-back to disk when abort
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
Performance Evaluation (5) • Priority Assignment • deadline vs. service • First Come First Serve (FCFS) • Earliest Deadline (ED) • Least Slack (LS) • Static evaluation • Continuous Evaluation
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
Performance Evaluation (7) • Simulation Model
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
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)
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
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