You are on page 1of 7

Q1: What are the function of ddbms? And also its advantages and disadvantage?

Answer: Function distributed database management systems :

 Application/end user interface


 Validation to analyze data request
 Transformation to determine to request components
 Mapping to determine the data location
 I/O interface to read and write data
 Security
 Backup and recovery
 DB Administration
Concurrency control
Advantages of DDBMS are as follows:
 Faster data access
 Faster data processing
 Growth facilitation
 Modular Development
 More Reliable
 Lower Communication Cost
 Better Response
Disadvantages of DDBMS
 Complexity of management and control
 Technological difficulty
 Data integrity
 Transaction management
 Lack of standards
 Security
 query optimization

Q2: Explain Concurrency control in DDBMS?


Answer: Concurrency control:
Is a database management systems (DBMS) concept that is used to address occur with a multi-user system.
Concurrency control, when applied to a DBMS, is meant to coordinate simultaneous transactions while preserving
data integrity
Potential problems of Concurrency:
 Lost Updates

 Non-Repeatable Read

 Incorrect Summary issue

Why use Concurrency method?


Reasons for using Concurrency control method is DBMS:
 To apply Isolation through mutual exclusion between conflicting transactions
 To resolve read-write and write-write conflict issues
 To preserve database consistency through constantly preserving execution obstructions
 The system needs to control the interaction among the concurrent transactions. This control is achieved
using concurrent-control schemes.
 Concurrency control helps to ensure serializability.

Concurrency Control Protocols:


Lock-Based Protocols:
A lock is a data variable which is associated with a data item. This lock signifies that operations that can be
performed on the data item. Locks help synchronize access to the database items by concurrent transactions.
Two Phase Locking (2PL) Protocol:
Two-Phase locking protocol which is also known as a 2PL protocol. It is also called P2L. In this type of
locking protocol, the transaction should acquire a lock after it releases one of its locks.
This locking protocol divides the execution phase of a transaction into three different parts.
 In the first phase, when the transaction begins to execute, it requires permission for the locks it needs.
 The second part is where the transaction obtains all the locks. When a transaction releases its first lock,
the third phase starts.
 In this third phase, the transaction cannot demand any new locks. Instead, it only releases the acquired
locks.

The Two-Phase Locking protocol allows each transaction to make a lock or unlock request in two steps:

 Growing Phase: In this phase transaction may obtain locks but may not release any locks.
 Shrinking Phase: In this phase, a transaction may release locks but not obtain any new lock

Timestamp-based Protocols:
The timestamp-based algorithm uses a timestamp to serialize the execution of concurrent transactions. This
protocol ensures that every conflicting read and write operations are executed in timestamp order. The protocol
uses the System Time or Logical Count as a Timestamp.

Advantages:

 Schedules are serializable just like 2PL protocols


 No waiting for the transaction, which eliminates the possibility of deadlocks!

Disadvantages:
Starvation is possible if the same transaction is restarted and continually aborted.

Answer:
Stability:
A scalable system is any system that is flexible with its number of components.
For an efficiently designed distributed system, adding and removing nodes should be an easy task. The system
architecture must be capable of accommodating such changes.
You call a system scalable when adding or removing the components doesn’t make the user sense a difference.
The entire system feels like one coherent, logical system.
A distributed system ( system comprising of many servers and probably many networks ) will be called scalable
system when the system is able to give right response to the requests immaterial of traffic coming in -
basically as the computation grows ( may be 1 user now and 1M users in an hour and 1K users in 2nd hour so
on… ) and does not fail. Scalability can be achieved in many ways: horizontal, vertical etc…
A scalable system is any system that's flexible with its number of components.
For an efficiently designed distributed system, adding and removing nodes should be a simple task. The system
architecture must be capable of accommodating such changes.
You call a system scalable when adding or removing the components doesn’t make the user sense a difference.
The whole system seems like one coherent, logic.

Railway Reservation
Aim:
The railway reservation system facilitates the passengers to enquire about the trains available on the basis of sourc
e and destination, booking and cancellation of tickets, enquire about the status of the booked ticket, etc. 
The aim of case study is to design and develop a database maintaining the records of different trains, train status, a
nd passengers. The record of train includes its number, name, source, destination, and days on which it is availabl
e, whereas record of train status includes dates for which tickets can be booked, total number of seats available, an
d number of seats already booked. The database has been developed and tested on the Oracle. 
Description: 
Passengers can book their tickets for the train in which seats are available. For this, passenger has to provide the d
esired train number and the date for which ticket is to be booked. Before booking a ticket for a passenger, the vali
dity of train number and booking date is checked. Once the train number and booking date are validated, it is chec
ked whether the seat is available. If yes, the ticket is booked with confirm status and corresponding ticket ID is ge
nerated which is stored along with other details of the passenger. After all the available tickets are booked, certain 
numbers of tickets are booked with waiting status. If waiting lot is also finished, then tickets are not booked and a 
message of nonailability of seats is displayed.The ticket once booked can be cancelled at any time. For this, the pa
ssenger has to provide the ticket ID (the unique key). The ticket ID is searched and the corresponding record is del
eted.  With this, the first ticket with waiting status also gets confirmed. 
List of Assumption 
Since the reservation system is very large in reality, it is not feasible to develop the case study to that extent and pr
epare documentation at that level. Therefore, a small sample case study has been created to demonstrate the worki
ng of the reservation system. To implement this sample case study, some assumptions have been made, which are 
as follows: 
1. The number of trains has been restricted to 5. 
2. The booking is open only for next seven days from the current date. 
3. Only two categories of tickets can be booked, namely, AC and General. 
4. The total number of tickets that can be booked in each category (AC and General) is 10. 
5. The total number of tickets that can be given the status of waiting is 2. 
6. The in‐between stoppage stations and their bookings are not considered. 
  Description of Tables and Procedures 
Tables and procedures that will be created are as follows: 
1. Train List: 
This table consists of details about all the available trains. The information 
stored in this table includes train number, train name, source, destination, fair for AC 
ticket, fair for general ticket, and weekdays on which train is available. 
Constraint: The train number is unique. 
2. Train Status: 
This table consists of details about the dates on which ticket can be booked for a train and the status of the availability of 
tickets. The information stored in this table includes train number, train date, total number of AC seats, total number of g
eneral seats, number of AC seats booked, and number of general seats booked. 
Constraint: Train number should exist in Train List table. 
3. Passenger:
 This table consists of details about the booked tickets. The information 
stored in this table includes ticket ID, train number, date for which ticket is booked, 
name, age, sex and address of the passenger, status of reservation (either confirmed or 
waiting), and category for which ticket is booked. 
Constraint: Ticket ID is unique and the train number should exist in TrainList table. 
4. Booking: 
In this procedure, the train number, train date, and category is read from the passenger. On the basis of the values provid
ed by the passenger, corresponding record is retrieved from the Train_Status table. If the desired category is AC, then tot
al number  of AC seats and number of booked AC seats are compared in order to find whether 
ticket can be booked or not. Similarly, it can be checked for the general category. If ticket can be booked, then passenger 
details are read and stored in the Passenger table. 
5. Cancel: 
In this procedure, ticket ID is read from the passenger and corresponding record is searched in the Passenger table. If the 
record exists, it is deleted from the table. After deleting the record (if it is confirmed), first record with waiting status for 
the same train and same category are searched from the Passenger table and its status is changed to confirm. 
Q 1 : what are the components of distributed database management system? Explain with the help of diagram?
Ans : Components of distributed database management system

 Users

There are many users who use the distributed database. ...

 Global schema

The global schema shows the overall design of the database. ...

 Database modules

The database modules are the parts of the database stored in multiple locations.

Diagram:
Q 2: difference between Homogenous Distributed Database Systems
Heterogeneous Distributed Database Systems?

Ans: Homogenous Distributed Database Systems:

In a homogeneous system, all sites use the same DBMS product. Homogeneous systems are much easier to design and
manage. This approach provides incremental growth, making the addition of a new site to the DDBMS easy, and allows
increased performance by exploiting the parallel processing capability of multiple sites.

Heterogeneous Distributed Database Systems:

In a heterogeneous system, sites may run different DBMS products, which need not be based on the same underlying data
model, and so the system may be composed of relational, network, hierarchical and object-oriented DBMSs
Heterogeneous system usually result when individual sites have implemented their own database and integration is
considered at a later stage.

Q3:What is Location Transparency?


Ans: Location Transparency:

It ensures that the user can query on any table(s) or fragment(s) of a table as if they were stored locally in the user's site.
The fact that the table or its fragments are stored at remote site in the distributed database system, should be completely
oblivious to the end user.

Q4:What is Fragmentation?
Ans: Fragmentation:

Fragmentation is the task of dividing a table into a set of smaller tables. The subsets of the table are called fragments.
Fragmentation can be of three types: horizontal, vertical, and hybrid (combination of horizontal and vertical).
Types of Fragmentation
Vertical fragmentation:

1. Vertical fragmentation is a subset of attributes.


2. Basically, vertical fragmentation splits tables by columns

Horizontal Fragmentation:

1. Horizontal Fragmentation is a subset of tuples (rows).


2. Horizontal Fragmentation splits tables by rows. 

Hybrid fragmentation:

A combination of horizontal and vertical fragmentation techniques are used. This is the most flexible
fragmentation technique since it generates fragments with minimal extraneous information. However,
reconstruction of the original table is often an expensive task.

Q 5: write short note on any three of the following.

1) What is distributed transaction and remote transaction?

Distributed transaction: A distributed transaction is a database transaction in which two or more network
hosts are involved. Usually, hosts provide transactional resources, while the transaction manager is responsible
for creating and managing a global transaction that encompasses all operations against such resources.

Remote transaction: Is a set of numerous database requests which access the data at only one remote database
processing site...

2) What is Network transparency?

Network transparency: is basically one of the properties of distributed database. According to this property, a
distributed database must be network transparent. Network transparency means that a user must be unaware
about the operational details of the network.

3) What is deadlock prevention and dead lock detection?

Deadlock prevention:
A deadlock can be prevented if the resources are allocated in such a way that deadlock never occur. The DBMS analyzes
the operations whether they can create deadlock situation or not, If they do, that transaction is never allowed to be
executed.

Dead lock detection:


We propose an algorithm for detecting deadlocks among transactions running concurrently in a distributed processing
network (i.e., a distributed database system). The proposed algorithm is a distributed deadlock detection algorithm.

You might also like