Unit-V Distributed and Client Server Databases: A Lalitha Associate Professor Avinash Degree College

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

UNIT- V

DISTRIBUTED AND CLIENT SERVER DATABASES

A LALITHA
ASSOCIATE PROFESSOR
AVINASH DEGREE COLLEGE
What is Distributed Database?
A distributed database (DDB) is a collection of multiple, logically interrelated databases
distributed over a computer network.

A distributed database management system (DDBMS) is the software that manages the DDB and
provides an access mechanism that makes this distribution transparent to the users.
Structure of Distributed database
NEED OF DISTRIBUTED DATABASE

• Distributed Nature of Organizational Units 


• Need for Sharing of Data 
• Database Recovery
• Support for Multiple Application Software
TYPES OF DDBMS

 Homogeneous DDBMS

 Heterogeneous DDBMS
CHARACTERISTICS OF DDBMS

 All sites are interconnected.


 Fragments can be replicated.
 Logically related shared data can be collected.
 Data at each and every site is controlled by the DBMS.
 Each Distributed Database Management System takes part in at least one global
application.
ADVANTAGES AND DISADVANTAGES OF DDBMS
ADVANTAGES OF DDBMS
 Less danger of a single-point failure. When one of the computers fails, the workload is
picked up by other workstations.
 Data are also distributed at multiple sites.
 The end user is able to access any available copy of the data, and an end user's request is
processed by any processor at the data location.
 Improved communications. Because local sites are smaller and located closer to
customers.
 Reduced operating costs. It is more cost- effective to add workstations to a network than
to update a mainframe system.
 Faster data access, faster data processing.
 A distributed database system spreads out the systems workload by processing data at
several sites.
DISADVANTAGES OF DDBMS
 Complexity of management and control.
 Security.
 Increased storage and infrastructure requirements.
 Lack of standards.
 Increased training cost
ADVANTAGES AND DISADVANTAGES OF DATA DISTRIBUTION

Advantages of data distribution


1. Data sharing and distributed control
2. Reflects organizational structure
3. Improved reliability
4. Improved availability
5. Improved performance
6. Speed up query processing
7. Economics
8. Modular growth
Disadvantages of data distribution
9. Higher software development cost
10. greater potential for bugs
11. increased processing overhead
12. complexity
13. security
14. lack of standards and experience
15. general integrity control more difficult
16. purpose
17. database design more complex
DISTRIBUTED DATABASE SYSTEM DESIGN

I.Strategies and objectives

1)Location Transparency-It enables a user to access data with out being concerned with the site at which site the data reside
2) Replication Transparency-It means more than one copy of the data exists, one copy must be chosen when retrieving data, and all
copies must be updated when changes are made.
3) Configuration Independence-It enables the organization to add or replace hardware without changing the existing software components
of the DDBMS.
4) No homogeneous DBMS-It is sometimes desirable to integrate databases maintained by different DBMSs on different computers.

II. Data Replication

Data Replication is the process of storing data in more than one site or node. It is useful in improving the availability of data. It is simply
copying data from a database from one server to another server so that all the users can share the same data without any inconsistency. The
result is a distributed database in which users can access data relevant to their tasks without interfering with the work of others.
ADVANTAGES OF DATA REPLICATION
 Availability
Parallelism
Reduced data transfer
DISADVANTAGES OF DATA REPLICATION
Increased cost of updates
Increased complexity of concurrency control
Types of Data Replication

Transactional Replication – In Transactional replication users receive full initial copies of the database and then
receive updates as data changes.  Transactional replication is typically used in server-to-server environments. It
does not simply copy the data changes, but rather consistently and accurately replicates each change.

Snapshot Replication – Snapshot replication distributes data exactly as it appears at a specific moment in time
does not monitor for updates to the data. The entire snapshot is generated and sent to Users. Snapshot
replication is generally used when data changes are infrequent. It is bit slower than transactional .

Merge Replication – Data from two or more databases is combined into a single database. Merge replication is
the most complex type of replication .Merge replication is typically used in server-to-client environments. It
allows changes to be sent from one publisher to multiple subscribers.
Replication Schemes

1. Full Replication – The most extreme case is replication of the whole database at every site in the distributed
system. This will improve the availability of the system because the system can continue to operate as long as at
least one site is up.
2. Partial Replication – In this type of replication some fragments of the database may be replicated whereas
others may not. The number of copies of the fragment may range from one to the total number of sites in the
distributed system. The description of replication of fragments is sometimes called the replication schema.
2. No Replication – The other case of replication involves having No replication – that is, each fragment is
stored at only one site.
Data fragmentation

Data fragmentation allows to break a single object into two or more segments or fragments. The object might be a
user’s database, a system database, or a table. Each fragment can be stored at any site over a computer network.
Types of Data fragmentation
1) Horizontal Data Fragmentation :
As the name suggests, here the data / records are fragmented horizontally. i.e.; horizontal subset of table data is created
and are stored in different database in DDB.

For example, consider the employees working at different locations of the organization like India, USA, UK etc.
number of employees from all these locations are not a small number. They are huge in number. When any details of
any one employee are required, whole table needs to be accessed to get the information. Again the employee table may
present in any location in the world. But the concept of DDB is to place the data in the nearest DB so that it will be
accessed quickly. Hence what we do is divide the entire employee table data horizontally based on the location. i.e.;
SELECT * FROM EMPLOYEE WHERE EMP_LOCATION = ‘INDIA;
SELECT * FROM EMPLOYEE WHERE EMP_LOCATION = ‘USA’;
SELECT * FROM EMPLOYEE WHERE EMP_LOCATION = ‘UK;
Vertical Data Fragmentation

This is the vertical subset of a relation. That means a relation / table is fragmented by considering the columns
of it.

