Database System Structure:


Database System Structure:





The architecture of a database management system is mainly use by the computer system on which the database system runs.





 Database systems can be centralized, or client-server where on server machine executes work on behalf of multiple client machines.





 Database systems can also be designed to exploit parallel computer architectures.





Distributed databases span multiple geographically separated machine.









Add the following set of numbers:





A primary goal of a database system is to provide an environment for retrieving information from and storing new information into the database.





There are four different types of database-system users, differentiated by the way that they expect to interact with the system.





  • Application programmers are computer professionals and write application programs.




They interact with the system through DML calls, which are embedded in a program written in a host language (for example Cobol, Pascal, C).





 These programs are commonly referred to as application programs.





Add the following set of numbers:





Since the DML syntax is usually markedly different from the host language syntax, DML calls are usually prefaced by a special character so that the appropriate code can be generated.





 A special preprocessor, called the DML precompiled, converts the DML statement to normal procedure calls in the host language.





The resulting program is then run through the host-language compiler, which generates appropriate object code.





  • Sophisticated users and Specialized users:- Sophisticated users  interact with the system without writing programs. Instead, they form their requests in a database query language.




Each such query is submitted to a query processor whose function is to break down DML statement into instructions that the storage manager understands.





They work like an analyst and submit queries to a giving process or directly to the DBMS, which breaks down  the query into instructions that the storage manager understands.





 Specialized users are sophisticated users.





 Sophisticated users write specialized database applications like computer aided design Systems, knowledgebase and expert systems etc.





 Such systems are different from traditional data processing framework and uses complex data types (for example, graphics data and audio data) and environment-modeling systems.





(3) Database Administrator





Databases of an enterprise are typically important enough and complex enough that the task of designing and maintaining it requires a professional, called the Database Administrator (DBA).





 DBA has central control over the system.





 The database administrator is responsible for following functions :





(i) Schema Design and Maintenance,  (ii) Physical Schema and Organization Modification,





(iii) Authorization and Security,         (iv) Integrity Constraint Specification,





(v) Recovery From Failure,                 (vi) Database Upgradation





(4) Naive users are unsophisticated users who interact with the system by invoking one of the permanent application programs that have been written previously.





 For example, the clerk at ticket booking window, he uses an application program to do his job of making reservations for a passenger.





A  bank customer who needs to transfer Rs. 500 from account A to account B invokes a program called transfer. This program asks the customer for the amount of money to be transferred, the account from which the money is to be transferred and the account to which the money is to be transferred.





                   A database system is divided into modules that deal with different responsibilities of the overall system. The functional components of a database system can be broadly divided into the query processor components and the storage manager.





 (1) Query Processor: A query processor is important as it helps the database system to simplify and facilitate data access.





High-level views help to achieve this goal, with them; users of the system are not being burdened unnecessarily with the physical details of the implementation of the system.





However, quick processing of updates and queries written in a nonprocedural language, at the logical "level, results into an efficient sequence of operations at the physical level.





Query Processor Components:-





These components are used in evaluating DDL and DML queries and includes following components.





(i) DDL Interpreter





Which interprets DDL statements and records the definitions in the data dictionary, which contains metadata.





(ii) DML Queries





Sophisticated or  Specialized user’s requests in a database query language.





Add the following set of numbers:





 Each query is submitted to a query tools whose function is to break down into DML queries and low-level instructions, which send to DML compiler and Organizer, and the query evaluation engine which understands.





(iii) DML Compiler and Organizer





It first attempts to transform user's request in the form of DML queries into an equivalent but more efficient form and then translates that into a set of low-level instructions that can be used by query evaluation engine.





 (iv) Application Program Object Code





It converts DML statements embedded in an application program to normal procedure calls in host language. These pre compilers consult DML complier to generate the appropriate code





 (v) Compiler and Linker:-





 Application programmer writes program application.





 The source codes compile by the compiler and linker linked application program object code to DML queries and send it to query evolution engine.         





(iv) Query evaluation Engine: -,





A query can usually be translated into any of a number of alternative evaluation plans that all give the same result.





The DML compiler also performs query optimization, that is, it picks the lowest cost evaluation plan from among the alternatives.





This component is responsible for interpreting and executing the sql query.





It comprises of three major components





•    Compiler - builds a data structure from the SQL statement and then does semantic checking on the query such as whether the table exists, field ‘exists, etc.





•    Optimizer - transforms the initial query plan (data structure created by compiler), into sequence of operations usually pipelined together to achieve fast execution.





