Let one of the sites say s be down when t 1 is

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

. 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
Image of page 3

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

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 Give anexample where lazy replicationcanlead toaninconsistent database 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 first 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 coordinator. Note that such a graph contains all the local information that the site has about the state of the real graph. The wait-for graph reflects an instantaneous state of the site, but it is not synchronized with respect to any other site.
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '13
  • Dr.Khansari
  • site, sites

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern