Answer consider the balance in an account replicated

Info iconThis preview shows pages 3–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Answer: Consider the balance in an account, replicated at N sites. Let the current balance be $100 – consistent across all sites. Consider two trans- actions T 1 and T 2 each depositing $10 in the account. Thus the balance would be $120 after both these transactions are executed. Let the transac- tions execute in sequence: T 1 Frst and then T 2 . Let one of the sites, say s , be down when T 1 is executed and transaction t 2 reads the balance from site s . One can see that the balance at the primary site would be $110 at the end. 19.7 Explain the difference between data replication in a distributed system and the maintenance of a remote backup site. Answer: In remote backup systems all transactions are performed at the primary site and the data is replicated at the remote backup site. The
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 Chapter 19 Distributed Databases remote backup site is kept synchronized with the updates at the primary site by sending all log records. Whenever the primary site fails, the remote backup site takes over processing. The distributed systems offer greater availability by having multiple copies of the data at different sites whereas the remote backup systems offer lesser availability at lower cost and execution overhead. In a distributed system, transaction code runs at all the sites whereas in a remote backup system it runs only at the primary site. The distributed system transactions follow two-phase commit to have the data in con- sistent state whereas a remote backup system does not follow two-phase commit and avoids related overhead. 19.8 Giveanexamplewherelazyreplicationcanleadtoaninconsistentdatabase state even when updates get an exclusive lock on the primary (master) copy. Answer: Consider the balance in an account, replicated at N sites. Let the current balance be $100 – consistent across all sites. Consider two trans- actions T 1 and T 2 each depositing $10 in the account. Thus the balance would be $120 after both these transactions are executed. Let the trans- actions execute in sequence: T 1 Frst and then T 2 . Suppose the copy of the balance at one of the sites, say s , is not consistent – due to lazy replication strategy – with the primary copy after transaction T 1 is executed and let transaction T 2 read this copy of the balance. One can see that the balance at the primary site would be $110 at the end. 19.9 Consider the following deadlock-detection algorithm. When transaction T i , at site S 1 , requests a resource from T j , at site S 3 , a request message with timestamp n is sent. The edge ( T i , T j , n ) is inserted in the local wait-for graph of S 1 . The edge ( T i , T j , n ) is inserted in the local wait-for graph of S 3 only if T j has received the request message and cannot immediately grant the requested resource. A request from T i to T j in the same site is handled in the usual manner; no timestamps are associated with the edge ( T i , T j ). A central coordinator invokes the detection algorithm by sending an initiating message to each site in the system. On receiving this message, a site sends its local wait-for graph to the
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page3 / 8

Answer Consider the balance in an account replicated at N...

This preview shows document pages 3 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online