• For example consider the EMPLOYEE table with ID, Name, Address, Age, location, DeptID, ProjID. The
vertical fragmentation of this table may be dividing the table into different tables with one or more
columns from EMPLOYEE.
• SELECT EMP_ID, EMP _FIRST_NAME, EMP_LAST_NAME, AGE FROM EMPLOYEE;
• SELECT EMP_ID, STREETNUM, TOWN, STATE, COUNTRY, PIN FROM EMPLOYEE;
• SELECT EMP_ID, DEPTID FROM EMPLOYEE;
• SELECT EMP_ID, PROJID FROM EMPLOYEE;
• This type of fragment will have fragmented details about whole employee. This will be useful when the
user needs to query only few details about the employee.
Hybrid data fragmentation

This is the combination of horizontal as well as vertical fragmentation. This type of fragmentation will have horizontal fragmentation
to have subset of data to be distributed over the DB, and vertical fragmentation to have subset of columns of the table.

As we observe in above diagram, this type of fragmentation can be done in any order. It does not have any particular order. It is solely
based on the user requirement. But it should satisfy fragmentation conditions.
Consider the EMPLOYEE table with below fragmentations.
SELECT EMP_ID, EMP _FIRST_NAME, EMP_LAST_NAME, AGE
FROM EMPLOYEE WHERE EMP_LOCATION = ‘INDIA;

SELECT EMP_ID, DEPTID FROM EMPLOYEE WHERE EMP_LOCATION = ‘INDIA;


 
SELECT EMP_ID, EMP _FIRST_NAME, EMP_LAST_NAME, AGE
FROM EMPLOYEE WHERE EMP_LOCATION = ‘US;
 
SELECT EMP_ID, PROJID FROM EMPLOYEE WHERE EMP_LOCATION = ‘US;
This is a hybrid or mixed fragmentation of EMPLOYEE table.
Database partitioning

• A partition is a division of a logical database or its constituting elements into distinct


independent parts.
• Database partitioning is normally done for manageability, performance or availability
reasons
• Each partition may be spread over multiple nodes, and users at the node can perform local
transactions on the partition. This increases performance for sites that have regular
transactions involving certain views of data, while maintaining availability and security.
• Efficiency-This approach, the database is distributed such that there is no replication at the
various locations.
• Reliability may also be affected –since a failure of one computer system means that the data
which are stored at that location are not available to the user.
Client server databases

• Client /server was first used in 1980’s in reference to Personal computers(PCs) on a network.
• Client/server software architecture is a versatile, message-based and modular infrastructure that is
intended to improve usability, flexibility, interoperability and scalability.
• A Client is defined as a requester of services .
• A Server is defined as the provider of services.

The concept behind the Client/Server systems is concurrent, cooperative processing it.
 It is an approach that presents a single systems view from a user’s viewpoint.
 It involves processing on multiple, interconnected machines.
 It provides coordination of activities in a manner transparent to end-users.
 Client/server database is distribution of activities into clients and server.It may have a centralized or
distributed database system at the server backend.
Emergence of Client Server Architecture

• Relational database vendors allowed the computing to be distributed on multiple computers on network
using technologies involving:
 Low cost, High performance PCs and Servers
 Graphical User Interfaces
 Open Systems
 Object-Orientation
 Workgroup Computing
 EDI and E-Mail
 Relational Databases
 Networking and Data Communication
Need for Client Server Computing
 Client Server architecture involves running the application on multiple machines in which each machine
with its component software handles only a part of the job.
 Client machine is basically a PC or Workstation that provides presentation services and interfaces with the
server machine provides database services.
 Server machines are more powerful machines database services to multiple client requests.
 Client/server systems are connected through the network(LAN,WAN).The language through which
RDBMS based client-server environment is SQL.
Structure of Client Server Systems

• In client server computing, the clients requests a resource and the server provides that resource. A server
may serve multiple clients at the same time while a client is in contact with only one server.
• The different structures for two tier and three tier are given as follows −
• Two - Tier Client/Server Structure
• The two tier architecture primarily has two parts, a client tier and a server tier.The client tier sends a
request to the server tier and the server tier responds with the desired information.
• An example of a two tier client/server structure is a web server. It returns the required web pages to the
clients that requested them.
• An illustration of the two-tier client/server structure is as follows −
Advantages of Two - Tier Client/Server Structure
• This structure is quite easy to maintain and modify.
• The communication between the client and server in the form of request response messages is quite fast.
Disadvantages of Two - Tier Client/Server Structure
• A major disadvantage of the two-tier client/server structure is −
• If the client nodes are increased beyond capacity in the structure, then the server is not able to handle the
request overflow and performance of the system degrades.
Three - Tier Client/Server Structure

• The three tier architecture has three layers namely client, application and data layer. The client layer is the
one that requests the information. In this case it could be the GUI, web interface etc. The application layer
acts as an interface between the client and data layer. It helps in communication and also provides security.
The data layer is the one that actually contains the required data.
• An illustration of the three-tier client/server structure is as follows −
Advantages of Three - Tier Client/Server Structure
• The three tier structure provides much better service and fast performance.
• The structure can be scaled according to requirements without any problem.
• Data security is much improved in the three tier structure.

Disadvantages of Three - Tier Client/Server Structure


Three - tier client/server structure is quite complex due to advanced features.
Advantages of Client Server Computing

• They provide low cost and user-friendly environment


• They offer expandability that ensures that performance degradation is not so much with increased load.
• They allow connectivity with heterogeneous machines deals with real time data feeders like ATMs,
Numerical machines.
• They allow enforcement of database management activities including security. integrity, back up ,
performance to be a part of the database server machine.

You might also like