Title: Real-Time Database: Scheduling and Concurrency Control
1Real-Time Database Scheduling and Concurrency
Control
2Paper 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
3Paper Sources (2)
- Scheduling Real-Time Transactions A Performance
Evaluation - Performance comparison paper
- Admission Control
- Scheduling
- Concurrency Control
- Main memory based vs. Disk based Database
4Database and Real-Time (1)
- Traditional Database
- Data Consistency
- Transaction Serializability
- Traditional Concurrency Control mechanisms
- Locking based
- Timestamp Ordering
- Serialization Graph
5Database 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
6Preliminary 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
7Preliminary about RTDB (2)
- Problems with RT-database
- hard to predict execution time
- Hard to predict data access requirement
- I/O
- Integration with Concurrency Control
8Preliminary 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
9Data Consistency (1)
- External Consistency
- Relationship between data and the real world
- Temporal Consistency
- Relationship between data
10Data Consistency (2)
- Periodic updates
- Convert consistency metrics into upper lower
bounds for update transaction periods - Trading serializability for external consistency
11Data Consistency (3)
- Transaction Compatibility Table (TCT)
- Better for pre-run-time analysis
- Epsilon Serializability (ESR)
- Limited degree of inconsistency
12Concurrency Control (1)
- Conflict Detection
- Conflict Resolution
- Serialization Rule and Order
- Run Policy
13Concurrency 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
14Concurrency 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
15Concurrency 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
16Concurrency 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
17Concurrency Control (6)
- Run Policy
- Buffer Retention effect
- Different Concurrency Control schemes could be
applied to the first-run and rerun transactions
18Scheduling 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
19Scheduling RT Transactions (2)
- How to solve the problem?
- Priority
- Priority from the scheduling point of view
- A mapping problem
- EDF
- Weighted Priority
20Scheduling 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.
21Scheduling 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)
22Scheduling 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
23Scheduling 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
24Performance 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
25Performance Evaluation (2)
- System model
- Single processor
- Disk-based database
- Main memory buffer
- High Workload
- Transaction model
- Release time r
- Deadline d
- Runtime estimate e
26Performance Evaluation (3)
- Database Model
- Page-based granularity
- Promise Serializability
- Locking mechanism
- No write-back to disk when abort
27Performance 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
28Performance Evaluation (5)
- Priority Assignment
- deadline vs. service
- First Come First Serve (FCFS)
- Earliest Deadline (ED)
- Least Slack (LS)
- Static evaluation
- Continuous Evaluation
29Performance 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
30Performance Evaluation (7)
31Result 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
32Result 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
- E0 (WP)
- EgtgtR (HP)
33Result 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
34Result 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