Professional Documents
Culture Documents
Non-Repeatable Read
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:
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?
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.
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.
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:
Horizontal Fragmentation:
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.
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...
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.
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.