chapter 2 proposed framework with concurrency...
Post on 04-Sep-2019
4 Views
Preview:
TRANSCRIPT
14
CHAPTER 2
PROPOSED FRAMEWORK WITH CONCURRENCY
CONTROL AND CACHE MANAGEMENT TECHNIQUES
Transactions run in the MH can access and manipulate public data
items. The data items in the database are accessed through a DS which is
connected to a static PDN. However, direct data access from the DS increases
response time and server load. Caching is a process of keeping copies of
remote data items in a permanent storage to improve data availability, access
time and response time. Caching strategy reduces network overhead and load
on DS.
When caches are loaded with duplicated data items that are fetched
from the DS, the cache management strategy should ensure co-ordination of
access to the cached data, preservation of cache consistency and effective
replacement of the cached data. The cache consistency preservation technique
should ensure that the cached copy of the data item is consistent with the
original copy in the database. To avoid access to stale data, IR is generated by
the DS, when the original copy of the data item is updated. IR contains the
identities of the data items that are updated.
Due to constrained memory size, the cached data should be
efficiently replaced to make room for new data items that are to be cached.
The cache replacement policy should be efficient enough to improve cache hit
ratio. When the cached data item is shared between number of concurrent
transactions from different MHs, the concurrent access is made to the cached
15
data item. Concurrent access to the shared data item must be properly
controlled to preserve data integrity.
The thesis proposes an efficient framework that serializes the
transactions to ensure concurrency control and effectively manages the cache
to facilitate concurrent transaction execution in mobile wireless environment.
2.1 PROPOSED FRAMEWORK FOR CONCURRENT
TRANSACTION EXECUTION
The proposed framework improves concurrent transaction execution
with cache management strategies to support cache consistency preservation
and effective cache replacement when compared with existing AVI approach.
It also supports recovery of failed or interrupted transactions.
2.1.1 Structure of the Framework
The proposed framework is shown in Figure 2.1. In the proposed
framework for concurrent transaction management, transactions are run in
MHs. Transactions that access the shared data item are also called as affiliated
transactions.
Figure 2.1 Framework for Concurrent Transaction Execution
RDR or UDR / Reply
Recovery Status
Log Entry
MOBILE HOSTBASE STATION
CACHE
CACHE
MANAGER
RECOVERY
MANAGER
LOCAL LOG
LOG MANAGER
TRANSACTION
BASE STATION CONTROLLER
PERMANENT LOG
16
Cache is stored in the BS of the mobile data network. In all existing
caching strategies, the cache is loaded in the MH, which allows the affiliated
mobile transactions to manipulate the shared data item independently. It may
lead to increased transaction ‘restart’ rate when the shared data item is
updated. In the proposed caching strategy, independent execution in the MHs
is co-ordinated and ‘restart’ rate is reduced. Cache Manager (CM), a software
upgrade, is loaded in the BS to co-ordinate access to the shared data item. It
also manages cache with consistency preservation scheme and replacement
policy. CM ensures that the data access requests on cached data items are
serviced with improved response time. When the original data item in the DS
is updated by any one of the simultaneous transactions, the replicated cached
data items should be properly invalidated to ensure data integrity. The CM
module invalidates the cached data items based on the proposed PLP method,
in which the life time of the data item is predicted based on the previous life
time and update rate. The CM facilitates effective replacement of the cached
data items based on the degree of data sharing to improve cache hit ratio.
The framework supports recovery of affiliated transactions that have
failed or interrupted. To support recovery, the fixed BS has a Recovery
Manager (RM) module. A Log Manager (LM) module is loaded in the MH
itself to create, maintain and manipulate the log to support RM on recovery of
failed or interrupted transactions. The log is stored in the MH itself. The last
saved log entry which may be RDR, RDR_REPLY, UDR or UDR_REPLY is
sent to the RM on failure recovery. The RM sends the recovery status back to
the MH. The BSC is chosen to be the permanent storage area for log storage,
when the log size exceeds the storage capacity of the MH.
2.1.2 Caching Strategy
The cache is loaded in the BS against caches in the MHs. The CM
module manages cache access and operations on cached data. The CM fetches
17
data item from the DS and stores it in the cache. All subsequent access
requests for the cached data item will be serviced by the CM itself.
2.1.3 Cache Structure
The CM stores the public data items fetched from the DS in the
cache along with additional control information. Control information of the
data item supports cache management, concurrency control and failure
recovery. The structure of the data object in the cache is represented as < Did,
Vid, PLP, ATC, UC, LUT, LUTS, DTL> where Did is the identity of the data
item, Vid is the value of the data item, PLP is Predicted Life Period of the data
item, ATC is the Affiliated Transaction Count, UC is a flag that confirms the
previous update made, LUT is the transaction that updated the data item
lastly, LUTS is the logical timestamp that is associated with last update
operation and DTL is a Dependent Transaction List.
Every data item in the database is uniquely identified with an
identity and a value is assigned to the data item. PLP of the data item is an
interval, within which its value is assumed to be valid. It is calculated based
on previous update interval and update rate. When more number of
transactions share the data item, they are said to be affiliated transactions and
the number of affiliated transactions that access the data item is identified
with ATC. LUTS indicates the logical timestamp assigned when the data item
is updated lastly. The flag UC is set, when the update operation is confirmed
by the DS. While ATC indicates the number of affiliated transactions, DTL
keeps track of the dependent transactions’ identities. Dependent transactions
of transaction T are those which have read the data item that has been updated
by the transaction T but not yet committed in the DS. Initially when the CM
retrieves the data item from the DS, it sets LUTS to the logical timestamp at
which data is retrieved and ATC of the data item to zero; when subsequent
18
data access requests are made, ATC is incremented. The data in the cache is
valid as long as it is not updated in the DS.
2.1.4 Algorithms for Cache Data Management
The control information for each data item is preserved in the cache
along with its identity and value to support concurrency control, cache
consistency preservation and cache replacement. The following algorithms
explain how the control information is affected by transaction execution and
its support for concurrency control and cache management.
a. Setting value of Predicted Life Period
PLP of a data item is initially set to optimal life time based on the
nature of the data item. If the shared data item is the available reservation slot
for automobile service in the weekend, PLP is assumed to be few minutes. If
it is available slot during working days, PLP may be set to several minutes
assuming contention for the reservation slot on a holiday is more when
compared to the reservation slot in a working day. It is highly probable that
the shared data item with high contention is updated quickly leading to
reduced valid life time of the data item.
The strategy for manipulating the PLP is given below
Step 1: PLP (Did) = opt_Value
Step 2: if (PLP (Did) expires without any updates)
PLP (Did) = PLP (Did) /2.
if (Total life time elapsed since last update > opt_Value)
PLP (Did) = Total life time elapsed since last update/2+PLP (Did)
else if (UDR (Ti, Did, Vid) and ATC (Did) = =1)
PLP (Did) = update interval (Did)
19
else if (UDR (Ti, Did, Vid) and ATC (Did) > 1)
PLP (Did) = update interval (Did) -
( update rate*update interval(Did))
If the PLP of the data item expires without any update by the
affiliated transactions, the previous predicted life period is halved and set to
the current PLP of the data item. To avoid PLP exceeding optimal value, it is
reset to a value less than the optimal value. If the total life time elapsed since
last update is more than estimated optimal life time, predicted life time is reset
to a value less than the optimal value. If data item is updated even before the
expiration of the predicted life time, the update rate of the data item is
considered and the life time is reduced in proportion to the update rate. Since
the life time of the data item is predicted based on the previous actual life
time and update rate, it is highly probable that the PLP of the data item equals
the actual life time.
b. Setting Affiliated Transaction Count
Initially when data item is loaded into the cache, the ATC is set to
zero. When a transaction makes read access to the data item, ATC is
incremented once to indicate the count of transactions that access the shared
data item.
Step 1: ATC=0
Step 2: if RDR (Ti, Did)
ATC (Did) = ATC (Did) + 1
c. Setting Dependent Transaction List
Initially DTL is set to NULL. When affiliated transactions access
the shared data item, the dependency between the transactions is identified
and DTL is updated to reflect the status of dependency at any time instance.
The process of manipulating DTL is given below.
20
Step 1: if (RDR (Ti, Did) and LTS (RDR (Ti, Did) > LUTS (Did)
and UC(Did) = =0)
DTL (LUT) = DTL (LUT) U Ti
Step 2: if (UC (Did) ==1) DTL (Did) =NULL
When a transaction issues RDR (Ti, Did), it becomes dependent
transaction of another transaction Tj, if the data item in the cache is updated
earlier by Tj and not yet committed in the DS. DTL is reset to NULL when
UC flag of the data item is set to indicate update confirmation in the DS.
d. Setting Logical Timestamp Value
Timestamp of any operation is the time instance at which the
operation is performed. In the proposed framework, timestamp ordering is
used to preserve the ordering between simultaneous conflicting access
requests. The major issue in timestamp ordering is the synchronization of the
physical clocks of each MH with that of the CM. So logical timestamp
ordering is used to logically represent the timestamp of transaction operations
rather than physical timestamps. The absence of global physical time makes it
difficult to find out the global timestamp.
Cristian and Berkeley (2001) suggested synchronization algorithms
based on multicasting physical timestamps from a server which is based on
round trip time. It may be suitable for intranet which has limited geographical
coverage. Mills (2001) proposed an algorithm based on Network Time
Protocol (NTP) service. The network of servers located across the internet
might help in synchronization of the physical clocks. The NTP servers
broadcast the timestamp so that physical clocks of clients may be
synchronized with that of the server. Since it was difficult for synchronizing
physical clock, Lamport has defined ‘happened before relation’ to have
logical ordering (numerical ordering) of transactions. Lamport’s logical clock
21
is a monotonically increasing software counter, whose value need not be
physical clock dependent. The timestamp of an event e at process Pi is
denoted by Li (e). To capture ‘happened before relation’ denoted as ,
processes update their logical timestamps and transmit the logical timestamps
in messages as follows:
LTS 1: Li is incremented before each event is performed at process Pi.
LTS 2: i) When a process Pi sends a message m, it piggybacks the timestamp
value t=Li on m.
ii) On receiving (m, t), a process pj computes Lj= max
(Lj, t) and applies LTS, before timestamping the event receive (m).
Lamport’s logical ordering fails, when two independent events
occur in two different transactions. The ordering between the independent
events may not be properly identified. To overcome that, vector clocks are
proposed by Mattern and Fidge which enable each transaction to hold a vector
that depicts the ordering of the independent events in a set of transactions. It
has large message and storage payload that is proportional to the number of
transactions.
The proposed framework has the CM (coordinator) module present
in the BS. The CM attaches timestamps with the access requests (RDR or
UDR), based on Lamport’s logical ordering. Lamport’s timestamp itself will
properly order the transactions based on their logical timestamps, as the CM
coordinates the access requests.
2.2 LITERATURE SURVEY
The following section explores various concurrency control
techniques to preserve transaction serializability, consistency preservation
22
techniques to preserve integrity of the shared data item and replacement
policies to effectively replace the cached data item as found in the literature.
2.2.1 Concurrency Control Techniques
Locking techniques lock the shared data item when simultaneous
access is made to them. A binary-lock is held on the data item when the data
is accessed; the scheme is too restrictive for database items, which reduces
transaction throughput. A Shared-lock allows a transaction to apply read-lock
on the data item, while other transactions are allowed to read the data item
simultaneously. A write-lock is exclusively held on the data item preventing
concurrent transactions from accessing the data item. Two Phase locking
(Easwaran et al, 1978) requires clients to communicate continuously with the
DS to obtain locks and detect the conflicts resulting in increased network
load. The altruistic locking protocol (Salem et al, 1994) supports
synchronization of long lived transactions but suffers from cascading aborts.
Speculative locking proposed by Krishna and Masaru (2004) improves the
performance by trading extra resources. Locking techniques limit the degree
of concurrency and lead to deadlocks when conflicting ordering of locking is
done on the shared data items.
In multi version concurrency control proposed by Philip and Nathan
(1983), each data object is allowed to have multiple versions. However, if the
transaction which has created a version aborts, the transaction that has read
the version must also be aborted.
In timestamp ordering technique, each transaction has an ordered
list of actions. Before the transaction performs its action, it is marked with a
timestamp. Based on the timestamp, the transactions are serialized. Real time
distributed optimistic concurrency control protocol with dynamic adjustment
of serialization order was proposed by Kwok et al (2000) and it avoids
23
unnecessary transaction restarts. An optimistic concurrency control with
dynamic timestamp adjustment protocol proposed by Ho-Jin and Byeong
(2006) requires client side validation.
Salman (2008) proposed concurrency control without locking by
introducing Absolute Validity Interval (AVI). AVI based approach helps in
reducing bandwidth and managing disconnections. AVI is calculated based on
the previous update interval, within which data item is assumed to be valid.
AVI based approach does not consider the dynamicity of the life time of the
data item.
From the literature survey, it is understood that the timestamp based
concurrency control can provide controlled concurrency with improved
transaction throughput. But timestamp ordering is a challenging issue in
mobile wireless environment as synchronizing physical clocks of participating
MHs is difficult to achieve.
2.2.2 Cache Consistency Preservation Techniques
In the literature, three types of cache consistency maintenance
algorithms for wireless mobile computing environment namely stateless,
stateful and hybrid are proposed. In the stateless approach (Barbara and
Imielinski, 1994) the DS is unaware of MHs’ cache content. The MH needs to
check the validity of the cached data items before using them. Even though
stateless approaches employ simple database management at the DS, their
scalability and ability to support disconnectedness of the MH are poor. Jing et
al (1997) proposed Bit Sequences method which increased the size of IR. On
the other hand, stateful approaches proposed by Anurag et al (2001) are
scalable, but have significant overhead due to server database management. In
the hybrid approach (Wang et al, 2004) the server keeps very limited
information about clients’ cache status. It achieves good tradeoff between
24
scalability and efficiency, as computation overhead involved is less for
database management.
The stateless approach assumes no knowledge of the MHs’ cache
contents. The server simply sends IRs to all MHs periodically. At the MH, a
data object request cannot be serviced until the next IR is received. The
stateless server broadcasts the IR according to different strategies. Stateless
approach is classified into asynchronous and synchronous methods. In
asynchronous method the IR is broadcast immediately, after the data item is
updated. In synchronous method, IR is broadcast periodically. Asynchronous
methods do not provide any latency guarantees for the querying MH; but in
synchronous method, there is a guaranteed latency due to the periodic nature
of synchronous broadcast. Three stateless synchronous methods namely
Broadcasting Timestamps, Amnesic Terminals and Signatures for cache
invalidation were proposed by Barbara and Imielinksi (1994). Two methods
adaptive IR with fixed window and adaptive IR with adjustable window were
proposed by Joe Chun-Hung et al (2000). They avoid bandwidth wastage of
the downlink broadcast channels as in Bit Sequences approach and uplink
bandwidth wastage as in Timestamp approach. They dynamically adjust the
IR size.
In the stateful approach, Mobile Support Station (MSS) maintains
object state for each MH's cache and broadcasts IR that contains only those
cached objects. Anurag et al (2001) proposed an asynchronous stateful
algorithm which uses asynchronous IR to maintain cache consistency. In
Asynchronous Stateful algorithm, each MH maintains its own Home Location
Cache (HLC) to deal with the problem of disconnections. When a MH queries
for a data item, it checks the validity of the data item in its local cache. If the
data item is valid, it satisfies the query from its local cache; otherwise, an
uplink request is made to the server by the MSS on behalf of the MH. When
25
the data item is received, the MSS adds an entry to the HLC for the requested
data item and forwards the data item to the MH. The data item may not be
cached at the MSS.
Wang et al (2004) proposed a hybrid consistency maintenance
scheme, called Scalable Asynchronous Cache Consistency Scheme (SACCS)
to maintain MH's cache consistency. Unlike the stateful algorithm which
requires the MSS to remember all data objects for each and every MH's cache,
SACCS requires the MSS to identify which data objects in its database might
be valid in MH's caches. This makes the database management of the MSS
much simpler. On the other hand, unlike existing synchronous stateless
approaches, SACCS does not periodically broadcast IR reducing the
frequency of IR through the downlink broadcast channel.
Yuen et al (2000) proposed a cache invalidation scheme, called
Invalidation by Absolute Validity Interval (IAVI). An AVI for each data item
is defined based on its real-time property. A MH can verify the validity of a
cached item by comparing the last update time and its AVI. A cached item is
invalidated if the current time is greater than the last update time by its AVI.
With this self invalidation mechanism, the IAVI scheme uses the IR to inform
the MHs about the change in AVI rather than the update event on the data
item. The AVI of a data item can be derived based on the previous update
interval of the data item. It is assumed that each update is associated with a
timestamp. On every update of the data item, the update timestamp will be
recorded with the updated data item. The timestamp together with the AVI of
the data item can be used to determine its validity. The update interval can be
used to define the validity period of the cached item.
From the literature survey of cache consistency preservation
schemes, it is learnt that in all existing schemes, the MH is assumed to have
cache loaded in it. The frequency, with which IR should be generated and sent
26
to the MH, differs based on different schemes. The major constraint in the
existing cache invalidation schemes is to deal with disconnected MH, when
IR is sent.
2.2.3 Cache Replacement Policies
Aggarwal et al (1999) proposed three categories of cache
replacement strategies for web caching namely direct extensions of traditional
strategies, key based replacement strategies and function based strategies.
Direct extensions of traditional strategies such as Least Recently Used (LRU),
Least Frequently Used (LFU) and First In First Out (FIFO) do not consider
size of the objects to be cached. Key based policies prioritize cache
replacement factors based on the requirements of the application. The factor
with highest priority is considered as a primary replacement criterion. If two
data objects have same value for the primary replacement factor, the selection
for replacement is based on a secondary key factor. Function based policies
employ a general function of different factors such as transfer time, object
expiration time and entry time in the cache. A pyramidal selection scheme is
also proposed where the objects are categorized based on their size. The
cached data items are replaced based on the least recent usage.
Yin et al (2003) presented a generalized target driven cache
replacement policy for mobile environment under strong consistency model.
They formulated functions for specific targets of minimized query delay and
downlink traffic. Narottam et al (2006) proposed a scheme based on data
profit. It ensured that the data items which are highly associated with each
other are retained in the cache. Jin-Woo et al (2006) designed a cache
replacement policy for ad-hoc environment in which small objects are loaded
in the cache and larger objects are loaded in idle peer nodes. Energy efficient
co-ordinated cache replacement scheme was proposed by Edward Chan et al
(2009) for adhoc networks that reduces energy consumption and access
27
latency. Hazen et al (2009) proposed a cache replacement policy for location
dependent information services using virtual table method.
All the previous approaches deal with storing cache in the MH and
none of them deal with shared caches in which the degree of data sharing
needs to be considered as an important factor.
2.3 PROPOSED PLP SUPPORTED LOGICAL TIMESTAMP
ORDERING BASED CONCURRENCY CONTROL
TECHNIQUE
When affiliated transactions make simultaneous data access
requests, the CM controls access to the shared data item without reducing the
transaction throughput. Any MH that needs to read the data item makes RDR.
When the RDR is received, the CM attaches the timestamp to the request
based on its logical clock value. If the data item is cached, the CM checks
whether the RDR is made within the valid life time of the data item; if so, the
read access is permitted on the data item. When a MH issues UDR indicating
data update, the CM timestamps the UDR with its logical clock. Since update
request can be issued only after read request, the data item which is to be
updated is present in the cache. The CM updates the data item locally.
When simultaneous access requests are made, CM resolves the
access requests using FIFO principle, based on the logical timestamp assigned
to the requests. If two transactions Ti and Tj send UDR on the same shared
data item, the transaction requests are attached with the logical timestamps Li
and Lj respectively based on their arrival at the CM. The Transaction Ti is
allowed to continue if Li is less than Lj; Else Tj is allowed to continue. The
proposed PLP based concurrency control algorithm is as follows:
28
Step 1: While (Simultaneous RDR (Ti, Did) requests are received)
if (all RDRs received before PLP (Did) expires)
Allow all Ti to continue with read access
Step 2: Serialize simultaneous RDR/UDRs based on logical
timestamp assigned to them.
if (UDR (Ti, Did, Vid, TSr) and (TSr <LUTS))
Send ‘REDO UPDATE’ with piggybacked updated value.
else Locally update the data item.
If multiple RDRs are received, CM allows all transactions to read
the value, if the read requests are made within valid life time of the data item.
Within PLP interval, the data item is assumed to be valid and all the MHs that
have requested read access to it are allowed to access the data item, increasing
the degree of concurrency. If two transactions Ti and Tj send UDR on the
same shared data item, the transaction requests are attached with the logical
time stamps LTSi and LTSj respectively based on their arrival at the CM. The
Transaction Ti is allowed to continue if LTSi is less than LTSj; Else Tj is
allowed to continue. When a transaction is allowed to update the data item,
the value already read by the transaction is checked for its validity by
comparing the logical timestamp of the read operation with the logical
timestamp of last update operation on the data item. If the already read value
is updated after it has been read, the transaction is intimated to resend update
request with the updated data value. Otherwise, the data item is updated
locally and update request is forwarded to the DS while UC flag is set to zero.
The time interval between two consecutive updates is said to be the
valid life span of the data item and in the proposed PLP method, it is
predicted based on previous update interval and update rate. Within PLP
interval, the data item is assumed to be valid and all the MHs that have
requested read access to the shared data item are allowed to access the data
29
item, increasing the degree of concurrency. The proposed PLP supported
concurrency control technique serializes the conflicting operations of the
concurrent transactions efficiently based on their logical timestamp. It also
ensures the immediate data availability, after the data is updated in the cache.
2.4 PROPOSED PLP BASED CACHE CONSISTENCY
PRESERVATION TECHNIQUE
When concurrent transactions are executed, the data item in the DS
may be updated. When such update is made to the data in the DS, the CM
should invalidate the replicated copy of the data item in the cache. When one
of the concurrent transactions, serviced by the same CM, issues UDR the
replicated copy in the cache is updated locally. The CM generates the invalid
indication to indicate the update of the data item and broadcasts the invalid
indication to all dependent transactions serviced by the same CM, only if the
ATC ratio is high (>0.6). ATC ratio is the ratio of the affiliated transactions to
the total transactions. High ATC ratio indicates that almost all transactions are
affiliated transactions. The broadcast of invalid indication avoids transaction
processing with invalid stale data. Invalid indication has the updated value
piggybacked on it, to allow transactions to continue with execution.
The CM sends the invalid indication to all connected BSs that have
caches stored in it. When the connected BSs that have CMs receive the
invalid indication, they update the data item locally with UC of the data item
set to zero, if the data item is available. Otherwise, the data item is loaded in
the cache with UC flag set to zero. Invalid indication sent to the connected
CMs, makes provision for the availability of data item in the nearby BSs. It
supports continual transaction execution even on handoff procedure.
The threaded CM also forwards the update request made by the MH
to the DS. The DS after validation does the update and broadcasts the
30
invalidation confirmation together with updated value. On receiving the
invalidation confirmation, the CM sets the UC flag to indicate the confirmed
update in the DS.
The updated cached copy of the data item is immediately available
in the cache with a change in PLP. This ensures cache consistency with
control of concurrency.
The PLP of the data item is calculated as shown in equation (2.1).
PLP(Did) = UI(Did) - (U(Did) * UI(Did)) (2.1)
where UI is the actual update interval of the data item and U is the update rate
on the data item. Update rate is the ratio of the number of transactions that
have updated the data item to the total number of affiliated transactions during
previous PLP duration and is calculated as shown in equation (2.2).
U(Did) = Total_Updates (Did) /ATC (Did) (2.2)
Since the PLP is based on the update rate, it is highly probable that
the PLP is very close to the actual valid life span of the data item. If the PLP
is optimally estimated, the number of transactions that need to be restarted
will be considerably reduced. Since the predicted life period is based on
update rate, the value of PLP is dynamically changed reflecting the data
update environment. If the data item is not updated, it need not be invalidated
unnecessarily with limited PLP. This is ensured with a change in PLP, when
PLP expires without any update to the data item. Conversely if the frequency
of data item is very high the PLP is reduced to ensure frequent invalidation.
The framework proposes immediate dissemination of invalid
indication to all BSs connected to the current BS. Since cache is maintained
in the fixed host, the complexity in the MH is reduced against the existing
31
techniques in which MHs store the data item locally. The proposed cache
consistency preservation technique also deals with the MH that has missed IR.
The situation is handled as a failure of the MH and recovery algorithm
ensures consistency preservation.
2.5 PROPOSED ATC/DTL BASED CACHE REPLACEMENT
POLICY
A cache replacement strategy decides which data item is to be
evicted from the cache when no space is available to store additional data
objects. The cache replacement may be based on several factors such as
frequency of access, data retrieval cost from the server and its size. The
effectiveness of a replacement strategy is measured with the cache hit ratio.
In the proposed approach, the data items are organized in the cache
in the order, in which they are loaded into the cache to avoid complexity
increase due to reordering of data items on every loading of data item.
Whenever a read access is made to the data item, ATC is incremented; it
indicates the degree of sharing of the data item. Analysing the previous
approaches, none of them considers the number of transactions that share the
data item. If more number of transactions share the same data item, it is
highly desirable to make the data item available in the cache. Because, if the
highly shared data item is evicted from the cache, it is highly probable that the
cache hit ratio of the affiliated transactions becomes zero. Since the proposed
framework favours the affiliated transactions, proposed cache replacement
policy replaces the data object with the least ATC.
The proposed cache replacement policy, improves data availability
in the cache when the data item is shared between affiliated transactions.
When more than one data item has the same ATC value, it is resolved based
on recent usage of the data item and the count of dependent transactions on
32
the data item. The recent usage identifies the data item which is accessed in
the recent past. The DTL gives the count of the dependent transactions on the
data item. In the proposed replacement policy, highly shared recent data items
are retained in the cache. The algorithm for cache replacement policy is as
follows:
While (cache is loaded to its maximum capacity) and (new item to be cached)
Repeat for every data item in the cache from the remembered location
if ( ATC(Did) is the least of all data items )
if (Did is not accessed in the recent past and
count of DTL (LUT(Did) is the least)
Replace Did with the new item to be cached
Remember the next location for initiating next search
When the cached data items are to be replaced for the first time, the
data item for replacement is searched from the first location which is the
remembered location. The remembered location helps in identifying the data
item that is not used in the recent past. When a data item is replaced the
location of the data item is marked as remembered location, so that search for
next replacement will start from that location. If the data item is not shared
between affiliated transactions and if it is not recently accessed, it is replaced.
The next immediate cache location is remembered to make sure that the
search for next replacement starts with the remembered location. Since the
data items are loaded in the cache in the same order they are referenced, all
data items are checked for possibility of replacement without omission.
2.6 FUNCTIONALITY OF THE PROPOSED FRAMEWORK
The proposed framework supports concurrent transaction execution
in mobile wireless environment. The CM co-ordinates the access to the shared
33
data item while preserving the consistency of the cached data item. It ensures
efficient cache replacement policy to favour concurrent affiliated transaction
execution. The functionalities and interactions of the MH, CM and DS to
achieve concurrent transaction execution environment are discussed below.
2.6.1 Functionality of the Mobile Host
The MH executes the transaction. The MH gets connected to the DS
that provides data services. The DS authenticates the valid MHs. When a data
item is needed, the MH generates RDR and sends it to the CM. The MH sends
UDR to the CM when data item is to be updated. The MH makes entry in the
log for all communication done between the MH and the CM/RM/DS along
with the logical timestamp for the operations. The flow of operations
performed by the MH is as follows:
Step 1: Connect to the DS and get authenticated
Step 2: if (Did is needed)
Make log entry for RDR (Ti, Did) and Send RDR to CM
Step 3: if (Did needs to be updated)
Make log entry for UDR (Ti,Did,Vid) and Send UDR to CM
Step 4: if (Requested data item is retrieved from the CM)
Make log entry for the received data item with the logical
timestamp set by the CM
Step 5: if (Update confirmation is received from the CM)
Make entry in the log with the timestamp
Step 6: if (Invalid indication is received)
Continue the operation with the received updated
data item.
Step 7: if (Commit (Ti))
Make log entry and commit Ti.
34
The functionality of the MH is shown in the Figure 2.2.
Figure 2.2 Functionality of the MH
2.6.2 Functionality of the Database Server
The functionality of the DS is shown in Figure 2.3. The data items
stored in the database can be accessed through a DS. When the DS receives a
connection request, it authenticates valid users. When RDR for a data item is
received, the DS broadcasts the value of the data item. If UDR is forwarded
from the CM, the DS updates the data item in the database and sends the
No
No
Yes
No
No
Yes
Connect to Server
&
Get Authenticated
DataAccess?
Make entry in log and
send RDR/ UDR to CMData
Update?
Reply for
read/updatefrom CM?
Make entry in log with
timestamp received from
CM
Yes
Invalid
indication?
No
Continue operation with
the updated value
Yes
Commit?Make entry in log ,
commit and terminate
Yes
Terminate
35
update confirmation message along with the updated value of the data item.
The operations of a DS are as follows:
Step1: While (waiting for connections)
if (connection request) authenticate the valid users
Step2: if (RDR (Ti, Did) from CM)
Send the requested data item to the CM
Step 3:if (UDR(Ti, Did, Vid))
Update the data item in the DS and broadcast update
confirmation with updated value to all CMs
Figure 2.3 Functionality of the DS
No
No
YesRead Access
?
No
Yes
Yes
Waiting for Connection
Connection
Request?
Connect Authorized
Clients
Data
Update ?
Send Requested
Data item
Update data & Send
Invalidation Confirmation
with updated value
36
2.6.3 Functionality of the Cache Manager
The CM when loaded with data items initializes the control
information. When RDR is received from the MH, it is attached with the
logical timestamp of the CM. The CM ensures concurrency control with
logical timestamp ordering of the requests. The RDR is satisfied if the data
item is already in the cache. Otherwise data item is requested from the DS.
The retrieved data item is loaded in the cache. If cache replacement is needed,
the CM replaces a data item with the least ATC and DTL. If UDR is received,
the data item is updated locally and invalid indication is sent to all connected
CMs and dependent MHs. This ensures availability of the data item in the
nearby CMs to support mobility of the MHs. The threaded CM forwards the
requests to the DS and waits for update confirmation. On update confirmation
from the server, the CM sets UC flag and forwards the confirmation message
to the MH.
The functionality of the CM is as follows:
Step 1: Load the CM with the initial data (Did, Vid)
Step 2: For every data item Did loaded in the cache
UC=1; ATC (Did) =0; LUT=NULL; DTL=NULL;
LUTS=0; PLP (Did) =optimal value;
Step 3: While (waiting for data access requests from MH)
if (RDR (Ti, Did))
Timestamp RDR with logical timestamp
if (cache has Did and PLP(Did) is not expired)
Allow transaction to continue with read
access to Did
else
Forward the RDR to the DS
37
if (Did is retrieved from DS) and (cache is not
loaded to maximum capacity)
Load Did in the cache and initialize the control
information of the data item.
Send Did to the MH along with logical timestamp.
else
while (Data item not found for replacement)
Search from remembered location for Did with
the least ATC and DTL
Remember the location for next replacement
if (UDR(Ti, Did, Vid, TSr) and (TSr <LUTS))
Send ‘redo update’ to the MH with the current data
value
else
Locally update Did and forward UDR to the DS.
Send invalid indication to all BSs.
Set LUT (Did) =Ti; LUTS (Did) = LTS (UDR);
PLP (Did) = UI - U *UI; UC=0;
if (ATCRatio (Did) is high)
Broadcast invalid indication to all MHs.
if (Invalid indication for a data item from other CMs)
if (data item in already cached)
Update the value of data item and its PLP
else
Load the data item in the cache
if (Update Confirmation from the DS)
Set UC=1 to indicate confirmed update
Send the update confirmation to the MH.
38
Update
request?
No
No
No
Yes
Yes
No
Yes
Yes
Read
Request?
In
cache?
Fetch data from DS
Update Data item
locally & set UC to 0
Update ATC &
Send data to MH
Send invalid indication to all
connected CMs & Forward
UDR to DS
Update
Confirmation?
Waiting for Client Requests
Replace
ment?
Update UC
Replace data item with
least ATC and DTL
Yes
Send the data item to
the MH with timestamp
The functionality of the CM is shown in Figure 2.4.
Figure 2.4 Functionality of the CM
2.7 PERFORMANCE ANALYSIS
The proposed framework is compared with the existing concurrency
control techniques, cache consistency preservation techniques and cache
replacement policies. The merits of the proposed scheme are analysed.
39
2.7.1 Comparison of Concurrency Control Techniques
The proposed concurrency control technique is compared with
existing techniques for various parameters and discussed below.
i) Data Accessibility: When transactions are concurrently
executed, data accessibility determines how immediately data
is accessible when it is made available. Since locking
technique locks the data item, the accessibility of data is
limited. Timestamp ordering allows strict serialized data
access but with improved accessibility. AVI and proposed
method make data immediately available. The access to the
data is not blocked in the AVI and proposed PLP method.
ii) Serializability: Serializability of the concurrent transactions
decides ordering of the concurrent transactions such that
conflicting operations are performed without conflicts.
Timestamp ordering strictly preserves the serializability, while
the locking techniques may lead to deadlocks. AVI preserves
serializabilty, but at extra cost of restarting the conflicting
transactions. Proposed method uses logical timestamp ordering
based PLP method to ensure strict serializability.
iii) Transaction Throughput: Locking technique drastically
reduces the degree of concurrency while timestamp ordering
technique improves it. AVI based approach and the proposed
technique have improved support to concurrent transaction
execution. The proposed technique ensures immediate data
availability after the data is updated in the cache when
compared to the AVI based approach.
40
iv) Probability for Transaction ‘restarts’: The transactions are
aborted and restarted when conflicting operations are not
serialized in concurrent transactions. Though locking
technique handles conflicting operations, deadlocks due to
locking may lead to transaction restarts. AVI based method
leads to transaction abortion as the concurrent transactions
may access stale data. But it is avoided at the cost of placing a
co-ordinator at the BS. The proposed method reduces the
transaction ‘restarts’, as the CM serializes the conflicting
operations with co-ordinated access to the shared data item.
2.7.2 Comparison of Cache Consistency Preservation Protocols
The existing cache consistency protocols are compared with the
proposed PLP based invalidation scheme against various parameters and the
comparison is shown in Table 2.1.
Table 2.1 Comparison of Cache Consistency Preservation Techniques
Parameters
Stateless
Method
Stateful
Method
Hybrid
Methods
SACCS
Proposed
Cache Location MH MH MH BS
IR Method Synchronous Asynchronous Asynchronous Asynchronous
IR Generation DS DS MSS CM
IR Size Database sizeInvalidated
items
Invalidated
items
Invalidated
items
In the stateless approaches, the IR is broadcast by the DS
periodically. IAVI, SACCS and proposed method generate IR only when
cached data items are invalidated. In the proposed technique, the invalid
41
indication is broadcast only when ATC ratio is high. So, considerable
reduction in the down link capacity is achieved. In the proposed technique,
the invalid indications are communicated between BSs in the wired network
to ensure effective utilization of wireless channels. The IR size of the stateless
approaches is proportional to the database size. In IAVI, SACCS and
proposed method the IR size is proportional to the invalidated cached data
items. The proposed method reduces the complexity in the MH and the DS.
2.8 ANALYSIS OF PERFORMANCE METRICS
The performance of the proposed concurrency control and cache
consistency preservation technique is analyzed based on various metrics. The
following section shows the merits of the proposed framework against
existing techniques.
2.8.1 Simulation Model
The functionality of the CM is implemented in Java and MHs in
J2ME. The DS is loaded with 200 data items of equal size. As the shared data
item is assumed to be available number of slots, the data item size is
considered to be equal. Access time of the data items of equal size remains
equal. The data access pattern is not uniformly distributed as concurrent
execution environment is considered. The data item together with its control
information occupy maximum of 128 bytes. The simulation is done for
varying cache size (10 % and 30 % of database size) and varying ATC ratio.
2.8.2 Impact of Update rate on PLP
The proposed scheme calculates the PLP of the data item based on
the previous update interval and the update rate. The PLP of the data item for
various update intervals and update rates are tabulated in Table 2.2.
42
Table 2.2 Impact of Update Rate on PLP
Predicted life period in sUpdate Interval
in s U = 0.2 U=0.4 U=0.6 U=0.8
5 4 3 2 1
4 3.2 2.4 1.6 0.8
3 2.4 1.8 1.2 0.6
2 1.6 1.2 0.8 0.4
1 0.8 0.6 0.4 0.2
From the Table 2.2, it is understood that the PLP of the data item is
reduced in proportion to the update rate of the data item. When 80% of the
affiliated transactions involved in data update, the PLP is reduced to 20% of
the previous update interval. Since the increase in update rate reduces the PLP
of the data item, it is highly probable that the PLP equals the actual valid life
time of the data item.
2.8.3 Impact of PLP on Usage of invalid data
In the AVI approach, the predicted validity period of the data item is
equal to the previous update interval. The SACCS method predicts Time To
Live (TTL) value based on previous update interval and life time. AVI/TTL
values are predicted based only on the update interval irrespective of the
update rate. But the proposed PLP based scheme calculates the PLP, based on
the update rate. The PLP, AVI and TTL values for various update intervals
and update rates are shown in Table 2.3. For TTL calculation the previous life
time of the data item is assumed to be 2 seconds. When the MH accesses the
data item with AVI or TTL, it assumes the validity of the data item until AVI
/ TTL expires. If the update rate increases, the original copy of the data item
is updated even before AVI / TTL expires, while the MH continues execution
with stale data.
43
Table 2.3 Comparison of PLP and AVI/TTL
PLP in s AVI in s TTL in sUpdate
Interval
in sU=0.4 U=0.6 U=0.8 U=0.4 U=0.6 U=0.8 U=0.4 U=0.6 U=0.8
5 3 2 1 5 5 5 3.5 3.5 3.5
4 2.4 1.6 0.8 4 4 4 3 3 3
3 1.8 1.2 0.6 3 3 3 2.5 2.5 2.5
2 1.2 0.8 0.4 2 2 2 2 2 2
1 0.6 0.4 0.2 1 1 1 1.5 1.5 1.5
The maximum deviation of the predicted life span of the data item
for the proposed PLP based technique and the existing AVI (Salman, 2008) /
TTL (Wang, 2004) based techniques is shown in Table 2.4. The PLP and AVI
/ TTL values calculated for the update interval of five as in Table 2.3, are
taken and compared with the actual time intervals. The difference between the
actual validity and the predicted validity of the data item is tabulated in Table
2.4 for the proposed and existing techniques.
Table 2.4 Accuracy of PLP and AVI/TTL Calculation
Maximum Deviation in PLP/AVI/TTL calculation (sec)
U=0.8 , PLP = 1, AVI=5 and
TTL=3.5 for UI=5
U=0.6 , PLP = 2 AVI=5 and
TTL=3.5 for UI=5
Actual
UI
in secPLP AVI TTL PLP AVI TTL
5 0 0 0 0 0 0
4 0 1 0 0 1 0
3 0 2 0.5 0 2 0.5
2 0 3 1.5 0 3 1.5
1 0 4 2.5 1 4 2.5
44
If the update rate increases, the actual update interval decreases.
When the update rate changes, the AVI / TTL approaches have the predicted
duration deviated from the actual valid period in which stale data items are
processed. In AVI/TTL approach the predicted validity lifetime deviates
whenever the update rate is changed. The PLP approach ensures no deviation
when update rate is uniform and update rate is not increased more than half of
its previous update rate. Anyhow, deviation is limited to the maximum
duration of 1second when compared to 4 seconds of AVI and 2.5 seconds of
TTL based approach.
2.8.4 Analysis of Stale Hit Probability
Stale Hit Probability is the probability with which the MH accesses
the invalid (stale) data from the cache. The cache data becomes invalid when
the original data is updated in the DS. Since cache is maintained in the MH,
the AVI and SACCS approach assume validity of the data till AVI/TTL
expires. In SACCS approach, the stale hit probability is proportional to the IR
miss probability. The stale hit probability reaches 0.51 when IR miss
probability increases to 0.8 irrespective of the update rate. However the stale
hit probability is reduced to 0.04 at the cost of multiple IR broadcast. But in
the proposed PLP method the stale hit probability is reduced to zero as the
updated data is made immediately available in the cache. In AVI based
approach, stale hit probability is not reported.
2.8.5 Impact of Validity Period on Transaction ‘restarts’
Transactions need to restart when they process with invalid data. In
SACCS approach, when MH is awake the data item is assumed to be valid
before TTL expiration. The probability of transaction ‘restarts’ due to stale
data access, is directly proportional to stale hit probability. For AVI based
approach, the transaction is committed locally and conflict resolution is
45
postponed till conflicts are identified in the co-ordinator. The co-ordinator
restarts all the transactions that processed with stale data. But in the proposed
approach no invalid data is processed and the conflicts are resolved even
before the transactions reach the commit point.
The proposed PLP based technique reduces the transaction ‘restarts’
to 0 when PLP exactly matches the actual life time. The existing techniques
abort all the transactions except the one that commits first which is
proportional to O(n-1) where n is the number of simultaneous affiliated
transactions.
2.8.6 Analysis of Response Time
Response time refers to the time taken to service the request made
from the MH. In Table 2.5, the response time analysis between direct DS
access and cache access is given.
Table 2.5 Analysis of Response Time
Response Time in msTransaction
Count Direct DS
Access
Proposed Cache
in BS
Existing Cache
in MH
1 77.8 65.4 63
5 78.6 65.4 63
10 81.9 70 63
15 83.4 73.8 63
20 84.5 76.5 63
25 86.2 78 63
30 87.4 78 63
35 88.2 78 63
46
Figure 2.5 Analysis of Response Time
From Figure 2.5 it is understood that, as the number of mobile
transactions increases, the response time increases for both direct DS access
and the proposed cache access for data and control frames. Data frames have
data packets and frame control has control information about the packet. The
response time increases, due to the network overhead. When the cache is
loaded in MH, the response time is constant for accessing any cached data
item. When transaction count is less than 5, the response time equals at least
the round trip time which is comparatively more than 63 ms. When
transaction count is increased, the affiliated transaction ratio is increased
resulting in maximum response time of 78.4 ms.
The existing techniques ensure fixed and reduced response time.
Though the proposed technique has increased response time, the reduction in
probability of transaction ‘restarts’ and stale hit probability to zero is
appreciable when compared to the existing techniques which have caches
loaded in the MH itself.
2.8.7 Impact of ATC Ratio on Cache Hit Ratio
Cache hit ratio is defined as the ratio of the number of available
searched data items in the cache to the total number of searched data items.
47
The impact of ATC ratio on cache hit for varying transaction count (TC) is
tabulated in Table 2.6. ATC ratio is the ratio of the number of affiliated
transactions to the total number of transactions. Figure 2.6 indicates that the
increase in ATC ratio, improves the cache hit ratio.
Table 2.6 Impact of ATC Ratio on Cache Hit Ratio
Cache Hit RatioATC
Ratio TC=5 TC=10 TC=15 TC=30
0.2 0 0.13 0.16 0.17
0.4 0.2 0.33 0.36 0.36
0.6 0.4 0.53 0.56 0.57
0.8 0.6 0.73 0.76 0.8
1 0.8 0.93 0.96 0.97
Figure 2.6 Impact of ATC Ratio on Cache Hit Ratio
2.8.8 Comparison of Cache Hit Ratio
The proposed ATC/ DTL based cache replacement policy is
compared against existing FIFO, LRU and LFU policies. Since the proposed
policy assumes data items of equal size, the proposed system is compared
only against traditional approaches in which data size is equal. The cache hit
48
ratio is compared between the proposed ATC/DTL policy and existing
policies for different ATC ratio and varying cache size. The comparison is
shown in Table 2.7.
Table 2.7 Analysis of Cache Hit Ratio
Cache Hit Ratio
Cache Size = 10% DB Size Cache Size = 30% DB SizeATC Ratio
FIFO LRU LFUATC/
DTLFIFO LRU LFU
ATC/
DTL
0.2 0 0 0 0.2 0 0 0 0.2
0.4 0 0 0 0.4 0 0 0 0.4
0.6 0 0 0.1 0.6 0 0 0.33 0.66
0.8 0.16 0.16 0.15 0.7 0.2 0.2 0.6 0.8
1.0 0.2 0.2 0.2 0.74 0.3 0.3 0.6 0.84
Figure 2.7 Analysis of Cache Hit Ratio
From Figure 2.7, it is understood that the cache hit ratio of the
proposed ATC/DTL method increases as ATC ratio increases irrespective of
the cache size. It assures maximum of 0.84 cache hit ratio against 0.6 of LFU
policy and 0.3 of LRU and FIFO policies. The cache hit ratio of the proposed
49
policy is improved by at least 20% when compared to the existing cache
replacement techniques.
Based on the proposed cache consistency preservation technique, a
paper entitled “Performance Analysis of Improved Cache Invalidation
Scheme in Mobile Computing Environment” is published in the International
Journal of Computer Science and Network Security, Vol. 9, No.9, September
2009, pp.153-160.
Based on the proposed caching mechanism, a paper titled
“Improved Caching strategy for Concurrent Transaction Execution in Mobile
Wireless Environment” is published in European Journal of Scientific
research, Vol. 51, Issue 2, 2011, pp. 182-192.
Based on the cache management operations proposed in the thesis, a
paper titled “Cache Management for concurrent Transaction execution in
Mobile Wireless Environment” is published in the Journal of Computer
Science, Vol.7, Issue 3, 2011, pp. 374-378.
Based on the framework proposed in the thesis, a paper entitled
“Framework for Transaction Management in Mobile Computing
Environment” is published in the International Journal of Computer Network
and Internet Research, Vol. 9, Issue 2, December 2009, pp. 19-24.
2.9 CONCLUSION
The proposed PLP based concurrency control technique assures
efficient concurrency control in a highly dynamic transaction execution
environment in which the update rate is uniform and high (>0.8). When 80%
of the affiliated transactions involve in data update, the PLP is reduced to
20% of the previous update interval ensuring prediction of the PLP that equals
50
the actual valid life time of the data item. The PLP approach ensures no
deviation when update rate is uniform and update rate is not increased more
than half of its previous update rate. Anyhow, deviation is limited to the
maximum duration of 1second when compared to 4seconds of AVI and 2.5
seconds of TTL based approach.
The proposed PLP method reduces the stale hit probability to zero
against 0.51 of SACCS approach, as the updated data is made immediately
available in the cache. The proposed PLP based technique reduces the
transaction ‘restarts’ to 0 when PLP exactly matches the actual life time. The
existing techniques abort all the transactions except the one that commits first.
The cache replacement policy assures efficient replacement that
preserves highly shared data item in the cache resulting in cache hit ratio
greater than 0.74. The cache hit ratio of the proposed policy is improved by at
least 20% when compared to the existing cache replacement techniques. It
also proves that the replacement policy is highly suitable for concurrent
transaction execution environment.
top related