Section A — 1 Mark Questions
1. Define a Distributed Database. [1 Mark]
Answer: A distributed database is a collection of multiple, logically interrelated databases distributed over a computer network.
2. What is the primary purpose of data fragmentation? [1 Mark]
Answer: To improve database performance by storing data closer to the site where it is most frequently accessed.
3. Name the two main types of horizontal fragmentation. [1 Mark]
Answer: Primary horizontal fragmentation and derived horizontal fragmentation.
4. What is data replication? [1 Mark]
Answer: Data replication is the process of storing copies of the same data at multiple sites in a distributed system.
5. Define a Homogeneous Distributed Database. [1 Mark]
Answer: A system where all sites use the same database management system software and data models.
6. What is a Heterogeneous Distributed Database? [1 Mark]
Answer: A system where different sites may run different database management software and have different data schemas.
7. What does the term 'Allocation' refer to in distributed databases? [1 Mark]
Answer: Allocation refers to the decision-making process of choosing the site(s) where specific data fragments should be stored.
8. What is the core purpose of a Semi Join operation? [1 Mark]
Answer: It is used to minimize the amount of data transmitted between sites during a join operation in a distributed environment.
9. What is a distributed transaction? [1 Mark]
Answer: A transaction that accesses and updates data at multiple sites within a distributed database system.
10. Define Vertical Fragmentation. [1 Mark]
Answer: A technique where a relation is decomposed by grouping subsets of its attributes into different fragments.
11. What is the main advantage of data replication? [1 Mark]
Answer: It increases availability and reliability of the data if one site fails.
12. What does 'Data Transparency' mean? [1 Mark]
Answer: It means the user does not need to know where the data is physically stored or how it is fragmented.
13. Is a heterogeneous system harder to manage than a homogeneous one? [1 Mark]
Answer: Yes, because it involves integrating data from different types of database systems.
14. What is a fragment in a distributed database? [1 Mark]
Answer: A fragment is a logical unit of data that results from dividing a database relation.
15. What does a 'Global Schema' represent? [1 Mark]
Answer: It represents the integrated logical view of all the data present in the distributed system.
16. Does replication improve query processing speed? [1 Mark]
Answer: Yes, by allowing queries to be processed at local sites rather than requiring remote access.
17. What is the trade-off of high data replication? [1 Mark]
Answer: It increases the complexity and cost of maintaining consistency across all copies during updates.
18. Name one requirement for a distributed transaction to be ACID compliant. [1 Mark]
Answer: Atomicity, which ensures that all parts of the transaction succeed or none do.
19. What is the purpose of fragmentation schemas? [1 Mark]
Answer: To define how a global relation is divided into smaller, manageable fragments.
20. Can an attribute exist in two vertical fragments? [1 Mark]
Answer: Yes, the primary key must be repeated in each vertical fragment to allow for reconstruction of the original relation.
Section B — 2/3 Mark Questions
1. Differentiate between Horizontal and Vertical fragmentation. [2 Marks]
Answer: Horizontal fragmentation divides a table into subsets of rows based on selection conditions, whereas Vertical fragmentation divides a table into subsets of columns by grouping related attributes.
2. Explain the role of the Semi Join operation in distributed query processing. [3 Marks]
Answer: 1. It restricts the data transmitted between sites. 2. A projection of the join attribute is sent from one site to another to identify matching rows. 3. Only the matching rows are then transferred, significantly reducing network traffic compared to a full join.
3. What are the primary advantages of replication in distributed databases? [2 Marks]
Answer: 1. Increased Reliability: If one site fails, the data remains available at another site. 2. Improved Performance: Queries can be satisfied by accessing local copies, reducing network latency.
4. Why is transaction management complex in distributed databases? [3 Marks]
Answer: 1. Data is scattered across multiple locations, requiring coordination. 2. Ensuring Atomicity requires distributed protocols like Two-Phase Commit. 3. Maintaining consistency across all sites during concurrent updates is challenging and resource-intensive.
5. Distinguish between Homogeneous and Heterogeneous distributed systems. [2 Marks]
Answer: Homogeneous systems use the same database software at every site, making integration simpler. Heterogeneous systems use different database software (e.g., SQL and NoSQL), requiring complex middleware for data translation.
6. Explain the concept of derived horizontal fragmentation. [3 Marks]
Answer: 1. It is defined based on the fragmentation of another relation. 2. It is typically used in join relationships where a child table is fragmented based on the fragmentation of its parent table. 3. This ensures that related records are stored at the same site, optimizing join performance.
7. List two main responsibilities of the Distributed Database Management System (DDBMS). [2 Marks]
Answer: 1. Location Transparency: Hiding the physical storage details of data from users. 2. Distributed Query Optimization: Selecting the most efficient way to execute queries across multiple sites.
8. State three challenges associated with distributed data storage. [3 Marks]
Answer: 1. Data consistency across multiple replicas. 2. Increased communication overhead due to network latency. 3. Complexity in designing efficient fragmentation and allocation schemas to balance the load.
9. What is a distributed deadlock? [2 Marks]
Answer: A distributed deadlock occurs when transactions at different sites are waiting for resources held by each other in a cyclic dependency, where no transaction can proceed.
10. Explain the goal of data allocation. [3 Marks]
Answer: 1. To place fragments at sites where they are most accessed. 2. To minimize the cost of data transfer and query processing. 3. To balance the storage load across different physical nodes in the network.
Section C — 5 Mark Questions
1. Explain the concept of Data Fragmentation and its types in detail. [5 Marks]
Answer:
Introduction
Data fragmentation is the process of breaking down a large global database relation into smaller pieces called fragments. These fragments are then distributed across various sites in a network to enhance performance and availability.
Types of Fragmentation
- Horizontal Fragmentation: This involves dividing a relation by selecting subsets of rows based on specific criteria. Each fragment contains the same columns but different rows. It is essential for ensuring data is stored at sites where those specific rows are most frequently accessed.
- Vertical Fragmentation: This decomposes a relation by grouping related attributes (columns) into separate fragments. The primary key is included in each fragment to allow for the reconstruction of the original table via a join. This is useful when different applications require only a subset of the attributes of a record.
- Hybrid Fragmentation: This is a combination of both horizontal and vertical fragmentation, where a relation is first fragmented vertically and then further fragmented horizontally (or vice versa).
2. Discuss the importance of replication and its management challenges. [5 Marks]
Answer:
Importance of Replication
Replication involves maintaining multiple copies of the same data fragment at different sites. This is vital for distributed systems to ensure high availability, fault tolerance, and improved query response times by providing local access to data.
Challenges of Replication
- Consistency Maintenance: When a piece of data is updated at one site, the system must ensure that all replicas are updated to reflect the same information, which is a complex synchronization process.
- Increased Update Costs: Every write operation becomes more expensive because it must be propagated to all sites holding a replica of that data.
- Concurrency Control: Managing concurrent access to multiple replicas requires complex locking mechanisms to prevent data conflicts.
- Storage Overhead: Maintaining multiple copies consumes significantly more storage space compared to non-replicated systems.
3. Describe the differences between Homogeneous and Heterogeneous distributed databases. [5 Marks]
Answer:
Homogeneous Distributed Databases
In a homogeneous system, all physical sites use the same database management software and operating system. The design is uniform, which makes the management, query optimization, and integration of data straightforward because the underlying data models are consistent.
Heterogeneous Distributed Databases
In a heterogeneous system, different sites may utilize different database management systems (e.g., one site uses SQL, another uses NoSQL). This environment is common in large organizations that have evolved through mergers and acquisitions.
Key Differences
- Integration: Homogeneous systems are easier to integrate; heterogeneous systems require complex middleware for data translation.
- Complexity: Heterogeneous systems face greater challenges in maintaining schema integrity and executing distributed transactions.
- Compatibility: Homogeneous environments allow for easy data migration and shared access policies, whereas heterogeneous environments often require specialized wrappers for inter-site communication.
4. Explain the functioning and benefits of the Semi Join operation. [5 Marks]
Answer:
Definition
A Semi Join is an algebraic operation used in distributed databases to reduce the amount of data transferred between sites during a join operation. It is particularly effective when one site has significantly more data than the other.
Functioning
If we want to join Table A at Site 1 and Table B at Site 2, a semi join works by:
- Projecting the join attribute from Table A at Site 1.
- Sending this list of values to Site 2.
- Performing a join between the projected values and Table B at Site 2 to filter out rows in Table B that do not have matching partners in Table A.
- Sending only the relevant filtered rows of Table B back to Site 1 to complete the final join.
Benefits
The primary benefit is a drastic reduction in network traffic, as irrelevant data is discarded at the source site before being transmitted over the network, leading to faster query execution.
5. Discuss the mechanisms involved in managing Distributed Transactions. [5 Marks]
Answer:
Introduction
Distributed transactions involve multiple database operations that occur across several different sites. To ensure the integrity of the entire database, the DDBMS must ensure that the transaction follows the ACID properties (Atomicity, Consistency, Isolation, Durability).
Key Management Mechanisms
- Two-Phase Commit (2PC) Protocol: This is the most common protocol used to ensure atomicity. In the 'prepare' phase, the coordinator asks all sites if they are ready to commit. In the 'commit' phase, if all sites agree, the coordinator instructs them to finalize the transaction.
- Distributed Deadlock Detection: Since transactions may lock resources across multiple sites, a 'wait-for' graph must be maintained globally to identify cyclic dependencies that could cause the system to freeze.
- Failure Recovery: The system must be capable of rolling back partial changes if a network failure or site crash occurs during the transaction process.
- Logging: Each site must maintain a local log that records the status of the transaction (prepared or committed) to allow for recovery after a system restart.