0% found this document useful (0 votes)
8 views29 pages

Distributed Systems Semester Guide-V2

The document serves as a comprehensive guide for a B.Tech examination in Computer Science, focusing on Distributed Systems and Databases. It includes detailed answers to 15 long-answer questions and 25 short-answer questions covering topics such as distributed object management, mobile databases, parallel databases, recovery techniques, query optimization, and security in distributed environments. The guide emphasizes key concepts, advantages, challenges, and methodologies relevant to distributed database design and management.

Uploaded by

paramitajana115
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views29 pages

Distributed Systems Semester Guide-V2

The document serves as a comprehensive guide for a B.Tech examination in Computer Science, focusing on Distributed Systems and Databases. It includes detailed answers to 15 long-answer questions and 25 short-answer questions covering topics such as distributed object management, mobile databases, parallel databases, recovery techniques, query optimization, and security in distributed environments. The guide emphasizes key concepts, advantages, challenges, and methodologies relevant to distributed database design and management.

Uploaded by

paramitajana115
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Distributed

Systems &
Databases
Comprehensive
Semester
[Link]
Examination
Computer
Science
Guide
Engineering

Contains
thorough
answers
for
15 Long-
Answer
(10-Mark)
and 25
Short-
Answer
Section A: Long Answer Questions (10 Marks)

10 Marks

1. Explain the object-oriented approach in distributed object management.


Discuss its advantages over traditional relational approaches.

The object-oriented approach in Distributed Object Management (DOM) extends the object-
oriented programming paradigm to distributed environments. Data and operations are
encapsulated into objects, which can communicate across the network via message passing,
abstracting the physical location of the data. Distributed Object Management Systems (DOMS)
manage these objects, ensuring they can be accessed, invoked, and modified seamlessly
across different nodes.

Advantages over Traditional Relational Approaches:

• Complex Data Types: Unlike RDBMS, which relies on flat tables, the OO approach supports
complex data structures (multimedia, spatial data, hierarchical objects) natively.
• Encapsulation and Behavior: RDBMS only stores data state. DOM stores both state and
behavior (methods), reducing the mismatch between application code and database schema
(Impedance Mismatch).
• Inheritance and Reusability: Objects can inherit properties and methods from parent
classes across the distributed system, fostering reuse and modularity.
• Extensibility: New data types and operations can be added more intuitively without altering
the core database structure.
10 Marks

2. Explain the data consistency and concurrency issues in mobile databases.


How are these challenges handled in mobile environments?

Mobile databases involve users accessing and modifying data while moving across different
network cells, leading to frequent disconnections, low bandwidth, and power constraints.

Data Consistency and Concurrency Issues:

• Frequent Disconnections: Mobile units often lose signal. If a transaction is ongoing during
disconnection, keeping locks held can block other users indefinitely.
• Replication Consistency: Data is often cached on the mobile device for offline work.
Synchronizing this local cache with the central server upon reconnection creates conflict
issues.
• Mobility/Location Tracking: As a user moves, the database must manage handoffs and
ensure that queries route to the correct local server without violating ACID properties.

How Challenges are Handled:

• Optimistic Concurrency Control: Mobile units modify local replicas offline and resolve
conflicts when reconnecting, rather than acquiring network locks.
• Data Hoarding/Caching: Pre-fetching necessary data to the mobile device before
disconnection allows localized processing.
• Timeout-based Locks: If a mobile device holds a lock and disconnects, the server releases
the lock after a timeout to prevent starvation.
• Multi-version Concurrency Control (MVCC): Keeping multiple versions of data to allow
read operations without blocking write operations.
10 Marks

3. Explain shared memory, shared disk, and shared nothing architectures in


parallel databases. Explain the concept of pipeline parallelism and its
benefits.

Architectures in Parallel Databases:

• Shared Memory: All processors share a common main memory and disk array. It is easy to
program and manage but suffers from a bottleneck as processors scale (bus contention).
• Shared Disk: Processors have their own private memory but share a common disk array via
an interconnection network. It improves fault tolerance and avoids memory bottlenecks but
suffers from disk I/O bottlenecks.
• Shared Nothing: Each processor has its own private memory and private disk. Processors
communicate only through messages over a high-speed network. It offers the highest
scalability and is the standard for massive parallel processing (MPP) systems.

Pipeline Parallelism:

Pipeline parallelism involves breaking down a complex query into a sequence of relational
operations (like a factory assembly line). The output of one operation is continuously streamed
into the next operation as soon as partial results are available, rather than waiting for the entire
operation to finish.

Benefits: It drastically reduces the overall response time of complex queries, minimizes
temporary storage requirements (since intermediate results are consumed immediately), and
ensures continuous utilization of CPU resources.
10 Marks

4. Explain intra-query and inter-query parallelism with examples. Discuss load


balancing issues in parallel query processing.

Intra-Query Parallelism: The execution of a single query is distributed across multiple


processors to speed up its response time. Example: A massive SELECT * FROM Sales
WHERE region='East' is split so Processor 1 scans the first half of the table, and Processor
2 scans the second half simultaneously.

Inter-Query Parallelism: Multiple distinct queries are executed simultaneously by different


processors to increase the overall transaction throughput of the system. Example: Processor A
handles User 1's query for product prices, while Processor B handles User 2's query for
inventory levels at the same time.

Load Balancing Issues:

• Data Skew: If data is unevenly partitioned (e.g., more customers in 'East' than 'West'), one
processor will do more work while others idle, nullifying parallel benefits.
• Execution Skew: Some operations take longer due to complex predicates or data
distribution anomalies.
• Resource Contention: Network bandwidth or disk I/O limits can cause processors to wait.
Dynamic load balancing (redistributing data at runtime) is required to fix these skews.
10 Marks

5. Differentiate between undo-based and redo-based recovery techniques in


DDBMS. Compare and analyze centralized and distributed recovery
mechanisms.

Undo vs. Redo Recovery:

• Undo-based Recovery: Database is updated immediately with uncommitted data. Old


values are logged. If a transaction fails, the old values are read from the log to "undo" the
changes.
• Redo-based Recovery: Updates are deferred until the transaction commits, or written to
stable storage. If a crash occurs, committed transactions are reapplied ("redone") using the
new values in the log.

Centralized vs. Distributed Recovery Mechanisms:

• Centralized Recovery: A single coordinator manages recovery. It is simpler to implement,


relies on a single transaction log, and guarantees strict serializability easily. However, the
central node is a single point of failure and a performance bottleneck.
• Distributed Recovery: Every node maintains its own local log. Recovery requires
coordination protocols (like Two-Phase Commit - 2PC) to ensure all nodes agree to commit
or abort. It provides high availability and fault tolerance but suffers from high network
overhead and complexity, especially in handling network partitions.
10 Marks

6. Explain log-based recovery in distributed databases. Analyze the role of


Write-Ahead Logging (WAL) in ensuring data consistency and reliability.

Log-Based Recovery in DDBMS:

In distributed databases, each local site maintains a local log of all transaction operations. Log-
based recovery uses these stable storage logs to reconstruct the correct database state after a
failure. When a distributed transaction occurs, the coordinator and participants exchange
prepare and commit messages, logging each state change locally.

Role of Write-Ahead Logging (WAL):

WAL is a fundamental protocol dictating that before any modified data page is written to the
physical database disk, the corresponding log record detailing the change MUST be written to
stable storage.

• Data Consistency: If the system crashes after writing data but before logging, it cannot undo
the partial change. WAL prevents this by ensuring the undo log is safe first.
• Reliability: WAL allows the system to implement an immediate-update strategy without
risking corruption. If a crash occurs, the WAL has a complete historical record to replay
(redo) or roll back (undo) transactions, guaranteeing the Atomicity and Durability of ACID
properties.
10 Marks

7. Explain the process of query optimization in distributed databases. Discuss


the role of cost models and communication cost in detail.

Process of Query Optimization in DDBMS:

Distributed query optimization transforms a high-level query into an efficient execution strategy
over a computer network. The process involves:

1. Query Decomposition: Translating the SQL query into relational algebra and simplifying it.
2. Data Localization: Mapping the relational algebra to fragments based on fragmentation
schemas.
3. Global Optimization: Selecting the best execution plan (join order, execution sites) to
minimize costs.
4. Local Optimization: Each site optimizes its specific sub-query.

Role of Cost Models and Communication Cost:

A distributed cost model evaluates an execution plan based on: Total Cost = I/O Cost + CPU
Cost + Communication Cost.

• Communication Cost: In distributed environments, transferring data across nodes often


takes more time than local processing. The optimizer uses metadata (cardinality, tuple size)
to estimate data transfer sizes. Techniques like moving small tables to the site of large tables,
or using semijoins to filter data before transmission, are heavily prioritized to reduce network
bottleneck.
10 Marks

8. Describe the semijoin strategy in distributed query processing. Explain how


it reduces communication cost with a detailed example.

Semijoin Strategy:

A semijoin is a distributed join optimization technique used to reduce the amount of data
transferred across the network. Instead of sending an entire relation to another site for joining,
only the joining attributes (the projection) of the first relation are sent. The remote site filters its
data based on these attributes and sends back only the matching tuples.

