Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Sample questions on Distributed Database

CSE 512/CSE411 Summer 2018

Given the following sites and data items

Sites Data item


S1 ABCD
S2 AB
S3 CD
S4 BC
S5 D
S6 C

A transaction is given as follows:

T1 at site 1:
Read (B)
B= B+1000
Write (B)
Commit

1. What are the responsibilities of transaction manager and transaction coordinator of site 1
for this transaction?
2. Explain in your own word, how is the commit performed?
3. Show in a diagram how is commit performed when all sites agree to commit using 2 phase
COMMIT protocol. Write the log records of the coordinator. Write the log records of any
other site participating in the transaction.
4. Show in a diagram how is abort performed when one site do not agree to commit. Write the
log records of the coordinator. Write the log records of site not agree to commit the
transaction.
5. For a transactions T2: Read( C ) at site S2 and T3: Write (C ) at site S3, how can the
transactions be granted lock-S and Lock-X in majority protocol? Find the minimum number
of messages.
6. For a transactions T2: Read( C ) and T3: Write (C ), how can the transactions be granted lock-
S and Lock-X in primary copy protocol if S1 is the primary site? Find the minimum number of
messages.
7. How can you generate unique time stamp in distributed database system? How can you
solve the problem slow or fast local clocks or counters?
8. There are transactions T1, T2, T3, T4 and T5 and the local wait-for graphs of sites are given
as follows. The coordinator is S1. Construct the global wait-for graph at S1 and comment on
deadlock.

S3
T5 T4 T5
S2 S6 S7

T1 T2 T2 T3
T1 T3 T3 T4

9. Given relations and the corresponding sites as follows.

Relation schema DDL Site No. of tuples


Project (p-id, name, budget) Create table project ( S1 1000
p-id char(10) primary key,
name varchar2(50)
budget number (10, 2))

Employee (e-id, name, street, Create table employee ( S2 10000


city, salary) e-id char(10) primary key,
name varchar2(50),
street varchar2(30),
city varchar2(30),
salary number (10, 2))

Works-for(e-id, p-id, start- Create table works-for ( S3 500000


date, end-date) e-id char(10),
p-id char(10),
s-date date, e-date date)

Find the query cost ignoring CPU and disk costs (only transmission cost) for the queries as
follows.

a. Project ⋈ works-for ⋈ employee at site S1


b. Project ⋈ works-for ⋈ employee at site S2
c. Project ⋈ works-for ⋈ employee at site S3

Consider the following cases:


i. Transfer all relations in query originating site
ii. Transfer relations in sequential order e.g., S1 → S2 → S3→S1

10: Find the query cost ignoring CPU and disk costs (only transmission cost) for the queries as
follows using semi-join operation.

a. Project ⋈ works-for at site S1


b. works-for ⋈ employee at site S3
c. employee ⋈ works-for at site S2

Show the steps of semi-join operations.

You might also like