Showing posts with label Distributed Database Questions. Show all posts
Showing posts with label Distributed Database Questions. Show all posts

Thursday, December 31, 2020

Quiz questions and answers in distributed database MCQ 08

Distributed database quiz questions with answers, MCQ in distributed database, solved exam questions in distributed database, distributed transaction processing, two phase commit protocol

Multiple Choice Questions with Answers in Distributed Database

Let us suppose that there are a transaction coordinator Tc and two participants P1 and P2. They are working on a transaction T1.

[Refer here to understand more and to answer – 2PC protocol]

 

1. Which of the following will happen after the following sequence of events is completed as per Two Phase Commit (2PC) protocol?

TC sends <Prepare T1> to P1 and P2.

P1 sends <Ready T1> to TC.

P2 sends <Ready T1> to TC.

a) TC sends <Commit T1> to P1.

b) TC sends <Commit T1> to P2.

c) TC sends <Abort T1> to P1.

d) TC sends <Abort T1> to P2.

Answer: (a) TC sends <Commit T1> to P1 and (b) TC sends <Commit T1> to P2

It is given that the transaction coordinator sent a prepare message to all the participating sites and in-turn the participants responded with ready message.

If all the participating sites are responded with ready message (these responses only known to coordinator at this moment), then the coordinator sends the commit message to all the participants.

 

2. Which of the following will happen after the following sequence of events is completed as per 2PC?

TC sends <Prepare T1> to P1 and P2.

P1 sends <Ready T1> to TC.

P2 sends <Ready T1> to TC.

P2 crashed after sending <Ready T1> to TC.

P2 recovered immediately after crash.

a) TC sends <Commit T1> to P1 and P2

b) TC sends <Abort T1> to P1 and P2.

c) TC sends <Commit T1> only to participant P1.

d) TC sends <Abort T1> only to participant P2.

Answer: (a) TC sends <Commit T1> to P1 and P2

It is given that the transaction coordinator sent a prepare message to all the participating sites and in-turn all the participants responded with ready message. After that P2 crashed and recovered. We can understand that the crash and recovery happened before the coordinator responds.

Whether the participating sites crashed or not, the coordinator will respond based on the messages it received from the participating sites. Hence, in this case, Tc will send the commit message to all the participants.

 

3. After the event “TC sends <Prepare T1> to P1 and P2, P1 decides to commit transaction T1. Which of the following is true about P1 with respect to 2PC protocol?

a) P1 sends <Ready T1> to TC and then writes <Ready T1> into its local log

b) P1 writes <Ready T1> into its local log and then sends <Ready T1> to TC

c) P1 sends <Ready T1> to TC and then writes <Commit T1> into its local log

d) P1 writes <Commit T1> into its local log and then sends <Ready T1> to TC

Answer: (b) P1 writes <Ready T1> into its local log and then sends <Ready T1> to TC

In 2PC, if a participating site decided to commit or abort, it has to first register the decision into local log file, flush the log file into disk and then reply with the appropriate message to the coordinator site.

 

4. Which of the following will happen if P2 is not ready to commit T1 after the following events?

TC sends <Prepare T1> to P1 and P2.

P1 sends <Ready T1> to TC.

a) P2 sends <Commit T1> to Tc.

b) P2 writes <Abort T1> to its local log and sends <Abort T1> to Tc.

c) P2 writes <Abort T1> to its local log and sends <Abort T1> to Tc and P1.

d) P2 writes <No T1> to its local log and sends <Abort T1> to TC.

Answer: (d) P2 writes <No T1> to its local log and sends <Abort T1> to TC

According to 2PC, if a participating site has decided not to commit, it has to write <No T> message into its log and send <Abort T> to the transaction coordinators.

 

5. Which of the following will happen after the following sequence of events is completed as per Two Phase Commit (2PC) protocol?

TC sends <Prepare T1> to P1 and P2.

P1 sends <Ready T1> to TC.

P2 sends <Abort T1> to TC.

a) TC sends <Commit T1> to P1 and P2

b) TC sends <Abort T1> to P1 and P2.

c) TC sends <Commit T1>, only to participant P1.

d) TC sends <Abort T1>, only to participant P2.

Answer: (b) TC sends <Abort T1> to P1 and P2

It is given that the transaction coordinator sent a prepare message to all the participating sites. One of the sites is not ready to commit the transaction. In this case, the coordinator has to abort the transaction and inform all the participating sites to abort T1.

 

**********

Related links:



