low cost commit protocols for mobile computing environments marc perron & baochun bai
TRANSCRIPT
![Page 1: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/1.jpg)
Low Cost Commit Protocols for Low Cost Commit Protocols for Mobile Computing Mobile Computing
EnvironmentsEnvironments
Marc Perron & Baochun Bai
![Page 2: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/2.jpg)
IntroductionIntroduction
Introduction to Mobile Database Environment
Commit Protocols Classical Two-Phase Commit Mobile Two-Phase Commit Optimistic Concurrency Control with Update Time Stamp
Conclusion : Which is better
![Page 3: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/3.jpg)
Mobile database environmentMobile database environment
Mobile networks are composed of cells. Similar to C/S environment.
Base station (Mobile Support Station) Mobile unit
Low bandwidth High error rate
![Page 4: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/4.jpg)
Mobile database environmentMobile database environment
Asymmetry in communication Downstream (server-to-client) bandwidth is high.
Using broadcast disk method to deliver data to client. Upstream (client-to-server) bandwidth is low.
High disconnection rate Power limitation
![Page 5: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/5.jpg)
Commit ProtocolsCommit Protocols
2-Phase Commit (2PC) Two phases: Prepare Phase and Commit Phase Logs are maintained on the base stations
Presumed Commit (PC) Optimized 2PC Reduces the number of exchanged messages and the
number of log
![Page 6: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/6.jpg)
Commit Protocols (Cont.)Commit Protocols (Cont.)
Early Prepare (EP) Eliminates a round messages by putting a transaction
into ready state as soon as it finishes processing the work part of the transaction.
WoundCertifier Certification report with ReadSet and WriteSet of
active transactions is broadcasting by server.
![Page 7: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/7.jpg)
Commit Protocols (Cont.)Commit Protocols (Cont.)
Batched Transaction Executes the entire transaction on the mobile unit
using cached copies of data. Optimistic Concurrency Control with Update
Time Stamp (OCC-UTS) Each data item has a timestamp. Invalidation report broadcast by server. Two versions (with or without local cache).
![Page 8: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/8.jpg)
Commit ProtocolsCommit Protocols
Focus on two commit protocols: Classical 2-Phase Commit
Presumed Commit Presumed Abort
Optimistic Concurrency Control with Update Time Stamp
![Page 9: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/9.jpg)
Classical 2PCClassical 2PC
In Mobile Environment, behaves essentially the same as in non-mobile distributed environments
A few differences arrise due to mobile nature: Mobile Client logs maintained on fixed network
Behaviour slightly modified to reduce messages sent over wireless link
![Page 10: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/10.jpg)
Classical 2PCClassical 2PC
Phase 1: Co-ordinator sends 'prepare' message to all participants to prepare them to commit the transaction
Phase 2: If all participants respond successfully to the prepare message, the co-ordinator globaly commits the transaction
![Page 11: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/11.jpg)
Classical 2PCClassical 2PC
Non-Mobile Database Environment Co-ordinator: The process at the site where the transaction originated. The execution controlled by this process
Participant: Processes at other sites participating in executing the transaction
![Page 12: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/12.jpg)
Classical 2PCClassical 2PC
In Mobile Computing Environment Mobile unit always co-ordinator Large number of messages over wireless link
Not all participants directly accessable from mobile units
![Page 13: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/13.jpg)
M-2PC (Mobile-2PC)M-2PC (Mobile-2PC)
Modifications to 2PC for mobile environment
Base station replaces mobile unit as transaction co-ordinator
Control of transaction handed off with state information
![Page 14: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/14.jpg)
M-2PCM-2PC
Participant State Diagram (MU)
![Page 15: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/15.jpg)
M-2PCM-2PC
State Diagram for co-ordinator/participant (FN)
![Page 16: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/16.jpg)
Optimistic Concurrency Control Optimistic Concurrency Control with Update Time Stampwith Update Time Stamp
On transaction commit, server verifies that execution is serializable.
Two forms of validation: Backward: Check if commiting transaction invalidated by commit of another.
Forward: Check if commiting transaction conflicts with any other active transaction.
![Page 17: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/17.jpg)
OCC-UTSOCC-UTS
Data has time stamp associated with it
Time stamps used to determine if transaction attempting commit is serializable
Mobile client checks transactional cache consistency using invalidation reports from server
![Page 18: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/18.jpg)
OCC-UTSOCC-UTS
Upon receiving commit operation: Mobile client sends RequestToCommit message
Mobile client listens to CommitList and AbortList to determine outcome of transaction
![Page 19: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/19.jpg)
OCC-UTSOCC-UTS
Server's algorithm Server keeps list of updated data items for transactions committed between tsi-L and tsi. : number of invalidation broadcast windows
L: Length of broadcast window tsi: most recent time stamp on a data item
![Page 20: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/20.jpg)
OCC-UTSOCC-UTS
Server receives RequestToCommit message
adds message to outsanding RequestToCommit queue
Takes a message m from queue If at least one data item in m has timestamp older than most recent, transaction is aborted
Otherwise transaction commited
![Page 21: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/21.jpg)
ConclusionConclusion
OCC-UTS takes advantage of broadcast disks
Requires fewer upstream messages on a wireless link
Less complex than M-2PC, transactions performed on local cached data
We conclude that OCC-UTS better than M-2PC for mobile computing environment
![Page 22: Low Cost Commit Protocols for Mobile Computing Environments Marc Perron & Baochun Bai](https://reader036.vdocuments.net/reader036/viewer/2022062517/56649f155503460f94c2a9d3/html5/thumbnails/22.jpg)
SummarySummary
Low Cost Commit Protocols for Mobile Computing Environments
Introduction
Commit Protocols
Two Phase Commit
Mobile-Two Phase Commit
Optimistic Concurrency Control with Update Timestamp
Conclusion