Brief
Communication
Incorporating
real-time
scheduling
methods
into
database
management systems
Özgür
Ulusoy
Bilkent
University,
Ankara,Turkey
Received 14 January 1995
Revised 15
February
1995Abstract.
Many
databaseapplications
today
are characterisedby
therequirement
oftimely
access to data. Thisrequirement
leads to an
increasing
trend towardsadapting
real-timescheduling techniques
to the management of data accessrequests. In this paper, we summarise and stimulate
devel-opments of
time-cognisant
scheduling techniques
for data-base management systems. Inparticular,
we reviewbriefly
the methods used in
mapping timing
constraints oftrans-actions into
priorities,
and thepriority-based protocols
used for concurrency control. We also suggest useful directionsfor future research.
1.
Introduction
An
increasing
number of databaseapplications today
are characterised
by
therequirement
to access andmanipulate
data in atimely
manner.Among
thoseapplication
areas are information retrievalsystems,
computer-integrated manufacturing,
airlinereserva-tion
systems,
stockmarket,
banking,
and commandand control
systems.
Asopposed
to conventionaldata-base
management systems
(DBMSs),
the DBMS of suchapplications
notonly
has to maintain theconsistency
of the
underlying
database,
but alsosatisfy
timing
constraints associated with transactions. Consider a
transaction that is executed in a stock market to
update
the database with new information. The transaction needs to
satisfy
certaintiming
constraints to ensure thatthe database contains an accurate
representation
of thecurrent market
[1].
As anotherexample,
a transactionmay be executed to learn the
price
of aparticular
stock.The result of the transaction should return as
quickly
aspossible
since theprices
canchange
veryquickly.
The
major
challenge posed
to the researchers is toadapt
real-timescheduling
methods to DBMSs.However, the
scheduling algorithms
used in real-timesystems
assume ingeneral
apriori
knowledge
aboutthe characteristics of transactions, such as arrival time,
data/resource access
pattern,
worst case executiontime, etc.
Thus,
it ispredictable
whether the time constraints of a transaction can be satisfied. In adata-base
system,
on the otherhand,
there exist a numberof sources of
unpredictability
[7].
(1)
Transactionsmight
haveconflicting
accesses ondata and hardware resources. Access conflicts
usually
lead toblocking
of transactions.(2)
The executionpath
of a transaction isdependent
on the current values of data.(3)
Delay
due todynamic
paging
and I/Omight
beexperienced.
(4)
To maintain databaseconsistency,
itmight
be necessary to abort and later restart atransac-tion.
All these factors make it
virtually impossible
topredict
computation
times of database transactions.As a
result,
real-timescheduling
methods cannot bedirectly applied
to databasesystems.
However, it isquite
possible
to use some ideas from real-timesched-uling
inextending
traditional databasemanagement
techniques
to observetiming
constraints oftrans-actions.
Correspondence
to: Dr O.Ulusoy,
Department
ofComputer
Engineering
and Information Science, BilkentUniversity,
Bilkent, Ankara 06533,
Turkey.
Fax: +90 312 266 4126.Our
goal
in this paper is to summarise and stimu-latedevelopments
oftime-cognisant
transactionsched-uling techniques
in DBMSs. We outlineapproaches
tovarious
aspects
ofprocessing
transactions that areassociated with
timing
constraints. We alsosuggest
useful directions for future progress.Throughout
the paper, weexplain
theconcepts
at an intuitive, ratherthan at a detailed
technical,
level. The next sectionprovides
an examination of methods used inmapping
timing
constraints of transactions intopriorities.
Section 3 discussespriority-based
concurrency controltechniques
that control the interaction amongconcur-rently
executing
transactions tosatisfy
both theconsis-tency
requirement
of the database and thetiming
constraints of transactions. Section 4
provides
someconcluding
remarks. 2.Priority assignment
The
timing
constraint of a transactiontypically
takesthe form of a deadline. The deadline of a transaction indicates that it is
required
tocomplete
the transaction before a certain time in the future. Atypical
categori-sation of transactions concerns the strictness of the
deadlines
assigned.
o Hard deadline transactions are associated with
strict deadlines and the correctness of transaction
operations
depends
on the time at which the results areproduced
[12].
Thesystem
mustprovide
schedules thatguarantee
deadlines.o
Soft
deadline transactions are scheduled based ontheir
deadlines,
and satisfaction of deadlines is still animportant
performance goal
inscheduling
transactions;
however,
in this case, there is noguarantee
that all deadlines will be met. A softdeadline transaction is executed until
completion,
regardless
of whether its deadline hasexpired
ornot.
9 Firm deadline transactions also do not carry strict
deadlines,
i.e.missing
a deadline may not resultin a
catastrophe,
but,
unlike soft deadlinetransac-tions,
they
are abortedby
thesystem
once theirdeadlines
expire. Typically,
no value will beimparted
to thesystem
if a firm deadlinetransac-tion misses its deadline.
Processing
hard deadline transactions in a databasesystem
isgenerally
considered to be infeasiblebe-cause, as we discussed
earlier,
it is difficult topredict
computation
times and thus toprovide
schedules thatguarantee
deadlines. Real-worldexamples
ofapplica-tions
supporting
soft or firm deadline transactions areprovided
in[1].
Banking
systems
and airline-reserva-tionsystems
usually
process soft deadlinetransac-tions. When a customer submits a transaction, if the
system
cannotgenerate
a response to the transactionwithin its
deadline,
the customerprefers
getting
the response late to notgetting
it at all. Stock markettrading
is anexample
ofapplications
supporting
firmdeadline transactions.
If,
for instance, a transaction issubmitted to learn the current
price
of aparticular
stock,
thesystem
should either return the result in aspecified
timeperiod
or notperform
theoperation
atall,
because conditions in the stock market canchange
very
quickly.
As stated
before,
one of theprimary
scheduling
goals
inprocessing
time-constrained transactions is to meet transaction deadlines. The scheduler thusassigns
a
priority
to each transaction based on its deadline. Two of the mostpopular
priority assignment
schemes based on transaction deadlines are:(1)
earliest deadlinefirst
(EDF):
a transaction with anearlier deadline has
higher
priority
than atrans-action with a later
deadline;
(2)
least slackfirst
(LSF):
the slack time of atransac-tion is defined as the maximum
length
of time thetransaction can be
delayed
and stillsatisfy
itsdeadline. The LSF
policy assigns
thehighest
priority
to the transaction with the least slack time. When a transaction T arrives at thesystem,
its slack time STT can be evaluated
using
thefollowing
formula:where
DT, ATT,
andET
denote
thedeadline,
the arrival time, and the estimated execution time oftransaction T,
respectively.
The LSFpolicy
assumes that each transaction
provides
itsexecu-tion time estimate. The
dynamic
version of the LSF deadlineassignment
schemerequires
the evaluation of transactionpriorities
at eachdeci-sion
point
[6].
LetPTT
and STT(t)
denote theprocessing
timespent
so farby
T and the slacktime of T at time t,
respectively.
The slack time ofT at decision
point
t can be determinedby
thefollowing
formula:The EDF
policy
isusually preferred
to LSF becausethe estimate of execution times is often unavailable for database transactions.
Some
applications
mayassign
different values totransactions, where the val ue of a transaction reflects
transaction is
completed
before its deadline[4].
Thescheduling goal
for suchapplications
is to maximise the value realisedby
thecompleted
transactions. Somealgorithms
wereprovided
to establish apriority
ordering
among transactions that aredistinguished by
both values and deadlines
[2, 4].
A range of trade-offsbetween value and deadline has been covered in those
algorithms.
One commonalgorithm
gives
equal
weight
to deadline and value in
determining
thepriority
of transactions. Thepriority
PT
of
transaction T isspeci-fied
by
PT = V/D~.,
whereV
denotes
the value oftrans-action T. A variation of this
algorithm
uses the relativedeadline instead of the absolute deadline in
assigning
priorities.
The relative deadline is defined as thedifference of the transaction deadline and the
trans-action arrival time, i.e.
PT =
~/D~ - ~7~.
3.
Time-cognisant
concurrency
control
If the transactions
processed
in a databasesystem
areassociated with
deadlines,
implementation
ofconcur-rency control
protocols
in thatsystem
is difficult dueto the
conflicting
requirements
ofmeeting
deadlines andmaintaining
dataconsistency. Concurrency
controlprotocols proposed
so far to preserve dataconsistency
in conventional databasesystems
are allbased on transaction
blocking
and transaction restart, which makes it difficult tosatisfy
deadlines.Thus,
aneed has arisen for
developing
concurrency controlprotocols
that take thetiming
constraints into account whilescheduling
transactions. Somescheduling
tech-niques
have been borrowed from real-timesystems
tobe used in
developing
suchprotocols.
There is a
growing
literature aboutdevelopment/
evaluation of
time-cognisant
concurrency controlprotocols
for databasesystems
(e.g.
[1,
3, 5, 9,13]).
In this section, wegive
an overview of theprotocols
available in the literature.In a lock-based concurrency control
protocol,
asitu-ation that needs to be
carefully
handled ispriority
inversion.Priority
inversion can be defined asuncon-trolled
blocking
ofhigh
priority
transactionsby
lowerpriority
transactions[8].
Two mainapproaches
havebeen
pursued
to solve thepriority
inversionproblem:
priority
inheritance(PI)
andpriority
abort(PA).
They
are both
time-cognisant
extensions of the conventionaltwo-phase locking
(2PL)
protocol.
Variations of theseapproaches
have been the basis for the other lock-based concurrency controlprotocols.
PI,
proposed by
Sha et al.[9],
ensures that when atransaction blocks
higher
priority
transactions, it isexecuted at the
highest
priority
of the blockedtrans-actions ; in other
words,
it inherits thehighest
priority.
Due to the inheritedpriority,
the transaction can beexecuted
faster,
resulting
in reducedblocking
times forhigh
priority
transactions.PA
prevents
priority
inversionby aborting
lowpriority
transactions whenever necessary[1].
Inresolv-ing
a data lockconflict,
if the transactionrequesting
the lock hashigher
priority
than the transaction that holds thelock,
the latter transaction is aborted and the lock isgranted
to the former one.Otherwise,
thelock-requesting
transaction is blockedby
thehigher
priority
lock-holding
transaction. Ahigh
priority
transactionnever waits for a lower
priority
transaction. Thiscondition
prevents
deadlocks if we assume that thereal-time
priority
of a transaction does notchange
during
its lifetime and that no two transactions havethe same
priority.
Huang
et al.[5]
developed
a combinedpriority
abortand
priority
inheritanceprotocol,
called conditionalpriority
inheritance,
tocapitalise
on theadvantages
ofboth schemes. The
protocol
attempts
to reduce theblocking
times withrespect
to PI, and to reduce theabort rate with
respect
to PA. When a transaction T isblocked
by
a lowerpriority
transactionT’,
if T’ is nearcompletion,
it inherits thepriority
of T;otherwise,
T’ is aborted. Theprotocol
assumes that thelength
of atransaction
(i.e.
the number of data items accessedby
the
transaction)
is known in advance. Theprotocol
hasa threshold
parameter
h. At the time of a dataconflict,
if the
remaining
number of data items to be accessedby
thelock-holding
transaction is less than orequal
to threshold
h,
then PI isapplied;
otherwise,
PA is used.An extension to PI is the
priority
ceiling protocol
which bounds theblocking
time ofhigh
priority
trans-actions to no more than one transaction execution time
[9, 10].
It eliminates the deadlockproblem
from PI andattempts
to reduce theblocking delays
ofhigh
priority
transactions. The
’priority
ceiling’
of a data item isdefined as the
priority
of thehighest
priority
transac-tion that may have a lock on that item. In order to
obtain a lock on a data item, the
protocol
requires
that a transaction T must have apriority
strictly higher
than the
highest
priority
ceiling
of data items lockedby
the transactions other than T.Otherwise,
transac-tion T is blocked
by
the transaction which holds the lock on the data item of thehighest priority
ceiling.
In a more recent
work,
weprovided
a newconcur-rency control
protocol,
calleddata-priority-based
locking
protocol,
to prove that the real-timelocking protocol,
can be furtherimproved
if the dataaccess
requirements
of transactions are known inadvance
[13].
Similar to thepriority
ceiling protocol,
theproposed protocol
is based onprioritising
dataitems;
each data item carries apriority
equal
to thehighest
priority
of all transactionscurrently
in thesystem
that include the data item in their access lists.In order to obtain a lock on a data item D, the
priority
of a transaction T must beequal
to thepriority
of D. Otherwise(if
thepriority
of T is less than that ofD),
transaction T is blocked
by
the transaction that isresponsible
for thepriority
of D.Some variants of the
optimistic
concurrency controlprotocol
have also beendeveloped
and evaluated for time-criticalapplications.
Haritsa et al.developed
anoptimistic
protocol,
called WAIT-50, which allows for the use ofpriorities
toimprove
decisionmaking
inresolving
conflicts[3].
Theprotocol
uses a ’50 percent’ rule as follows: the validation check for a
committing
transaction isperformed
against
the other active transactions. If a conflict exists and half or moreof the transactions
conflicting
with thecommitting
transaction are ofhigher
priority,
the transaction ismade to wait for the
high
priority
transactions tocomplete;
otherwise,
it is allowed to commit while theconflicting
transactions are aborted.The
priority
inversionproblem
that was defined forlocking
protocols
can also exist in asystem
that main-tains dataconsistency
through
use of atime-stamp-ordering
concurrency controlprotocol.
It ispossible
that ahigh
priority
transaction T is aborted at itsaccess to a data item, since a lower
priority
transac-tion
T ;
carrying
atime-stamp higher
than thetime-stamp
of T, has accessed that data itempreviously.
Weproposed
atime-cognisant
concurrency controlprotocol
thatattempts
to control thepriority
inversionproblem
of thetime-stamp-ordering
scheme[13].
Thenew
protocol categorises
the transactions intotime-stamp
groups based on their arrival times. The time isdivided into intervals of a certain
length
and thetrans-actions that arrive at the
system
within the sameinterval are
placed
in the sametime-stamp
group. Thebasic idea is to schedule the transactions of the same
time-stamp
group based on their real-timepriorities.
Each transaction is
assigned
a two-leveltime-stamp
made up of a group
time-stamp
and a real-timetime-stamp.
The transactions within the sametime-stamp
group are
assigned
the same grouptime-stamp
whichis the arrival time of the first transaction in that group. Real-time
time-stamps
of transactions within the samegroup are determined based on the real-time
priorities
of transactions. The transaction with the
highest
priority
obtains thelargest
real-timetime-stamp,
so itcannot be aborted
by
any other transaction in the samegroup in the case of a data access conflict.
An extensive
exploration
of the issues inconcur-rency control and other
time-cognisant
scheduling
concepts,
such as buffermanagement,
I/Oscheduling,
commitment, etc, is
provided
in[14].
4.
Discussion
There is a
growing
interest inapplying
theprinciples
and
techniques
of real-timescheduling
to transactionmanagement
in DBMSs.Today,
manyapplication
areas
supported by
a DBMS(e.g.
information retrievalsystems,
airline reservationsystems,
stockmarket,
banking,
etc)
are characterisedby
therequirement
oftimely
access to theunderlying
database. In addition tomaintaining
databaseconsistency,
an essentialscheduling goal
in thoseapplications
is tosatisfy
timing
constraints associated with transactionsaccessing
the database.In this paper, we introduced the research efforts in
time-constrained transaction
scheduling.
Webriefly
reviewed the basic methods used inmapping
timing
constraints of transactions intopriorities
and thepriority-based
concurrency controltechniques
proposed
to control the interaction amongconcur-rently
executing
transactions. We believethat,
although
some progress has been made towards thedevelopment
oftime-cognisant
concurrency controlprotocols,
moregeneral empirical
work needs to beperformed
to demonstrate thepracticality
of thoseprotocols.
As a final
remark,
main memory databases areexpected
to beeconomically
feasible in the nearfuture,
due tofalling
memoryprices
andgrowing
memory sizes
[11].
Withmemory-resident
databases,
transaction execution time will become morepredictable,
and thus theadaptation
of real-timescheduling techniques
to DBMSs will become much easier. Trends in thetechnology
of main memorysuggest
that research for the time-critical databasemanagement
should be focused more on main memorydatabase
systems.
Acknowledgement
This work was
supported by
TUBITAK under grant numberReferences
[1] R. Abbott and H. Garcia-Molina,
Scheduling
real-timetransactions: a
performance
evaluation, ACMTrans-actions on Database
Systems
17 (1992) 513-560.[2] J. R. Haritsa, M. J. Carey and M.
Livny,
Value-BasedScheduling
in Real-Time DatabaseSystems
(TR-1204)(Department
ofComputer
Science, University ofWisconsin-Madison, 1991).
[3] J. R. Haritsa, M. J. Carey and M. Livny, Data access
scheduling
in firm real-time database systems,Real-Time
Systems
4 (1992) 203-241.[4] J.
Huang,
J. A. Stankovic, D.Towsley
and K.Ramamritham,
Experimental
evaluation of real-time transactionprocessing.
In:Proceedings of
the 10th Real-TimeSystems Symposium
(1989) pp. 144-153.[5] J.
Huang,
J. A. Stankovic, K. Ramamritham, D.Towsley
and B. Purimetla, Priority inheritance in soft real-timedatabases, Real-Time
Systems
4 (1992) 243-268.[6] E. D. Jensen, C. D. Locke and H. Tokuda, A time-driven
scheduling
model for real-timeoperating
systems. In:Proceedings of
the 6th Real-TimeSystems Symposium
(1985) pp. 112-122.
[7] K. Ramamritham, Real-time databases, International
Journal of
Distributed and Parallel Databases 1 (1993)199-216.
[8] L. Sha, R.
Rajkumar
and J.Lehoczky,
Concurrency
control for distributed real-time databases, ACM SIGMOD Record 17 (1988) 82-98.[9] L. Sha, R.
Rajkumar
and J.Lehoczky,
Priorityinheri-tance
protocols:
anapproach
to real-timesynchroniza-tion, IEEE Transaction on
Computers
39 (1990)1175-1185.
[10] L. Sha, R.
Rajkumar,
S. H. Son and C. H.Chang,
Areal-time
locking protocol,
IEEE Transactions onComputers
40 (1991) 793-800.
[11] M.
Singhal,
Issues andapproaches
todesign
ofreal-time database systems, ACM SIGMOD Record 17 (1988)
19-33.
[12] J. A. Stankovic and W. Zhao, On real-time transactions,
ACM SIGMOD Record 17 (1988) 4-18.
[13] Ö.
Ulusoy
and G. G. Belford, Real-time transactionscheduling
in database systems,Information Systems
18 (1993) 559-580.
[14] Ö.