Relication&Distributed Transaction_4.pdf

abeeralmarboa134 7 views 14 slides Oct 31, 2025
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

Relication&Distributed


Slide Content

Arelationorfragmentofarelationisreplicatedifitis
storedredundantlyintwoormoresites.
Fullreplicationofarelationisthecasewherethe
relationisstoredatallsites.
Fullyredundantdatabasesarethoseinwhichevery
sitecontainsacopyoftheentiredatabase.
Data Replication

Data Replication
Advantages of Replication
Availability:failureofsitecontainingrelationrdoesnotresultin
unavailabilityofrifreplicasexist.
Parallelism:queriesonrmaybeprocessedbyseveralnodesin
parallel.
Reduceddatatransfer:relationrisavailablelocallyateachsite
containingareplicaofr.
Disadvantages of Replication
Increased cost of updates: each replica of relation r must be updated.
Increased complexity of concurrency control: concurrent updates to
distinct replicas may lead to inconsistent data unless special
concurrency control mechanisms are implemented.
One solution: choose one copy as primary copy and apply
concurrency control operations on primary copy

Properties of Transactions

Distributed Requests and Distributed Transactions
Remoterequest
LetsasingleSQLstatementaccessdatatobe
processedbyasingleremotedatabaseprocessor.
Remotetransaction
Accessesdataatasingleremotesite.

Distributed Requests and Distributed Transactions
(continued)
Distributed transaction
Allows a transaction to reference several different
(local or remote) DP sites
Distributed request
Lets a single SQL statement reference data located at
several different local or remote DP sites

Distributed Requests and Distributed Transactions
(continued)

Distributed Requests and Distributed Transactions
(continued)

Distributed Requests and Distributed Transactions
(continued)

Distributed Requests and Distributed Transactions
(continued)

Distributed Requests and Distributed Transactions
(continued)

Transactions in a Distributed Environment
More complicated
Example: A money transfer involving two
accounts, maintained in two separate and
remote databases

Commit Transaction
Commit signals a successful end-of-
transaction. It declares:
A logical unit of work has been
successfully completed.
The database is in a consistent state.
All of the updates made by that unit of work
can now be “committed” or made
permanent

Transactions in a Distributed
Environment
Rollback Transaction
ARollbacksignalsanunsuccessfulend-of-operation.
Itdeclares:
Somethinghasgonewrong.
Thedatabasemightbeinaninconsistentstate.
Alloftheupdatesmadebythatlogicalunitofworkso
farmustbe“rolledback”orundone

Transactions in a Distributed
Environment
The Two-PhaseCommit
Oneoftheparticipantsisdesignatedasthe
coordinatorofthe2-phasecommitprocess.
Thepreparephase:Thecoordinatoraskseach
participanttosignaltheirreadinesstocommit.
Thecommitphase:thecoordinatorbroadcaststhe
commitsignaltoalltheparticipants.