Exercise Solutions - Principles Of Distributed Database Systems
Given read and write operations from transactions T1, T2, T3 on data items X, Y, Z stored at different sites. Determine if the schedule is conflict-serializable and if the protocol would allow it.
Question: A distributed transaction T1: write(X) at site A, write(Y) at site B. T2: read(X) at A, read(Y) at B.
Explain deadlock possibility under 2PL without strict locking.
Solution:
Under Basic 2PL (locks held until commit, but released earlier for reads possible in some implementations):
But if locks are released after use (not strict), and T2 reads X after T1 released write-lock, T2 proceeds, then T1 still holds Y write-lock, T2 tries read-lock Y → deadlock. Given read and write operations from transactions T1,
Strict 2PL (all locks held until commit/abort) avoids this because T1 doesn’t release X lock before committing, so T2 can’t read X until T1 commits → no cycle.
One of the fundamental design problems is data distribution: how to split data across different nodes. There are two primary types of fragmentation: Horizontal (splitting by rows) and Vertical (splitting by columns).
In a distributed environment, 2PL requires that a transaction locks all items at all sites before unlocking any item. But if locks are released after use (not
Distributed Database Systems (DDBS) form the backbone of modern enterprises—from global banking networks to social media platforms. Yet, for computer science students and database professionals, the theoretical principles (fragmentation, replication, concurrency control, commit protocols) can feel abstract until you work through concrete exercises.
This article provides detailed exercise solutions and explanatory insights for the most common problem sets found in standard textbooks (e.g., Özsu & Valduriez’s Principles of Distributed Database Systems). Whether you are preparing for an exam or designing a resilient data architecture, these step-by-step solutions will solidify your understanding.
We will cover the following key areas:
Exercise: Given PROJECT(Pno, Pname, Budget, Location). Applications:
Solution:
Solution Strategy: Always start by identifying the primary key. For vertical, check that every attribute appears at least once. For horizontal, ensure predicates are complete and mutually exclusive. Exercise : Given PROJECT(Pno, Pname, Budget, Location)
Exercises on deadlock detection typically provide a global wait-for graph or local graphs per site.
A semi-join (R ⋉ S) projects the join attributes of S and ships only those to the site of R, reducing the size of R before shipping it for the full join.