How it Reduces Cost (Example):

Suppose Site A has table Employees (10,000 rows, 1MB) and Site B has table Departments
(10 rows, 1KB). We want to join them on DeptID at Site A.

• Traditional approach: Send the entire Employees table (1MB) to Site B, perform the join,
and send the result back. Or send all Departments to Site A.
• Semijoin approach: 1. Project DeptID from Departments at Site B and send this small list
(10 bytes) to Site A.
2. Site A filters Employees, finding only the 50 employees who match those 10 DeptIDs.
3. Site A sends these 50 filtered rows (5KB) to Site B to complete the join.

This massive reduction in transmitted data (from 1MB to a few KB) significantly lowers
communication costs.
10 Marks

9. Explain the difference between static and dynamic data allocation


strategies. Describe the steps involved in transforming a global query into
fragment queries.

Static vs. Dynamic Data Allocation:

• Static Allocation: Data fragments are assigned to specific nodes at design time and remain
there. It is simple to implement but performs poorly if user access patterns change over time.
• Dynamic Allocation: Data fragments move or replicate automatically based on runtime
access patterns and workload. If Site A frequently accesses a fragment at Site B, the system
might dynamically migrate or replicate it to Site A. It optimizes performance but introduces
massive overhead for monitoring and synchronization.

Transforming Global Query to Fragment Queries:

1. Query Normalization: The global query is parsed, validated, and normalized into standard
relational algebra.
2. Analysis: Rejection of incorrect or semantically meaningless queries.
3. Simplification: Applying idempotency rules and pushing selections down the query tree.
4. Localization: Using fragmentation rules (data dictionary), global relations are replaced with
reconstruction programs (unions for horizontal fragments, joins for vertical fragments).
5. Reduction: Removing empty fragments based on selection predicates (e.g., if querying for
Age>50, a fragment strictly holding Age<30 is eliminated from the query tree).
10 Marks

10. Explain the correctness rules of fragmentation. Why are these rules
important in distributed database design?

Correctness Rules of Fragmentation:

When partitioning a global relation into fragments, three mathematical rules must be satisfied:

1. Completeness: If a relation R is decomposed into fragments R1, R2, ..., Rn, every
data item (tuple or attribute) that belongs to R must belong to at least one fragment Ri. No
data can be lost.
2. Reconstruction: It must be possible to reconstruct the original relation R from its fragments.
For horizontal fragmentation, R = R1 U R2 ... U Rn. For vertical, R = R1 ⨝ R2 ...
⨝ Rn.
3. Disjointness: For horizontal fragmentation, a tuple should belong to only one fragment
(unless explicitly replicated). Ri ∩ Rj = ∅. For vertical fragmentation, primary keys must
be replicated, but non-primary attributes should be disjoint.

Importance: These rules ensure semantic integrity. Completeness ensures zero data loss,
Reconstruction guarantees queries can be answered holistically, and Disjointness prevents data
redundancy anomalies and update inconsistencies.
10 Marks

11. Discuss how data protection is achieved in distributed database


environments. Explain various threats and methods used to ensure security.

Data Protection in Distributed Databases:

Data protection spans confidentiality, integrity, and availability. In a distributed environment, the
attack surface is larger due to network transmissions and multiple entry points.

Various Threats:

• Network Eavesdropping: Intercepting data as it travels between nodes.


• Unauthorized Access: Gaining entry via weak local site authentication.
• Denial of Service (DoS): Overwhelming a node or the network, breaking distributed
transaction protocols like 2PC.
• Data Tampering: Modifying data in transit or at an insecure node.

Methods to Ensure Security:

• Encryption: Encrypting data at rest (at local sites) and in transit (using TLS/SSL for inter-
node communication).
• Authentication & Authorization: Implementing robust identity management (e.g., Kerberos)
and Role-Based Access Control (RBAC) across all sites.
• Auditing and Logging: Tracking all global and local queries to detect malicious behavior.
• Replication for Availability: Storing data redundantly across multiple nodes to protect
against DoS attacks or site failures.
10 Marks

12. Explain the distributed database design process. Discuss various


alternative design strategies with advantages and disadvantages.

Distributed Database Design Process:

Designing a distributed database involves structural mapping of data across physical locations.
The process typically includes Requirements Analysis, Conceptual Design, Fragmentation
(splitting tables), and Allocation (distributing fragments to physical sites).

Alternative Design Strategies:

• Top-Down Approach: Starts with a global schema, fragments it, and allocates it.
Advantage: Highly controlled, results in an optimized and cohesive system.
Disadvantage: Complex to design from scratch, unsuitable if legacy databases already exist.
• Bottom-Up Approach: Starts with existing local databases and integrates them into a
unified global schema (Multi-database system).
Advantage: Preserves existing investments and legacy systems.
Disadvantage: Extremely difficult to resolve schema conflicts, semantic heterogeneity, and
data redundancies.
• Fully Replicated vs. Partitioned: Fully replicated duplicates all data everywhere (high read
speed, slow updates). Partitioned stores unique data chunks per node (fast updates, complex
multi-node reads).
10 Marks

13. Explain the issues in schema integration and global schema design in
distributed databases. How are conflicts resolved during integration?

Issues in Schema Integration:

Schema integration occurs primarily in the bottom-up design of heterogeneous databases. The
main issue is Heterogeneity—different local schemas representing the same real-world entities
differently.

• Naming Conflicts: Synonyms (different names for the same thing, e.g., 'EmpID' and
'StaffNumber') and Homonyms (same name for different things, e.g., 'Date' for birthdate and
'Date' for hire date).
• Type Conflicts: Different data types or formats (e.g., integer vs. varchar for ID, or metric vs.
imperial units).
• Structural Conflicts: Different schema designs (e.g., one DB uses a single 'Name' field,
another uses 'FirstName' and 'LastName').

Conflict Resolution:

• Schema Translation: Using middleware or wrappers to translate local schemas into a


common conceptual model.
• Integration Rules: Defining mapping rules (e.g., concatenating First and Last name) to
create standard global views.
• Global Data Dictionary: Maintaining a central repository that tracks mappings, aliases, and
conversion formulas for seamless user querying.
10 Marks

14. Explain homogeneous and heterogeneous distributed database systems.


Compare their characteristics, advantages, and challenges.

Homogeneous DDBMS:

All sites use the exact same DBMS software, data model, and operating system. They are aware
of one another and cooperate closely to process user requests.

• Advantages: Easy to design, manage, and optimize since the software stack is uniform.
Global query processing and transaction management are straightforward.
• Challenges: Restrictive; forces an organization to buy the same software for all branches,
making it hard to integrate legacy systems.

Heterogeneous DDBMS:

Sites run different DBMS software (e.g., Oracle at Site A, PostgreSQL at Site B), potentially
using different data models (relational vs. NoSQL).

• Advantages: Highly flexible. Allows integration of independent, existing legacy databases


without forcing local site redesign.
• Challenges: Extremely complex query processing and transaction management. Requires
sophisticated middleware or wrappers to handle schema translation and data type
conversions.
10 Marks

15. Explain the three-schema architecture in distributed databases. How does


it help in achieving data independence?

Three-Schema Architecture:

This architecture divides the database into three levels to abstract complexities:

1. Internal/Physical Schema: Describes how data is physically stored on disks across various
nodes (file structures, indices).
2. Conceptual/Global Schema: A logical, unified view of the entire distributed database, hiding
fragmentation and location details from the user.
3. External/User Schema: User-specific views tailored to different applications.

Achieving Data Independence:

• Logical Data Independence: Changes to the conceptual schema (adding new tables or
attributes) do not require changes to the external schema (user applications).
• Physical Data Independence: Changes to the internal schema (moving a fragment to a new
physical server, changing storage indices) do not require changes to the conceptual schema
or application code. The global directory handles the updated mappings internally.
Section B: Short Answer Questions (5 Marks)

5 Marks

16. Discuss heterogeneity issues in multi-database systems and how they are
handled.

Heterogeneity in multi-database systems refers to the differences among participating local


databases that complicate integration. These issues generally fall into several categories:

• Hardware and OS Heterogeneity: Different sites may use different computer architectures
(e.g., mainframes vs. x86 servers) and operating systems (Linux vs. Windows).
• DBMS Software Heterogeneity: Sites might run completely different database systems
(e.g., Oracle, MySQL, SQL Server).
• Semantic Heterogeneity: Differences in meaning, naming conventions (synonyms and
homonyms), and data formats (e.g., mm/dd/yy vs. dd/mm/yy).

Handling these issues: These are managed by using a Wrapper/Mediator architecture or


Middleware. Wrappers translate local specific data formats and query languages into a common
global format, while mediators handle the logic of integrating this normalized data, resolving
semantic conflicts before presenting it to the user.
5 Marks

17. Explain mobile databases, their architecture, and associated challenges.

Mobile databases are distributed database extensions that allow portable devices (like
smartphones and laptops) to access and modify data while physically moving across different
network cells.

Architecture: The system consists of Fixed Hosts (central servers holding the master
database), Base Stations/Mobile Support Stations (MSS) equipped with wireless transceivers,
and Mobile Units (MU) which connect to the MSS via wireless links.

Associated Challenges:

• Mobility: Tracking the location of the mobile unit to route queries and transaction responses
correctly.
• Frequent Disconnections: Mobile links are inherently unreliable. Databases must support
disconnected operations (caching data locally) and resolve merge conflicts later.
• Resource Constraints: Mobile devices have limited battery power, memory, and processing
capabilities, requiring lightweight query execution on the client side.

5 Marks

18. Explain data partitioning in parallel databases and its types.

Data partitioning is the process of dividing a large global table into smaller, disjoint pieces and
spreading them across multiple physical disks in a parallel database. This allows multiple
processors to perform I/O operations simultaneously, drastically reducing data retrieval times.

Types of Partitioning:

• Round-Robin: The $i^{th}$ tuple is assigned to disk $i \pmod n$. It provides perfect load
balancing but is poor for exact-match or range queries, as all disks must be scanned.
• Hash Partitioning: A hash function is applied to a specific attribute (e.g., EmployeeID) to
determine the disk. Excellent for exact-match queries on the hashing attribute, but poor for
range queries.
• Range Partitioning: Contiguous attribute values are assigned to the same disk (e.g., A-H on
Disk 1, I-P on Disk 2). Highly efficient for range queries, but prone to data skew if values
aren't evenly distributed.
5 Marks

19. Explain the role of middleware in distributed object management and


multi-database systems.

Middleware is specialized software that resides between the operating system and the
applications on a network. Its primary role is to provide a uniform abstraction layer that masks
the complexities of network communication and system heterogeneity.

• In Distributed Object Management: Middleware technologies like CORBA (Common


Object Request Broker Architecture) provide an Object Request Broker (ORB). The ORB
allows objects written in different languages and residing on different nodes to invoke each
other's methods seamlessly as if they were local.
• In Multi-Database Systems: Middleware translates queries from a common global syntax
into the specific dialects required by the underlying, heterogeneous local databases. It also
orchestrates distributed transaction management (like managing the Two-Phase Commit
protocol) across these disparate systems to ensure global consistency.

5 Marks

20. Explain parallel query processing.

Parallel query processing is the technique of executing a single SQL query simultaneously
across multiple processors and disks in a parallel database architecture to achieve faster
response times (Speedup) and handle larger datasets efficiently (Scaleup).

This is achieved through two main forms of parallelism:

• Intra-operation Parallelism: Splitting a single operation (like scanning a massive table or


sorting) across multiple processors. For example, if a table is partitioned across 4 disks, 4
processors can scan their respective partitions concurrently.
• Inter-operation Parallelism: Executing different operations of the same query
simultaneously. This includes Pipeline Parallelism (streaming the output of a scan directly
into a join without waiting for the scan to finish) and Independent Parallelism (executing two
completely independent sub-queries at the same time).
5 Marks

21. Explain recovery algorithms in DDBMS.

Recovery algorithms in a Distributed DBMS ensure that the system maintains Atomicity and
Durability (ACID properties) even in the presence of node crashes or network failures. They rely
heavily on distributed transaction logs and coordination protocols.

• Local Logging: Every site maintains a Write-Ahead Log (WAL) recording the old (undo) and
new (redo) values of any modified data.
• Commit Protocols: The most common algorithm is the Two-Phase Commit (2PC). In
Phase 1 (Voting), the coordinator asks all sites if they are ready to commit. In Phase 2
(Decision), if all sites voted 'Yes', the coordinator commands a global commit; if even one
voted 'No', it commands a global abort.
• Crash Recovery: Upon restart, a node's recovery manager reads the local log, undoes any
uncommitted transactions, and redoes committed ones based on the global coordinator's
final decision.

5 Marks

22. Explain the role of checkpoints in distributed recovery. How do they


improve system reliability?

A checkpoint is a periodic operation where the database forces all currently modified data pages
from volatile main memory to stable disk storage, and records a 'checkpoint' marker in the
transaction log.

Role and Improvement of Reliability:

• Bounding Recovery Time: Without checkpoints, a database recovering from a crash would
have to scan the entire log from the beginning of time to redo/undo transactions. Checkpoints
establish a known "safe" state.
• Efficiency: During recovery, the system only needs to process log entries that occurred after
the most recent checkpoint. This drastically reduces downtime and improves system
reliability by ensuring rapid restoration of service.
• In distributed systems, global checkpoints require coordination among nodes to ensure the
recorded state is globally consistent, avoiding anomalies during distributed recovery.
5 Marks

23. Explain different types of failures in distributed systems.

Distributed database systems must be designed to withstand various types of failures, which are
more complex than in centralized systems:

• Transaction Failures: A transaction aborts either due to a logical error (e.g., violating an
integrity constraint like dividing by zero) or a system-initiated abort to resolve a distributed
deadlock.
• Site (Node) Failures: A specific server in the network crashes due to hardware malfunction,
power loss, or OS panic. The rest of the distributed system must detect this and continue
operating.
• Media Failures: Physical damage to the storage disks leading to partial or complete loss of
the database and potentially the logs. Requires restoration from archival backups.
• Communication/Network Failures: Network links break, causing lost messages or Network
Partitioning (split-brain), where the network splits into isolated sub-networks that cannot
communicate with each other.

5 Marks

24. Explain semijoin and discuss its role in distributed query optimization.

A semijoin (denoted by ⋉) is a relational algebra operation highly utilized in distributed


databases to optimize join queries across networks. It filters data before transmission to
minimize communication costs.

Process and Role:

• Instead of sending relation $R$ completely to the site of relation $S$, we first project only the
join attributes of $S$ and send this small list to $R$'s site.
• At $R$'s site, we filter $R$ by keeping only those tuples that match the received join
attributes. This filtered version of $R$ is significantly smaller.
• We then send only this filtered $R$ to $S$'s site to compute the final join.
• Role in Optimization: Network bandwidth is the most expensive resource in DDBMS.
Semijoins drastically reduce the volume of data transmitted over the network, making
distributed joins much faster and more cost-effective.
5 Marks

25. Discuss the trade-off between communication cost and local processing
cost in distributed query processing.

In distributed query optimization, the total cost of executing a query is calculated as $Cost =
(CPU \; Cost + I/O \; Cost) + Communication \; Cost$.

• Communication Cost: The time and bandwidth required to send data over the network (e.g.,
transferring tables between Site A and Site B). Historically, network latency is much higher
than local bus speeds.
• Local Processing Cost: The CPU cycles and disk I/O used to execute operations locally
(e.g., scanning, sorting, or joining data at Site A).
• The Trade-off: Optimizers will frequently choose to increase local processing time (such as
performing a complex semijoin, or aggressive local filtering and sorting) to reduce the amount
of data sent over the network. Spending an extra second of CPU time locally is worth it if it
saves ten seconds of network transmission time.

5 Marks

26. Explain concurrency control in centralized database systems.

Concurrency control in a centralized DBMS ensures that multiple transactions can execute
simultaneously without violating data integrity or causing anomalies like lost updates or dirty
reads. It guarantees the Isolation property of ACID.

Key Mechanisms:

• Locking Protocols: The most common is Two-Phase Locking (2PL), where a transaction
acquires all its locks (Growing Phase) before releasing any (Shrinking Phase). It uses Shared
Locks for reading and Exclusive Locks for writing.
• Timestamp Ordering: Assigns a unique timestamp to each transaction. Conflicts are
resolved by ensuring older transactions get priority, and violating transactions are aborted
and restarted.
• Deadlock Management: The central Lock Manager detects deadlocks (e.g., using wait-for
graphs) and aborts a victim transaction to break the cycle.
5 Marks

27. Define transaction. Explain characteristics of transactions.

A transaction is a logical unit of work that contains one or more database operations (like read,
write, update) that must be executed as a whole. To ensure data integrity, a transaction must
adhere strictly to the ACID characteristics:

• Atomicity: The "all-or-nothing" rule. Either all operations within the transaction execute
successfully, or none of them do. If a failure occurs mid-way, the system undoes partial
changes.
• Consistency: The transaction must take the database from one valid, consistent state to
another, strictly adhering to all predefined integrity constraints and business rules.
• Isolation: The concurrent execution of multiple transactions must result in a system state
that would be obtained if transactions were executed sequentially, one after the other.
• Durability: Once a transaction has been committed, its changes are permanently written to
stable storage and will survive any subsequent system crashes.

5 Marks

28. Explain distributed query optimization and discuss its importance.

Distributed query optimization is the process of translating a high-level query on a distributed


database into an efficient execution strategy. This involves determining the optimal sequence of
relational operations and deciding the specific network nodes where these operations should
take place.

Importance:

• Minimizing Network Traffic: A naive execution plan might attempt to pull two massive
tables from different sites to a third site for a join, crashing the network. Optimization uses
techniques like semijoins to prevent this.
• Site Selection: It evaluates where operations should happen based on data fragment
locations, aiming to push selections and projections to local sites immediately to reduce
intermediate result sizes.
• Performance: Because the search space for execution plans in a distributed system is
exponentially larger than a centralized one, a good optimizer drastically reduces query
response times from hours to seconds.
5 Marks

29. Explain semantic integrity control in distributed database systems.

Semantic integrity control ensures that the database always represents a valid state of the real-
world enterprise by enforcing predefined rules (Integrity Constraints), such as "Salary must be >
0" or "Foreign key DeptID must exist in Departments table".

Distributed Challenges:

• In a centralized DB, checking constraints is fast. In a distributed DB, the data needed to
verify a constraint might be fragmented across different network nodes.
• For example, inserting a new employee at Site A might require a network query to Site B to
ensure the corresponding department exists, causing significant network overhead and
locking issues.
• Solutions: DDBMS attempts to define and allocate constraints locally wherever possible, or
use materialized views and periodic asynchronous checks to maintain integrity without halting
transaction throughput.

5 Marks

30. Explain the concept of view management and discuss its importance.

A view is a virtual table whose contents are defined by a query on one or more base tables. It
does not store data itself but acts as a dynamic window into the database.

Importance in Distributed Systems:

• Data Independence: Views provide logical data independence. If the underlying fragmented
base tables are reorganized or moved, the view definition is simply updated, while the user
application continues querying the view without requiring code changes.
• Security and Access Control: Views restrict user access to specific rows (horizontal
subset) or columns (vertical subset) of data, hiding sensitive information.
• Simplification: They hide the extreme complexity of distributed queries. A user can simply
run SELECT * FROM GlobalSalesView, while the system internally translates this into a
complex union of queries across multiple geographic sites.
5 Marks

31. Explain data security issues in distributed databases.

Distributed databases face magnified security risks because data is transmitted over networks
and stored across multiple physical locations, increasing the attack surface.

• Network Vulnerability: Data transmitted between nodes can be intercepted (packet sniffing)
or altered. Strong end-to-end encryption (TLS/SSL) is mandatory.
• Site Authentication: Ensure that Site A is actually communicating with Site B, and not a
malicious node spoofing identity. Requires robust mutual authentication protocols.
• Heterogeneous Security Policies: In multi-database systems, resolving different security
models (e.g., Site A uses Mandatory Access Control, Site B uses Discretionary Access
Control) into a unified global policy is highly complex.
• Data Residue: If fragments are dynamically replicated or moved, ensuring that data is
securely deleted from the old node is critical to prevent unauthorized recovery.

5 Marks

32. Compare centralized, partitioned, and replicated allocation.

Data allocation is the process of assigning data fragments to network sites.

• Centralized Allocation: All data is stored at a single site. Pros: Simple query processing and
concurrency control. Cons: Single point of failure, no locality of reference for remote users,
massive network bottleneck.
• Partitioned (Fragmented) Allocation: Data is divided into fragments, and each fragment is
stored at one unique site. Pros: High local read/write performance if allocated correctly. Cons:
Complex global queries require multi-site joins; site failure makes that fragment's data
completely unavailable.
• Replicated Allocation: Copies of fragments (or the entire DB) are stored at multiple sites.
Pros: Extremely high availability (if one site crashes, query another) and fast local reads.
Cons: Updating data is very slow and complex, as changes must be synchronized across all
replicas to maintain consistency.
5 Marks

33. Explain the layers of query processing.

Distributed query processing is typically divided into four functional layers:

1. Query Decomposition: Takes the SQL query, checks its syntax and semantics, and
translates it into an algebraic query tree on global relations.
2. Data Localization: Applies fragmentation rules from the data dictionary to replace global
relations with their respective fragments, then simplifies the query (e.g., removing fragments
that contradict selection predicates).
3. Global Query Optimization: Evaluates permutations of join orders and execution sites to
find the execution plan with the lowest overall cost (considering I/O, CPU, and
communication costs).
4. Local Query Optimization: Once the global plan sends a sub-query to a local site, the local
DBMS optimizes it using local access paths, indices, and specific join algorithms (like hash-
join or merge-join).

5 Marks

34. Explain integrity constraints in distributed systems.

Integrity constraints are declarative rules that protect database consistency. In a distributed
environment, they include:

• Domain Constraints: Ensuring values fall within valid ranges (e.g., age > 0). Easily checked
at the local site where data is inserted.
• Primary Key Constraints: Ensuring uniqueness. If a relation is horizontally fragmented
across sites, verifying a new key's uniqueness requires checking all fragments globally, which
is expensive.
• Referential Integrity (Foreign Keys): Ensuring a foreign key in a child table matches a
primary key in a parent table. If the parent and child tables are allocated to different network
nodes, any insert/delete operation requires cross-network validation, increasing latency and
locking overhead.
5 Marks