Distributed database multiple choice questions with answers

important quiz questions in DDB

important GATE exam questions in distributed database

University exam questions in distributed database

messages handled by 2 phase commit 2PC protocol

prepare, commit, abort and no messages in two phase commit protocol

Sunday, November 8, 2020

Quiz questions and answers in distributed database MCQ 07

Distributed database quiz questions with answers, MCQ in distributed database, solved exam questions in distributed and parallel database, distributed query processing, data replication

Multiple Choice Questions with Answers in Distributed Database

 

1. In distributed query processing, which of the following layer activities are performed by central control site?

a) Query decomposition

b) Data localization

c) Global optimization

d) Distributed execution

Click here to view answer


 

2. Which of the following is NOT a step of query decomposition layer in distributed query processing?

a) Normalized query is analyzed semantically

b) Semantically correct query is simplified

c) Simplified calculus query is restructured as an algebraic query

d) The algebraic query is executed by the local sites

Click here to view answer


 

3. Which of the following is/are NOT locking protocols used in distributed DBMS environment?

a) Centralized 2PL

b) Primary copy 2PL

c) Rigorous 2PL

d) Majority locking based 2PL

Click here to view answer


 

4. Let us assume that in 2PC protocol a transaction coordinator failed after a decision is taken (to abort/commit) and shared among the participating sites. What should the coordinator do during restart (recovery)?

a) Abort the transaction in any case

b) Commit the transaction in any case

c) Commit/abort only if received all acknowledgements from participating sites

d) Cannot be decided by the coordinator on what to be done

Click here to view answer


 

5. Which of the following is NOT an advantage of data replication in distributed database?

a) Fast access to shared data

b) High availability

c) Reduced network traffic

d) Easy updating of data items

Click here to view answer


 

**********

Related links:



Distributed database multiple choice questions with answers

important quiz questions in DDB

one mark questions in distributed database for university examinations

Why update is a complex operation in data replication distributed database strategy

Steps to be taken during recovery as per 2 phase commit 2PC

List down the steps involved in distributed database query processing

 

Tuesday, April 21, 2020

Multiple choice interview questions on distributed database

Multiple choice interview questions on distributed database


Multiple Choice Questions with Answers in Distributed Database



1. Which of the following would improve the availability of resources especially for reading in a distributed database system?
a) Fragmentation of database
b) Replication of database
c) Defragmentation of database
d) Tuning of database

View Answer

Answer: (b) Replication of database
Replication in distributed database system is a concept of having multiple copies of same data at different sites to increase the availability of resources.

2. ______________ is very much required to process a query in a distributed database.
a) Global System Catalog
b) Database Views
c) Triggers
d) None of the above

View Answer

Answer: (a) Global System Catalog
Data dictionary is an important component in DBMS. It is used for manipulating information regarding all database components in a DBMS. It stores information regarding tables, views, name of the tables, attributes, constraint details etc. Global System Catalog is just like Data Dictionary for Distributed Database System. It stores information like what and where about the data in a DDB.

3. Reliability and availability of a “Centralized Data Allocation” method is ___________ when compared to a “Completely Replicated Data Allocation“.
a) Highest
b) Average
c) Lowest
d) Not applicable

View Answer

Answer: (c) Lowest
Replication in distributed database system is a concept of having multiple copies of same data at different sites to increase the availability of resources.
In a centralized data allocation method only one copy of data available. Hence, availability is lowest. Due to only one copy of data, it is prone to single point of failure.
In a completely replicated data allocation method, due to availability of more than one copy of same data, the reliability and availability is high compare to centralized data allocation method.

4. If one site ABORTs while processing part of a distributed transaction t, all other sites processing part of t will also ABORT t. Which of the following ensures this?
a) Two phase locking protocol
b) Two phase commit protocol
c) Three phase commit protocol
d) All of the above

View Answer

Answer: (b) Two phase commit protocol
In two phase commit protocol, the transaction coordinator decides to ABORT the entire transaction if any of the participating sites cannot commit for some reasons.

5. Which of the following transparencies in distributed database design requires the end user or programmer to specify the database fragment names but need not specify where these fragments are located?
a) Transaction
b) Location
c) Local mapping
d) Fragmentation

View Answer

Answer: (b) Location
Location transparency refers to the fact that the command used to perform a task is independent of both the location of the data and the system on which an operation is carried out.



**********

Related links:





Distributed database multiple choice questions with answers

important quiz questions in DDB

one mark questions in distributed database for university examinations



Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery