Principles Of Distributed Database Systems Exercise Solutions
In a distributed environment, 2PL requires that a transaction locks all items at all sites before unlocking any item.
Exercise: Fragment F1: 100 queries from site A, 10 from B, 0 from C. Updates: 5 from A, 20 from B, 0 from C. Cost of remote read=1, remote write=10. Local read=0, local write=0 (costs). Find allocation. In a distributed environment, 2PL requires that a
Solution:
Replication decision: If update cost is low, replicate to A and B to reduce reads. Here updates from B are high (20 writes), so replicating at B and A would increase update cost (writes to 2 copies). So no replication. Replication decision : If update cost is low,
Solution Strategy: Compute total weighted cost for each candidate site. Use the formula: Total cost = Σ (reads_from_other_site × read_cost) + Σ (updates_from_other_site × update_cost). Choose site with lowest cost. with R+W >
You have a replicated data item across 5 sites (S1..S5). A quorum consensus protocol requires R readers and W writers, with R+W > N. Given failures or network partitions, determine if reads/writes succeed.
Always begin solutions by explicitly listing: