Upload
alexander-roth
View
49
Download
3
Tags:
Embed Size (px)
DESCRIPTION
References: A Transaction Model to Improve Data Availability in Mobile Computing Sanjay Kumar Madria( [email protected] ) Bharat Bhargava( [email protected] ) Multi-version Transaction Model to Improve Data Availability in Mobile Computing Presented by, Mohammed Abdul Baseer. - PowerPoint PPT Presentation
Citation preview
04/19/23 1
Transaction Models To Improve Data Transaction Models To Improve Data Availability in Mobile ComputingAvailability in Mobile Computing
References:References:
A Transaction Model to Improve Data Availability in Mobile A Transaction Model to Improve Data Availability in Mobile ComputingComputing
Sanjay Kumar Madria(Sanjay Kumar Madria([email protected]@umr.edu))Bharat Bhargava(Bharat Bhargava([email protected]@cs.purdue.edu))
Multi-version Transaction Model to Improve Data Availability Multi-version Transaction Model to Improve Data Availability in Mobile Computingin Mobile Computing
Presented by,Presented by,Mohammed Abdul BaseerMohammed Abdul Baseer
04/19/23 2
OverviewOverview
Mobile ArchitectureMobile ArchitectureConstraints in Mobile ComputingConstraints in Mobile ComputingTransactions in Mobile EnvironmentTransactions in Mobile EnvironmentRequirements for transaction model in Requirements for transaction model in Mobile EnvironmentMobile EnvironmentPre-Write Transaction ModelPre-Write Transaction ModelMulti-version Transaction ModelMulti-version Transaction ModelConclusionsConclusions
04/19/23 3
Mobile ArchitectureMobile Architecture
04/19/23 4
Constraints of Mobile ComputingConstraints of Mobile Computing
Wireless communicationWireless communicationLow bandwidthLow bandwidthFrequent disconnections – voluntary,not Frequent disconnections – voluntary,not failurefailureHigh bandwidth variabilityHigh bandwidth variabilityMonetarily expensiveMonetarily expensiveAsymmetric communication between MH Asymmetric communication between MH and MSSand MSS
04/19/23 5
Constraints of Mobile Computing Constraints of Mobile Computing (contd..)(contd..)
Unreliable communication Unreliable communication
MobilityMobilityMH has the ability to moveMH has the ability to move
MSS is overloadedMSS is overloaded
Address migration,”Address migration,”hands-off process”hands-off process”Termination of communication with current MSSTermination of communication with current MSS
Establishment of communication with new MSSEstablishment of communication with new MSS
Changing the N/W routing to reflect new MSSChanging the N/W routing to reflect new MSS
04/19/23 6
Transactions in Mobile EnvironmentTransactions in Mobile Environment
Mobile transactions are different from their Mobile transactions are different from their counterparts in centralized or distributed counterparts in centralized or distributed environmentsenvironments
04/19/23 7
Transactions in Mobile Environment Transactions in Mobile Environment (contd..)(contd..)
Long lived transactions- mobility of users, Long lived transactions- mobility of users, data and frequent disconnectionsdata and frequent disconnections
Might have to split- some operations need Might have to split- some operations need to be executed at MH and some at MSSto be executed at MH and some at MSS
Need to share their states and partial results, Need to share their states and partial results, “hands-off process”“hands-off process”
Require communications and computations Require communications and computations to be supported by MSSto be supported by MSS
04/19/23 8
Transactions in Mobile Environment Transactions in Mobile Environment (contd..)(contd..)
As MH moves from one cell to another, the As MH moves from one cell to another, the states of transaction, states of previously states of transaction, states of previously accessed data, location information etc.. accessed data, location information etc.. Also moveAlso move
Need to support and handle – concurrency, Need to support and handle – concurrency, recovery, disconnection and mutual recovery, disconnection and mutual consistency of replicated data.consistency of replicated data.
04/19/23 9
Requirements for Transaction Model in Requirements for Transaction Model in Mobile EnvironmentMobile Environment
Support the limitations of mobile Support the limitations of mobile computingcomputing
Minimize transaction aborts due to Minimize transaction aborts due to disconnectiondisconnection
Ensure the correctness of operations on Ensure the correctness of operations on shared data both at MH and MSSshared data both at MH and MSS
Minimize blocking transactions, to reduce Minimize blocking transactions, to reduce concurrency and communication cost riseconcurrency and communication cost rise
04/19/23 10
Different Scenarios for Executing Different Scenarios for Executing Mobile TransactionsMobile Transactions
Mobile transaction processing can be Mobile transaction processing can be structured in one of the three ways:structured in one of the three ways:
Mobile host (MH) as I/O deviceMobile host (MH) as I/O deviceMode of operation – MH submits transaction, MSS Mode of operation – MH submits transaction, MSS executes and sends back resultsexecutes and sends back results
Complete Database Server (DBS) on the MHComplete Database Server (DBS) on the MHUnrealisticUnrealisticData inconsistent with that present on MSSData inconsistent with that present on MSS
Mobile host with Cached dataMobile host with Cached data
04/19/23 11
Pre-Write Transaction ModelPre-Write Transaction Model
A transaction is a partial order of some read A transaction is a partial order of some read and write operations on different data items. and write operations on different data items. Mobile transactionsMobile transactions are no exception are no exception
Introduce a prewrite operation before a write operation; makes visible (the exact or abstract) the value that data object will have after the commit of the transaction
04/19/23 12
Pre-Write Transaction ModelPre-Write Transaction Model
pre-committed – MT has announced all the prewrites values and read all the required data objects, but has not been finally committed (updates on database are not performed).
A pre-read returns a prewrite value of the data object whereas a read returns the result from a write operation
04/19/23 13
Pre-Write Transaction ModelPre-Write Transaction Model
A pre-committed MT’s results are made visible at MH and MSSs before the final commit
Shifts the resource consuming part of the MT’s execution (updates of the database on disk) to the MSS
Pre-committed avoids costly undo or compensating action
MTs are serialized based on their pre-commit order.
04/19/23 14
Pre-Write Transaction ModelPre-Write Transaction Model (Few Examples) (Few Examples)
Example1: Long duration transaction Example1: Long duration transaction applicationapplication
““House-Construction” and “House-Buying” House-Construction” and “House-Buying” transactionstransactions““Model of House” as a prewriteModel of House” as a prewrite
Example2: Data Structure ApplicationExample2: Data Structure ApplicationRecord delete operator in HashingRecord delete operator in HashingStorage allocator and de-allocator to work Storage allocator and de-allocator to work concurrentlyconcurrently
04/19/23 15
Mobile Transaction Processing with Prewrites
Case1: MH has limited server capability
Start___Reads/Prewrite___Pre-commit____Writes_____Commit
Part of transaction Part of transaction
executed at MH executed at MSS
Example – News-reporter Transaction (real-time)
04/19/23 16
Mobile Transaction Processing with Prewrites
Case2:Case2: MH has very slow CPU and small memory; I/O device only
Examples – Image Retrieval Transaction, Stock Stock buying and selling buying and selling transactionstransactions
04/19/23 17
Pre-Write Transaction ModelPre-Write Transaction Model(Operation Compatibility Matrix)(Operation Compatibility Matrix)
Pre-read Read Pre-write Write
Pre-read Yes Yes No Yes
Read Yes Yes Yes No
Pre-write No Yes No Yes
Write Yes No Yes No
04/19/23 18
Pre-Write Transaction ModelPre-Write Transaction Model( Concurrent Operations)( Concurrent Operations)
Case 1Case 1: Suppose a pre-read is currently : Suppose a pre-read is currently being executed at MH and at the same time, being executed at MH and at the same time, the transaction that has announced the the transaction that has announced the prewrite values finally commits at MSSprewrite values finally commits at MSS
T1T1____________________r(x),pw(x)r(x),pw(x)______________pcpc_______ _______ w(x)w(x)______________c At MSSc At MSS
T2T2____ ____ pr(x) pr(x) __________ __________ c At MHc At MH
TimeTime
04/19/23 19
Pre-Write Transaction ModelPre-Write Transaction Model( Concurrent Operations)( Concurrent Operations)
Case 2Case 2: Consider a case where a read : Consider a case where a read transaction commits at MH after the transaction commits at MH after the transaction that announced the prewrite transaction that announced the prewrite operation, has been pre-committed.operation, has been pre-committed.
T1T1____________________r(x),pw(x)r(x),pw(x)______________pcpc______________w(x)w(x)________________c At MSSc At MSS T2T2____________________r(x)r(x)____________________c c At MHAt MH
TimeTime
04/19/23 20
Pre-Write Transaction ModelPre-Write Transaction Model( Multiversions versus Prewrites)( Multiversions versus Prewrites)
Two versions of data, Two versions of data, Prewrite and Write, Prewrite and Write, but different from multiversions of databut different from multiversions of data
Prewrite Prewrite – not a previous or old version, but is – not a previous or old version, but is rather a copy or abstract value of the future rather a copy or abstract value of the future write versionwrite version
Read – returns the current or abstract of current, Read – returns the current or abstract of current, not the old version of datanot the old version of data
No Validation phase, but new pre-committed No Validation phase, but new pre-committed phase where transaction doesn’t abortphase where transaction doesn’t abort
04/19/23 21
OverviewOverview
Mobile ArchitectureMobile ArchitectureConstraints in Mobile ComputingConstraints in Mobile ComputingTransactions in Mobile EnvironmentTransactions in Mobile EnvironmentRequirements for transaction model in Requirements for transaction model in Mobile EnvironmentMobile EnvironmentPre-Write Transaction ModelPre-Write Transaction ModelMulti-version Transaction ModelMulti-version Transaction ModelConclusionsConclusions
04/19/23 22
Multi-Version Transaction ModelMulti-Version Transaction Model
Mobile Transaction (MT) consists of three states of execution
Start state
Commit state
Termination state
04/19/23 23
Multi-Version Transaction Model Multi-Version Transaction Model (contd..)(contd..)
Improve concurrency of MTs by making use of Improve concurrency of MTs by making use of the time between the commitment of transaction at the time between the commitment of transaction at MH and the termination of transaction at MSSMH and the termination of transaction at MSS
04/19/23 24
Multi-Version Transaction Model Multi-Version Transaction Model (contd..)(contd..)
We make use of multiversions of data items, but We make use of multiversions of data items, but only two versionsonly two versions
X X jj00
X X kkts(k)ts(k)
X X jj00 , ,is the data version written by the mobile is the data version written by the mobile
transaction Ttransaction Tjj which has been terminated at MSSwhich has been terminated at MSS
X X kkts(k)ts(k),,is the data version written by Tis the data version written by Tkk that has that has
been committed at MH but is yet to be terminated been committed at MH but is yet to be terminated at MSSat MSS
04/19/23 25
Multi-Version Transaction Model Multi-Version Transaction Model (contd..)(contd..)
Two different cases of concurrency Two different cases of concurrency depending on the existence of versions of depending on the existence of versions of data itemsdata items
Case1: concurrent read-write access to increase Case1: concurrent read-write access to increase availabilityavailability
Case2: concurrent write-write access to Case2: concurrent write-write access to increase availabilityincrease availability
04/19/23 26
Multi-Version Transaction Model Multi-Version Transaction Model (contd..)(contd..)
Case1: concurrent read-write access to Case1: concurrent read-write access to increase availabilityincrease availability
04/19/23 27
Multi-Version Transaction Model Multi-Version Transaction Model (contd..)(contd..)
Case2: concurrent write-write access to Case2: concurrent write-write access to increase availabilityincrease availability
04/19/23 28
Multi-Version Transaction Model Multi-Version Transaction Model (contd..)(contd..)
04/19/23 29
Multi-Version Transaction Model Multi-Version Transaction Model (Locking Protocol)(Locking Protocol)
Different locks present for any particular Different locks present for any particular data item are:data item are:
Two read locksTwo read locks
Write lock , Write lock , wl(x) wl(x)
Verified lock, Verified lock, vl(x)vl(x)
The two read locks are:The two read locks are:rlrl =0 =0(x) ,(x) , for terminated data item version for terminated data item version X X jj
00
rl rl ≠0≠0(x), (x), for committed data item version for committed data item version X X kkts(k)ts(k)
04/19/23 30
Multi-Version Transaction Model Multi-Version Transaction Model (Locking Protocol contd..)(Locking Protocol contd..)
04/19/23 31
Multi-Version Transaction Model Multi-Version Transaction Model (Locking Protocol contd..)(Locking Protocol contd..)
04/19/23 32
Multi-Version Transaction Model Multi-Version Transaction Model (Locking Protocol contd..)(Locking Protocol contd..)
A read action RA read action Rii[X] on a data item X in transaction [X] on a data item X in transaction
TTii(either local on MSS or a remote one initiated by (either local on MSS or a remote one initiated by
MH) follows the locking protocol as follows:MH) follows the locking protocol as follows: TTii requests a read lock on the data item X. requests a read lock on the data item X.
MSS grants the rlMSS grants the rl00ii(X) or rl(X) or rl00
ii(X) read lock (X) read lock
corresponding to whether the version Xcorresponding to whether the version Xjj0 0 or version or version
XXkkts(k)ts(k)
Transaction TTransaction Tii reads the selected version of X after reads the selected version of X after
obtaining the corresponding read lock version.obtaining the corresponding read lock version.
04/19/23 33
Multi-Version Transaction Model Multi-Version Transaction Model (Locking Protocol contd..)(Locking Protocol contd..)
The write action wThe write action wii(X) on data item X in (X) on data item X in
transaction Ttransaction Tii at MH follows the following at MH follows the following
locking protocol:locking protocol:TTi i requests a write lock on data item Xrequests a write lock on data item X
MSS grants the wlMSS grants the wlii(X), the write lock on data (X), the write lock on data
item X, if there are no conflicts item X, if there are no conflicts
TTii creates a new version X creates a new version Xiits(i)ts(i) for data item X for data item X
04/19/23 34
Multi-Version Transaction Model Multi-Version Transaction Model ((Read and Write Rule Constraints contdRead and Write Rule Constraints contd..)..)
The The constraints satisfactionconstraints satisfaction is done at MSS each is done at MSS each time a MH request for a read or writes lock on a time a MH request for a read or writes lock on a data item.data item.
Constraint1:Constraint1:The read lock request on data item X by the transaction TThe read lock request on data item X by the transaction T ii (at MH (at MH
or at MSS) must satisfy: “or at MSS) must satisfy: “If there is any other transaction TIf there is any other transaction Tjj at at
MSS holding wlMSS holding wljj(X) lock, then timestamp(T(X) lock, then timestamp(Tjj) > timestamp (T) > timestamp (Tii)”.)”.
This condition checks for:This condition checks for:No read request is processed violating the Read rule.No read request is processed violating the Read rule.
Results automatically in maintaining serializability of transaction Results automatically in maintaining serializability of transaction execution at MSS and avoids cascade of abortsexecution at MSS and avoids cascade of aborts
04/19/23 35
Multi-Version Transaction Model Multi-Version Transaction Model (Read and Write Rule Constraints)(Read and Write Rule Constraints)
Constraint2: Constraint2:
The write lock request wlThe write lock request wlii(X) or verified lock request vl(X) or verified lock request vlii(X) for (X) for
transaction Ttransaction Tii (at MH or at MSS) must satisfy: (at MH or at MSS) must satisfy:
a)There does not exist any transaction at MSS holding wl(X) or vl(X) a)There does not exist any transaction at MSS holding wl(X) or vl(X) (verified lock); and for all transaction T(verified lock); and for all transaction T j j at MH that holds rlat MH that holds rl00
jj(X), the (X), the
timestamp(Ttimestamp(Tii) ) timestamp(T timestamp(Tjj)). .
b)If there is any other transaction T b)If there is any other transaction T kk at MSS holding vl at MSS holding vlkk(X) lock, then (X) lock, then
timestamp(Ttimestamp(Tkk) < timestamp (T) < timestamp (Tii), where T), where Tii is a requesting verified or is a requesting verified or
write-lock on Xwrite-lock on X
Transactions already having the read locks on previous version of data Transactions already having the read locks on previous version of data items are not made void by assigning a write lock or verified lock to items are not made void by assigning a write lock or verified lock to another transaction that comes after these transactions, thus avoiding another transaction that comes after these transactions, thus avoiding transaction abortstransaction aborts
04/19/23 36
ConclusionsConclusions
Use of multiversions of data items to Use of multiversions of data items to improve data availabilityimprove data availabilityConstraint checking before obtaining locksConstraint checking before obtaining locks
Avoids the deadlocksAvoids the deadlocksAvoids cascade of abortsAvoids cascade of abortsAvoids compensating transactions for recoveryAvoids compensating transactions for recovery
Working on the Simulation of the proposed Working on the Simulation of the proposed model to obtain real-time performance model to obtain real-time performance statisticsstatistics
04/19/23 37
Any QuestionsAny Questions