***Welcome to ashrafedu.blogspot.com * * * This website is maintained by ASHRAF***

Posts

    Wednesday, 11 March 2020

    Client/server architecture


    Client/server architecture

    Client/server architecture is a computing model in which the server hosts, delivers and manages most of the resources and services to be consumed by the client. This type of architecture has one or more client computers connected to a central server over a network or internet connection. This system shares computing resources.

    Client/server architecture is also known as a networking computing model or client/server network because all the requests and services are delivered over a network.

    Client/server architecture works when the client computer sends a resource or process request to the server over the network connection, which is then processed and delivered to the client. A server computer can manage several clients simultaneously, whereas one client can be connected to several servers at a time, each providing a different set of services. In its simplest form, the internet is also based on client/server architecture where web servers serve many simultaneous users with website data.
    Client Server Computing

    In client server computing, the clients request 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. Both the client and server usually communicate via a computer network but sometimes they may reside in the same system.


    Characteristics of Client Server Computing
    The salient points for client server computing are as follows:
    • The client server computing works with a system of request and response. The client sends a request to the server and the server responds with the desired information.
    • The client and server should follow a common communication protocol so they can easily interact with each other. All the communication protocols are available at the application layer.
    • A server can only accommodate a limited number of client requests at a time. So it uses a system based to priority to respond to the requests.
    • Denial of Service attacks hinder servers ability to respond to authentic client requests by inundating it with false requests.
    • An example of a client server computing system is a web server. It returns the web pages to the clients that requested them.
    The different advantages of client server computing are:
    • All the required data is concentrated in a single place i.e. the server. So it is easy to protect the data and provide authorization and authentication.
    • The server need not be located physically close to the clients. Yet the data can be accessed efficiently.
    • It is easy to replace, upgrade or relocate the nodes in the client server model because all the nodes are independent and request data only from the server.
    • All the nodes i.e clients and server may not be build on similar platforms yet they can easily facilitate the transfer of data.
    Disadvantages of Client Server Computing
    The different disadvantages of client server computing are:
    • If all the clients simultaneously request data from the server, it may get overloaded. This may lead to congestion in the network.
    • If the server fails for any reason, then none of the requests of the clients can be fulfilled. This leads of failure of the client server network.
    • The cost of setting and maintaining a client server model are quite high.


    Data Fragmentation


    Data Fragmentation

    The process of dividing the database into a smaller multiple parts is called as fragmentation. These fragments may be stored at different locations. The data fragmentation process should be carried out in such a way that the reconstruction of original database from the fragments is possible.

    Fragmentation can be of three types: horizontal, vertical, and hybrid (combination of horizontal and vertical). Horizontal fragmentation can further be classified into two techniques: primary horizontal fragmentation and derived horizontal fragmentation.

    Advantages of Fragmentation
    ·         Since data is stored close to the site of usage, efficiency of the database system is increased.
    ·         Local query optimization techniques are sufficient for most queries since data is locally available.
    ·         Since irrelevant data is not available at the sites, security and privacy of the database system can be maintained.

    Disadvantages of Fragmentation
    ·         When data from different fragments are required, the access speeds may be very high.
    ·         In case of recursive fragmentations, the job of reconstruction will need expensive techniques.
    ·         Lack of back-up copies of data in different sites may render the database ineffective in case of failure of a site.

    Vertical Fragmentation

    In vertical fragmentation, the fields or columns of a table are grouped into fragments. In order to maintain reconstructiveness, each fragment should contain the primary key field(s) of the table. Vertical fragmentation can be used to enforce privacy of data.
    For example, let us consider that a University database keeps records of all registered students in a Student table having the following schema.
    STUDENT
    Regd_No
    Name
    Course
    Address
    Semester
    Fees
    Marks


    Now, the fees details are maintained in the accounts section. In this case, the designer will fragment the database as follows −

    CREATE TABLE STD_FEES AS SELECT Regd_No, Fees  FROM STUDENT;

    Horizontal Fragmentation
    Horizontal fragmentation groups the tuples of a table in accordance to values of one or more fields. Horizontal fragmentation should also confirm to the rule of reconstructiveness. Each horizontal fragment must have all columns of the original base table.
    For example, in the student schema, if the details of all students of Computer Science Course needs to be maintained at the School of Computer Science, then the designer will horizontally fragment the database as follows −
    CREATE COMP_STD AS SELECT * FROM STUDENT WHERE COURSE = "Computer Science";

    Hybrid Fragmentation
    In 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.
    Hybrid fragmentation can be done in two alternative ways −
    • At first, generate a set of horizontal fragments; then generate vertical fragments from one or more of the horizontal fragments.
    • At first, generate a set of vertical fragments; then generate horizontal fragments from one or more of the vertical fragments.



    Data Replication


    Data Replication 
    Data replication is the process in which the data is copied at multiple locations (Different computers or servers) to improve the availability of data.
    Data replication is done with an aim to:
    • Increase the availability of data.
    • Speed up the query evaluation.
    There are two types of data replication:

    1. Synchronous Replication:
    In synchronous replication, the replica will be modified immediately after some changes are made in the relation table. So there is no difference between original data and replica.

    2. Asynchronous replication:
    In asynchronous replication, the replica will be modified after commit is fired on to the database.
    The three replication schemes are as follows:
    1. Full Replication
    In full replication scheme, the database is available to almost every location or user in communication network.
    Advantages of full replication

    • High availability of data, as database is available to almost every location.
    • Faster execution of queries.
    Disadvantages of full replication
    • Concurrency control is difficult to achieve in full replication.
    • Update operation is slower.
    2. No Replication
    No replication means, each fragment is stored exactly at one location.

    Advantages of no replication
    • Concurrency can be minimized.
    • Easy recovery of data.
    Disadvantages of no replication
    • Poor availability of data.
    • Slows down the query execution process, as multiple clients are accessing the same server.
    3. Partial replication

    Partial replication means only some fragments are replicated from the database.

    Advantages of partial replication
    The number of replicas created for fragments depend upon the importance of data in that fragment.

    Monday, 2 March 2020

    Distributed Database Systems


    Distributed Database Systems

    A distributed database is basically a database that is not limited to one system; it is spread over multiple computers or over a network of computers.
    A distributed database system is located on various sites that don’t share physical components. It may be required when a database has to be accessed by various users globally.

    Distributed Database System Types:

    1. Homogeneous Database: In a homogeneous database, all different sites store database identically. The operating system, database management system and the data structures used – all are same at all sites. Hence, they’re easy to manage.
    2. Heterogeneous Database: In a heterogeneous distributed database, different sites can use different schema and software that can lead to problems in query processing and transactions. Also, a particular site might be completely unaware of the other sites. Different computers may use a different operating system, different database application. They may even use different data models for the database. Hence, translations are required for different sites to communicate.

    Distributed Data Storage
    There are 2 ways in which data can be stored on different sites. These are:
    1. Replication
    In this approach, the entire relation is stored redundantly at 2 or more sites. If the entire database is available at all sites, it is a fully redundant database. Hence, in replication, systems maintain copies of data.
    This is advantageous as it increases the availability of data at different sites. Also, now query requests can be processed in parallel.
    However, it has certain disadvantages as well. Data needs to be constantly updated. Any change made at one site needs to be recorded at every site that relation is stored or else it may lead to inconsistency. This is a lot of overhead. Also, concurrency control becomes way more complex as concurrent access now needs to be checked over a number of sites.
    2. Fragmentation
    In this approach, the relations are fragmented (divided into smaller parts) and each of the fragments is stored in different sites where they’re required. It must be made sure that the fragments are such that they can be used to reconstruct the original relation (no loss of data).
    Fragmentation is advantageous as it doesn’t create copies of data, consistency is not a problem.
    Fragmentation of relations can be done in two ways:
    • Horizontal fragmentation – Splitting by rows – The relation is fragmented into groups of tuples so that each tuple is assigned to at least one fragment.
    • Vertical fragmentation – Splitting by columns – The schema of the relation is divided into smaller schemas. Each fragment must contain a common candidate key so as to ensure lossless join.
    In certain cases, an approach that is hybrid of fragmentation and replication is used.

    Functions of Distributed database system:
    1. Keeping track of data –
      The basic function of DDBMS is to keep track of the data distribution, fragmentation and replication by expanding the DDBMS catalog.
    2. Distributed Query Processing –
      The basic function of DDBMS is basically its ability to access remote sites and to transmit queries and data among the various sites via a communication network.
    3. Replicated Data Management –
      The basic function of DDBMS is basically to decide which copy of a replicated data item to access and to maintain the consistency of copies of replicated data items.
    4. Distributed Database Recovery –
      The ability to recover from the individual site crashes and from new types of failures such as failure of communication links.
    5. Security –
      The basic function of DDBMS is to execute Distributed Transaction with proper management of the security of the data and the authorization/access privilege of users.
    6. Distributed Directory Management –
      A directory basically contains information about data in the database. The directory may be global for the entire DDB, or local for each site. The placement and distribution of the directory may have design and policy issues.
    7. Distributed Transaction Management –
      The basic function of DDBMS is its ability to devise execution strategies for queries and transaction that access data from more than one site and to synchronize the access to distributed data and basically to maintain the integrity of the complete database.
    But these function increases the complexity of a DDBMS over centralized DBMS.

    Advantages of DDBMS
    • The database is easier to expand as it is already spread across multiple systems and it is not too complicated to add a system.
    • The distributed database can have the data arranged according to different levels of transparency i.e data with different transparency levels can be stored at different locations.
    • The database can be stored according to the departmental information in an organization. In that case, it is easier for a organizational hierarchical access.
    • there were a natural catastrophe such as fire or an earthquake all the data would not be destroyed it is stored at different locations.
    • It is cheaper to create a network of systems containing a part of the database. This database can also be easily increased or decreased.
    • Even if some of the data nodes go offline, the rest of the database can continue its normal functions.
    Disadvantages of DDBMS
    • The distributed database is quite complex and it is difficult to make sure that a user gets a uniform view of the database because it is spread across multiple locations.
    • This database is more expensive as it is complex and hence, difficult to maintain.
    • It is difficult to provide security in a distributed database as the database needs to be secured at all the locations it is stored. Moreover, the infrastructure connecting all the nodes in a distributed database also needs to be secured.
    • It is difficult to maintain data integrity in the distributed database because of its nature. There can also be data redundancy in the database as it is stored at multiple locations.
    • The distributed database is complicated and it is difficult to find people with the necessary experience who can manage and maintain it.