It refers The metadata (dictionary) and statistical information stored about the data to decide which sequence of operations is likely to be faster and based on that it creates the optimal query plan.





 Both cost and rule based optimizers are used.





•    Execution Engine - executes each step in the query plan chosen by Optimizer.





 It interact with relation engine to retrieve and store records.





  • Storage Manager: A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system.




The storage manager is responsible for the interaction with the file manager.





The raw data are stored on the disk using the file system, which is usually provided by a conventional operating system.





The storage manager translates the various DML statements into low-level file system commands.





Thus, the storage manager is responsible for storing, retrieving and updating data in the database.





A large amount of storage space is required for storing corporate databases (which may range from hundred to gigabytes to terabytes of data) and to manage this storage manager is required.





Data are to move between disk storage and main memory as per requirement because main memory of computer cannot store this much information.









Add the following set of numbers:





The storage manager components include –





(i) File Manager





It manages disk space allocation and the data structures used to store the data.





File manager maps disk pages of the file to the memory pages at disk in physical form and does the' actual disk I/O operations in case of major faults generated "by buffer manager module.





 (ii) Buffer Manager





Buffer manager responsible for loading pages(fetching) from disk to main memory and to manage the buffer pool based on Least Recently Used (LRU) algorithm and decides the caching strategy suitable for the application.





The buffer manager is a critical part of the database system, since it enables the database to handle data sizes that are much large than the size of main memory.





 This also has special purpose allocator for storing control information, which are transient.





Buffer pool is the memory space used by buffer manager to cache disk pages associated with records, index information, Meta data information.





 Some database systems have space limit at individual level and some at global level for buffer pool size.





 (iii) Transaction Manager





The transaction manager creates transaction objects and manages their atomicity and durability.





 Applications request the creation of a transaction object by calling the transactions manager’s  begin Transaction method.





When a resource manager first participates in a transaction, it calls the Enlist method to enlist in the transaction. The transaction manager tracks all the resource managers who enlist in the transaction.





It ensures that the database remains in a consistent (correct) state despite system failures and that concurrent transaction executions proceed without conflicting.





One of the following three results can occur:





1. The application either commits or aborts the transaction.





2 .A resource manager aborts the transaction.





3. A failure occurs.





(iv) Authorization and Integrity Manager





This manager is responsible for granting an access to database or portions thereof only to authorized users and preventing the access to unauthorized users.





 It tests for satisfaction of integrity constraints and checks authority of users to access data.





It uses all the integrity constraints and authorization rules specified by the DBA.





Integrity manager must assure data integrity during normal database operations as well as during the database failures-





(4) Disk Storage





A DBMS can use several kind of data structures as a part of physical system implementation in the form of disk storage.





Each structure has it's own importance.





Following are some common data structures.





Disk storage the central repository for storing all kinds of data in the database.









Add the following set of numbers:





(i) Data





It stores the database itself on the disk in the Data files.





(ii) Data Dictionary





Information pertaining to the structure and usage of data contained in the database, the metadata, is maintained in a data dictionary.





 The data dictionary is a database itself, documents the data.





 Each database user can consult the data dictionary to learn what each piece of data and the various synonyms of the data fields mean.





In a system where the data dictionary is part of the DBMS (Integrated system) the data dictionary stores information concerning the source of each data-field value, the frequency of its use, and an audit trail concerning updates, including the who and when of each update.





Currently data dictionary systems are available as add-ons to the DBMS.





 The data dictionary stores:





•      Names of relations





•      Names of the attributes of each relation





•      Domains, and lengths of attributes





•      Names of views defined on the database, and definitions of those views





•      Names of authorized users                       - ,





•      Accounting information about users





•      Number of tuples in each relation





•      Method of storage used for each relation





•     Name of the index





•      Name of the relation being indexed





•      Attributes on which the index is defined





•      Type of index formed





(iii) Indices





Indices, which can provide fast access to data items. A database index provides pointers to those data items that hold a particular value. Hashing is an alternative to indexing that is faster in some but not all cases.





(iv) Statistical Data





It stores statistical information about the data stored in the database, like number of records, blocks etc. in a table. This information can be used to execute a query efficiently.





Database applications are usually categories as: (1) two-tier application and (2) three-tier applications.





A two-tier application comprises two parts (1) database and (2) application programs.





A three-tier application comprises three parts: (1)database ,(2) business logic and  (3) application programs.       





==================================================================


Post a Comment

0 Comments