Principles Of Distributed Database Systems Exercise Solutions ((new))

T1’s write is rejected (rolled back/restarted) because a later transaction already wrote D.

Relation Orders(OrderID, CustID, Amount) at site X (10,000 tuples). Relation Customers(CustID, Name, City) at site Y (5,000 tuples). Query: find orders from customers in ‘Paris’. Write a semi-join to reduce transmission.

If any peer has received an ABORT or COMMIT from the coordinator before it crashed, that decision is safely adopted by all.

In wide-area networks, the network transfer cost dominates the equation.

Compare the cost of:

Before sending messages over the network, both the coordinator and participants must write state transitions to a write-ahead log (WAL) on stable storage.

The 2PC protocol relies on a coordinator and multiple participants.

We construct the Local Wait-For Graphs (LWFG) and combine them into a Global Wait-For Graph (GWFG).

When comparing centralized and distributed databases, their fundamental difference lies in architecture. Both need to ensure data persistence and provide standard query interfaces. However, a distributed system uses multiple nodes to collaborate, offering better scalability but introducing network latency and challenges such as fragmentation and replica consistency. T1’s write is rejected (rolled back/restarted) because a

Explain how a Wait-Die scheme prevents deadlocks in a distributed system compared to a Wound-Wait scheme. Show what happens when an older transaction Toldcap T sub o l d end-sub requests a lock held by a younger transaction Tyoungcap T sub y o u n g end-sub Solution & Conceptual Breakdown

Employee=Employee1∪Employee2∪Employee3Employee equals Employee sub 1 union Employee sub 2 union Employee sub 3

Older transaction waits for younger, younger dies. Wound-Wait: Older transaction "wounds" (preempts) younger. 4. Reliability and the Two-Phase Commit (2PC)

can safely deduce that it did not cast an affirmative vote to the coordinator. P3cap P sub 3 Query: find orders from customers in ‘Paris’

One site manages all locks. Simple, but a single point of failure.

Payload1=|ΠA(S)|×Size(A)=500×4 bytes=2,000 bytesPayload sub 1 equals the absolute value of cap pi sub cap A open paren cap S close paren end-absolute-value cross Size open paren cap A close paren equals 500 cross 4 bytes equals 2 comma 000 bytes At Site 1, compute the semi-join: . This filters out all tuples in that do not match any value of present in .Assuming a selectiveness factor where only 's tuples match the distinct values:

In a distributed environment, 2PL requires that a transaction locks all items at all sites before unlocking any item.