Transaction Models To Improve Data Availability in Mobile
Transaction Models To Improve Data Availability in Mobile Computing References: A Transaction Model to Improve Data Availability in Mobile Computing Sanjay Kumar Madria(madrias@umr. edu) Bharat Bhargava(bb@cs. purdue. edu) Multi-version Transaction Model to Improve Data Availability in Mobile Computing Presented by, Mohammed Abdul Baseer 12/29/2021 1
Overview Mobile Architecture Constraints in Mobile Computing Transactions in Mobile Environment Requirements for transaction model in Mobile Environment Pre-Write Transaction Model Multi-version Transaction Model Conclusions 12/29/2021 2
Mobile Architecture 12/29/2021 3
Constraints of Mobile Computing Wireless communication Low bandwidth Frequent disconnections – voluntary, not failure High bandwidth variability Monetarily expensive Asymmetric communication between MH and MSS 12/29/2021 4
Constraints of Mobile Computing (contd. . ) Unreliable communication Mobility MH has the ability to move MSS is overloaded Address migration, ”hands off process” Termination of communication with current MSS Establishment of communication with new MSS Changing the N/W routing to reflect new MSS 12/29/2021 5
Transactions in Mobile Environment Mobile transactions are different from their counterparts in centralized or distributed environments 12/29/2021 6
Transactions in Mobile Environment (contd. . ) Long lived transactions- mobility of users, data and frequent disconnections Might have to split- some operations need to be executed at MH and some at MSS Need to share their states and partial results, “hands off process” Require communications and computations to be supported by MSS 12/29/2021 7
Transactions in Mobile Environment (contd. . ) As MH moves from one cell to another, the states of transaction, states of previously accessed data, location information etc. . Also move Need to support and handle – concurrency, recovery, disconnection and mutual consistency of replicated data. 12/29/2021 8
Requirements for Transaction Model in Mobile Environment Support the limitations of mobile computing Minimize transaction aborts due to disconnection Ensure the correctness of operations on shared data both at MH and MSS Minimize blocking transactions, to reduce concurrency and communication cost rise 12/29/2021 9
Different Scenarios for Executing Mobile Transactions Mobile transaction processing can be structured in one of the three ways: Mobile host (MH) as I/O device Mode of operation – MH submits transaction, MSS executes and sends back results Complete Database Server (DBS) on the MH Unrealistic Data inconsistent with that present on MSS Mobile host with Cached data 12/29/2021 10
Pre-Write Transaction Model A transaction is a partial order of some read and write operations on different data items. Mobile transactions 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 12/29/2021 11
Pre-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 12/29/2021 12
Pre-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. 12/29/2021 13
Pre-Write Transaction Model (Few Examples) 1. Example 1: Long duration transaction application 1. “House-Construction” and “House. Buying” transactions 2. “Model of House” as a prewrite 2. Example 2: Data Structure Application 1. Record delete operator in Hashing 2. Storage allocator and de-allocator to work concurrently 12/29/2021 14
Mobile Transaction Processing with Prewrites Case 1: MH has limited server capability Start___Reads/Prewrite___Pre-commit____Writes_____Commit Part of transaction executed at MH Part of transaction executed at MSS Example – News-reporter Transaction (realtime) 12/29/2021 15
Mobile Transaction Processing with Prewrites Case 2: MH has very slow CPU and small memory; I/O device only Examples – Image Retrieval Transaction, Stock buying and selling transactions 12/29/2021 16
Pre-Write Transaction Model (Operation Compatibility Matrix) Pre-read Read Pre-write Write Pre-read Yes No Yes Read Yes Yes No Pre-write No Yes Write Yes No 12/29/2021 17
Pre-Write Transaction Model ( Concurrent Operations) Case 1: Suppose a pre-read is currently being executed at MH and at the same time, the transaction that has announced the prewrite values finally commits at MSS T 1_____r(x), pw(x)_______pc_______ w(x)_______c At MSS T 2____ pr(x) _____ c At MH Time 12/29/2021 18
Pre-Write Transaction Model ( Concurrent Operations) Case 2: Consider a case where a read transaction commits at MH after the transaction that announced the prewrite operation, has been pre-committed. T 1_____r(x), pw(x)_______pc_______w(x)____c T 2_____r(x)_____c At MSS At MH Time 12/29/2021 19
Pre-Write Transaction Model ( Multiversions versus Prewrites) Two versions of data, Prewrite and Write, but different from multiversions of data Prewrite – not a previous or old version, but is rather a copy or abstract value of the future write version Read – returns the current or abstract of current, not the old version of data No Validation phase, but new pre-committed phase where transaction doesn’t abort 12/29/2021 20
Overview Mobile Architecture Constraints in Mobile Computing Transactions in Mobile Environment Requirements for transaction model in Mobile Environment Pre-Write Transaction Model Multi-version Transaction Model Conclusions 12/29/2021 21
Multi-Version Transaction Model Mobile Transaction (MT) consists of three states of execution Start state Commit state Termination state 12/29/2021 22
Multi-Version Transaction Model (contd. . ) Improve concurrency of MTs by making use of the time between the commitment of transaction at MH and the termination of transaction at MSS 12/29/2021 23
Multi-Version Transaction Model (contd. . ) We make use of multiversions of data items, but only two versions X j 0 X kts(k) X j 0 , is the data version written by the mobile transaction Tj which has been terminated at MSS X kts(k), is the data version written by Tk that has been committed at MH but is yet to be terminated at MSS 12/29/2021 24
Multi-Version Transaction Model (contd. . ) Two different cases of concurrency depending on the existence of versions of data items Case 1: concurrent read-write access to increase availability Case 2: concurrent write-write access to increase availability 12/29/2021 25
Multi-Version Transaction Model (contd. . ) Case 1: concurrent read-write access to increase availability 12/29/2021 26
Multi-Version Transaction Model (contd. . ) Case 2: concurrent write-write access to increase availability 12/29/2021 27
Multi-Version Transaction Model (contd. . ) 12/29/2021 28
Multi-Version Transaction Model (Locking Protocol) Different locks present for any particular data item are: Two read locks Write lock , wl(x) Verified lock, vl(x) The two read locks are: rl =0(x) , for terminated data item version X j 0 rl ≠ 0(x), for committed data item version X kts(k) 12/29/2021 29
Multi-Version Transaction Model (Locking Protocol contd. . ) 12/29/2021 30
Multi-Version Transaction Model (Locking Protocol contd. . ) 12/29/2021 31
Multi-Version Transaction Model (Locking Protocol contd. . ) A read action Ri[X] on a data item X in transaction Ti(either local on MSS or a remote one initiated by MH) follows the locking protocol as follows: Ti requests a read lock on the data item X. MSS grants the rl 0 i(X) or rl 0 i(X) read lock corresponding to whether the version Xj 0 or version Xkts(k) Transaction Ti reads the selected version of X after obtaining the corresponding read lock version. 12/29/2021 32
Multi-Version Transaction Model (Locking Protocol contd. . ) The write action wi(X) on data item X in transaction Ti at MH follows the following locking protocol: Ti requests a write lock on data item X MSS grants the wli(X), the write lock on data item X, if there are no conflicts Ti creates a new version Xits(i) for data item X 12/29/2021 33
Multi-Version Transaction Model (Read and Write Rule Constraints contd. . ) The constraints satisfaction is done at MSS each time a MH request for a read or writes lock on a data item. Constraint 1: The read lock request on data item X by the transaction Ti (at MH or at MSS) must satisfy: “If there is any other transaction Tj at MSS holding wlj(X) lock, then timestamp(Tj) > timestamp (Ti)”. This condition checks for: No read request is processed violating the Read rule. Results automatically in maintaining serializability of transaction execution at MSS and avoids cascade of aborts 12/29/2021 34
Multi-Version Transaction Model (Read and Write Rule Constraints) Constraint 2: The write lock request wli(X) or verified lock request vli(X) for transaction Ti (at MH or at MSS) must satisfy: a)There does not exist any transaction at MSS holding wl(X) or vl(X) (verified lock); and for all transaction Tj at MH that holds rl 0 j(X), the timestamp(Ti) timestamp(Tj). b)If there is any other transaction T k at MSS holding vlk(X) lock, then timestamp(Tk) < timestamp (Ti), where Ti is a requesting verified or write lock on X 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 another transaction that comes after these transactions, thus avoiding transaction aborts 12/29/2021 35
Conclusions Use of multiversions of data items to improve data availability Constraint checking before obtaining locks Avoids the deadlocks Avoids cascade of aborts Avoids compensating transactions for recovery Working on the Simulation of the proposed model to obtain real-time performance statistics 12/29/2021 36
Any Questions 12/29/2021 37
- Slides: 37