Title: View Updates
1View Updates Temporal Correctness in Soft
Real-Time Database Systems
Oral Defence by Cheng Chun Kong (MPhil.,
HKUCSIS) Supervised by Dr. B.C.M. Kao 10th
August, 2000.
2Contents
- Problems Studied
- Updates Recomputations
- Temporal Correctness
- Transaction Scheduling
- Performance Study
- Future Work
3 I Problems Studied
4Real-Time Database Systems (RTDB)
- A database system with time constraints
- Transactions can be associated with time
constraints e.g., deadlines - Refresh database items to reflect the external
world.
5Examples of RTDB
- Cellular Phone Network
- Threat Analysis System
- Programmed Stock Trading
6Example Programmed Stock Trading
- Monitoring stocks financial instruments
- On discovering an opportunity, a trading
transaction is performed. - The transaction becomes useless if it misses the
deadline.
7System Model
Monitor
Dynamic Environment
Base Data
Views
8Timing Requirements of Application Transactions
- Transaction Timeliness How fast a transaction is
completed - Can a transaction finish before its deadline?
- Data Timeliness How fresh the data is
- Stale data is less useful to a transaction
9The 2 Requirements Conflict!
- Updates Recomputations applied promptly to
satisfy data timeliness. - They are very heavy loads.
- Transactions get little share of system
resources. - This hurts transaction timeliness.
10Problems Studied in this Thesis
- Understand Updates, Recoms Transactions
- Balancing the 2 timing requirements by redefining
Temporal Correctness - Design scheduling algorithms so that temporal
correctness is enforced
11II Updates Recomputations
12Properties of Updates
- Based on Adelberg, Garcia-Molina Kaos work
Applying Update Streams in a Soft RTDB in ACM
SIGMOD 1995.
13Properties of Updates
- Updates arrive at a very high rate
- In the US market, 500 stock updates per second.
- An update need not be given full transactional
support. - Use a single update process to install updates
14Properties of Recomputations
- Based on Adelberg, Garcia-Molina Kaos work,
Database Support for Efficiently Maintaining
Derived Data in EDBT 1996.
15Fan-in and Fan-out
High Fan-out
High Fan-in
16Batching
- A technique for alleviating the heavy recom load
- A recom request is not served immediately.
- It sleeps for a small amount of time.
- During the sleep period, any recoms for the same
item are batched into a single recom.
17Implications
- Updates Recoms are heavy burdens.
- Need special techniques e.g., batching
- These techniques need to be integrated into the
scheduling protocols.
18III Temporal Correctness
19Temporal Correctness
- Absolute Consistency (AC)
- A data item timely reflects the state of an
external object. - Relative Consistency (RC)
- A set of data items with values reflecting the
states of the external objects at the same time
instant.
20AC and RC An Example
A1
A2
time
A
B1
B2
time
B
Current Time
- A2 and B2 are AC. They are also RC.
- (A1 , B1) and (A1 , B2) are RC pairs.
- A2 and B1 are NOT consistent pairs.
21Temporal Correctness from Transactions Point of
View
- Keeping an AC/RC database is difficult.
- We can extend temporal consistency from the
transactions perspective. - Can much reduce the update/recomputation
required.
22Defining AC/RC from the Perspective of a
Transaction
Database containing 1000 items
23Instantaneous System
- An ideal system which applies updates/recoms as
soon as they arrive, taking zero time to do it. - A measure of correctness of real systems.
24Real System - ACS
- A transaction is given the values of all objects
it reads such that - these values can be found in an instantaneous
system at the commit time. - No transactions can read old or inconsistent data.
25Real System - RCS
- Can we relax data timeliness?
- Allow transactions to read slightly old data.
- The set of values read by a transaction can be
found in an instantaneous system not older than
transactions start time - ?.
26ACS vs RCS An Example
A1
time
A
time
B
time
T
commit
start
- Readset of T in ACS (A2, B1)
- Readset of T in RCS (A1, B1), (A2, B1)
27Advantages of RCS over ACS
- In ACS, an incoming update/recom can abort a
transaction due to data conflicts - In RCS, a transaction will not suffer from this
problem. - Freshness is sacrificed for fewer transaction
aborts.
28IV Transaction Scheduling
29Schedulers for ACS and RCS
- URT
- Updates and Recoms first, Transactions later
- OD
- On Demand Triggering of Updates Recoms
- OD-H
- No transactions URT
- Otherwise, OD
30Implementing the Schedulers
- Concurrency control
- ACS HP-2PL
- RCS Multi-version Concurrency Control
- OD manager for OD
- Version manager for RCS
31Implementing the Schedulers
- Batching
- No transaction should read the view while its
recomputation is sleeping. - Lock the view before sleeping.
32V Performance Study
33Effect of Transaction Arrival Rate (ACS)
34Comparing URT, OD OD-H
35Effect of Transaction Arrival Rate (ACS RCS)
36Effect of Transaction Arrival Rate(OD-H/ACS vs
OD-H/RCS)
37Comparing ACS and RCS
- All 3 policies under RCS perform significantly
better than ACS. - 2 drawbacks of RCS
- Use of older versions.
- More complex to implement.
38VI Conclusions
39Conclusions
- We studied how temporal correctness can be
incorporated into an RTDB. - We defined temporal consistency from the
perspective of transactions.
40Conclusions
- The data timeliness of ACS is too strict.
- It has a high transaction miss rate.
- RCS is less strict.
- It has a smaller transaction miss rate.
41Conclusions
- We studied how URT, OD and OD-H should be
implemented for ACS. - OD-H when applied to an RCS results in the
smallest transaction miss rate.
42Logical vs Temporal Correctness
Logical Correctness
Temporal Correctness
43Future Work
- Version selection problem in an RCS
- If the readset of a transaction is known before
its execution, the performance of RCS may be
improved. - The simulation model can be expanded from single
processor and single disk, to multiple processors
and multiple disks.
44Q A Session