35. Describe the functions of Distributed DBMS.

A Distributed DBMS software layer manages a distributed database and makes the distribution
transparent to users. Its key functions include:

• Distribution Transparency: Hiding fragmentation, location, and replication details from the
user.
• Distributed Query Processing: Translating global queries into optimized fragments and
routing them to the correct local nodes.
• Distributed Transaction Management: Ensuring ACID properties across multiple nodes
using distributed concurrency control (lock managers) and distributed commit protocols
(2PC).
• Distributed Metadata Management: Maintaining a Global Data Dictionary/Catalog that
tracks where every fragment and replica is physically stored.
• Distributed Recovery: Handling node crashes and network partitions gracefully to restore a
globally consistent database state.

5 Marks

36. What are schema levels in DDBMS? Explain.

To manage complexity, a DDBMS uses a multi-layered schema architecture:

• Global Conceptual Schema (GCS): The logical description of the entire distributed
database as if it were a single centralized entity. It hides all network and fragmentation
details.
• Fragmentation Schema & Allocation Schema: Describes how the GCS is divided into
pieces and physically mapped to specific network nodes.
• Local Conceptual Schema (LCS): The logical schema of the data strictly stored at a single
node.
• Local Internal Schema (LIS): The physical storage details (indices, file structures, disk
blocks) at a specific node.
• External Schema: Customized views defined on top of the GCS for specific user
applications or groups.
5 Marks

37. Describe fragmentation transparency with example.

Fragmentation transparency is the highest level of data independence in a DDBMS. It means


that the end-user or application programmer is completely unaware that a logical table has been
split into multiple pieces (fragments).

Example: Suppose a global table EMPLOYEE is horizontally fragmented into EMP_EAST (stored
in New York) and EMP_WEST (stored in LA).

• With fragmentation transparency, the user simply writes: SELECT * FROM EMPLOYEE
WHERE Salary > 50000;
• The user does not need to know about EMP_EAST or EMP_WEST. The DDBMS middleware
automatically translates the query into a distributed union: (SELECT * FROM EMP_EAST
WHERE Salary > 50000) UNION (SELECT * FROM EMP_WEST WHERE Salary >
50000).

5 Marks

38. Compare client-server and peer-to-peer architecture in DDBMS.

Client-Server Architecture:

• Structure: The system is divided into Clients (which manage user interfaces and lightweight
processing) and Servers (which manage the database, execute queries, and hold data).
• Pros/Cons: Easier to manage, secure, and centralize logic. However, the server can become
a bottleneck, and it offers limited scalability compared to P2P.

Peer-to-Peer (P2P) Architecture:

• Structure: Every node (peer) acts symmetrically as both a client and a server. Each node
has its own local DBMS, stores data, and can initiate or respond to queries.
• Pros/Cons: Highly fault-tolerant, extremely scalable, and eliminates central bottlenecks.
However, it is highly complex to manage global metadata, enforce security, and optimize
distributed queries across equal peers.
5 Marks

39. Explain heterogeneity in distributed database systems.

Heterogeneity implies that the individual nodes comprising the distributed database are not
identical. This lack of uniformity can occur at several levels:

• Hardware: Mixing IBM mainframes with ARM servers or x86 machines.


• Operating Systems: Nodes running combinations of Windows, Linux, or Unix.
• Network Protocols: Different nodes using different communication standards (TCP/IP vs
older proprietary networks).
• DBMS and Data Models (Most Critical): Integrating a relational database (Oracle SQL) at
Node A with an Object-Oriented or NoSQL database (MongoDB) at Node B. This creates
massive semantic conflicts and requires sophisticated middleware wrappers to translate
schemas and query languages.

5 Marks

40. Define Distributed Data Processing. Explain its importance.

Distributed Data Processing refers to a paradigm where data storage, computational logic, and
processing power are dispersed across multiple interconnected computer nodes over a network,
rather than being confined to a single centralized mainframe.

Importance:

• Reliability and Availability: Eliminates single points of failure. If one node crashes, the rest
of the system continues to function.
• Performance (Locality of Reference): Data can be stored geographically close to where it
is used most frequently, drastically reducing network latency and response times.
• Incremental Scalability: Organizations can add new nodes to the network as demand
grows, which is much cheaper and easier than upgrading a massive centralized server.
• Organizational Alignment: It naturally mirrors the decentralized, branch-based structure of
modern global enterprises.

You might also like