DBMS Architechture
DBMS Architechture
Two-tier Client / Server architecture is used for User Interface program and Application
Programs that runs on client side. An interface called ODBC(Open Database Connectivity)
provides an API that allow client side program to call the dbms. Most DBMS vendors
provide ODBC drivers. A client program may connect to several DBMS's. In this
architecture some variation of client is also possible for example in some DBMS's more
functionality is transferred to the client including data dictionary, optimization etc. Such
clients are called Data server.
Three-tier Client / Server Architecture
Three-tier Client / Server database architecture is commonly used architecture for web
applications. Intermediate layer called Application server or Web Server stores the web
connectivty software and the business logic(constraints) part of application used to access
the right amount of data from the database server. This layer acts like medium for sending
partially processed data between the database server and the client.
• Hierarchical Model
• Network Model
• Relational Model
Hierarchical Model
In this model each entity has only one parent but can have several children . At the top of
hierarchy there is only one entity which is called Root.
Network Model
In the network model, entities are organised in a graph,in which some entities can be
accessed through several path
Relational Model
In this model, data is organised in two-dimesional tables called relations. The tables or
relation are
related to
each other.
Schemas
Definition of schema: Design of a database is called the schema. Schema is of
three types:
Physical schema,
logical schema and
view schema.
A database schema is a description of the database, its structure and its constraints. A
database schema does not change with time frequently. Once defined it remains so
till the database structure is altered or constraints are added / removed. Schema is also
called intension
The design of a database at physical level is called physical schema, how the
data stored in blocks of storage is described at this level.
Design of database at logical level is called logical schema, programmers and
database administrators work at this level, at this level data can be described as
certain types of data records gets stored in data structures, however the internal
details such as implementation of data structure is hidden at this level (available
at physical level).
Design of database at view level is called view schema. This generally
describes end user interaction with database systems.
The external or view level includes a number of external schemas or user views.
Each external schema describes the part of the database that a particular user group is
interested in and hides the rest of the database from that user group. As in the previous
level, each external schema is typically implemented using a representational data model,
possibly based on an external schema design in a high-level data model.
Instances
Definition of instance:: The data stored in database at a particular moment of
time is called instance of database. Database schema defines the variable
declarations in tables that belong to a particular database; the value of these
variables at a moment of time is called the instance of that database.
Instance of the database, also known as the database state, is the actual data available
/ stored in the database at a particular point of time. Instance is also called extension.
The database instance / state changes every time the database is updated.
STATES
The distinction between database schema and database state is very important. When
we define a new database, we specify its database schema only to the DBMS.
At this point, the corresponding database state is the empty state with no data.
We get the initial state of the database when the database is first populated
or loaded with the initial data.
From then on, every time an update operation is applied to the database, we get another
database state. At any point in time, the database has a current state.
The DBMS is partly responsible for ensuring that every state of the database is a valid
state—that is, a state that satisfies the structure and constraints specified in the schema.
Hence, specifying a correct schema to the DBMS is extremely important and the schema
must be designed with utmost care.
The DBMS stores the descriptions of the schema constructs and constraints—also called
the meta-data—in the DBMS catalog so that DBMS software can refer to the schema
whenever it needs to.
The schema is sometimes called the intension, and a database state is called
an extension of the schema.
Data independence
The ability to modify a schema definition in one level without affecting a schema definition
in the next higher level is called Data Independence.
It is independence between the programs and thedata.
Logical data independence is a kind of mechanism, which liberalizes itself from actual data
stored on the disk. If we do some changes on table format, it should not change the data
residing on the disk.
Physical Data Independence
All the schemas are logical, and the actual data is stored in bit format on the disk. Physical
data independence is the power to change the physical data without impacting the schema
or logical data.
For example, in case we want to change or upgrade the storage system itself − suppose
we want to replace hard-disks with SSD − it should not have any impact on the logical data
or schemas.
Interfaces
Forms-Based Interfaces. A forms-based interface displays a form to each user. Users can
fill out all of the form entries to insert new data, or they can fill out only certain entries, in
which case the DBMS will retrieve matching data for the remaining entries.
Graphical User Interfaces. A GUI typically displays a schema to the user in diagrammatic
form. The user then can specify a query by manipulating the diagram. In many cases, GUIs
utilize both menus and forms. Most GUIs use a pointing device, such as a mouse, to
select certain parts of the displayed schema diagram.
Natural Language Interfaces. These interfaces accept requests written in English or some
other language and attempt to understand them. A natural language interface usually has
its own schema, which is similar to the database conceptual schema, as well as a dictionary
of important words. The natural language interface refers to the words in its schema, as well
as to the set of standard words in its dictionary, to interpret the request. If the interpretation
is successful, the inter-face generates a high-level query corresponding to the natural
language request and submits it to the DBMS for processing; otherwise, a dialogue is
started with the user to clarify the request. The capabilities of natural language interfaces
have not advanced rapidly.
Speech Input and Output. Limited use of speech as an input query and speech as an
answer to a question or result of a request is becoming commonplace. Applications with
limited vocabularies such as inquiries for telephone directory, flight arrival/departure, and
credit card account information are allowing speech for input and output to enable
customers to access this information. The speech input is detected using a library of
predefined words and used to set up the parameters that are supplied to the queries. For
output, a similar conversion from text or numbers into speech takes place.
Interfaces for Parametric Users. Parametric users, such as bank tellers, often have a
small set of operations that they must perform repeatedly. For example, a teller is able to
use single function keys to invoke routine and repetitive transactions such as account
deposits or withdrawals, or balance inquiries. Systems analysts and programmers design
and implement a special interface for each known class of naive users.
Interfaces for the DBA. Most database systems contain privileged commands that can be
used only by the DBA staff. These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema, and reorganizing the
storage structures of a database.
Overall Structure of DBMS
DBMS acts as an interface between user and the database. DBMS are very large and
typically divided into modules :-
DDL Compiler - Converts DDL statements to a set of tables containing metadata stored in
a data dictionary.Metadata information can be the name of files,data items,storage details of
each file,mapping information and constraints,etc.
DML Compiler and Query Optimizer - DML compiler translates the Data Manipulation
Languages into query
Data Manager - The data manager is the central software component of the DBMS. It is
sometimes referred to as the database control system.
One of the functions of the data manager is to convert operations in the user's queries
coming directly via the query processor or\ indirectly via an application program from the
user's logical view to a physical file system.
The data manager is responsible for interfacing with the file system as show. In addition, the
tasks of enforcing constraints to maintain the consistency and integrity of the data, as well
as its security, are also performed by the data manager.
It is also the responsibility of the Data. Manager to provide the synchronization in the
simultaneous operations performed by concurrent users and to maintain the backup and
recovery operations.
Compiled DML - The DML complier converts the high level Queries into low level file
access commands known as compiled DML.
End Users - End Users are the people who interact with the database through applications
or utilities. The various categories of end users are:
1. Casual End Users - These Users occasionally access the database but may need
different information each time. They use sophisticated database Query language to specify
their requests. For example: High level Managers who access the data weekly or biweekly.
2. Native End Users - These users frequently query and update the database using
standard types of Queries. The operations that can be performed by this class of users are
very limited and effect precise portion of the database. For example: - Reservation clerks for
airlines/hotels check availability for given request and make reservations. Also, persons
using Automated Teller Machines (ATM's) fall under this category as he has access to
limited portion of the database.
3. Standalone end Users/On-line End Users - Those end Users who interact with the
database directly via on-line terminal or indirectly through Menu or graphics based
Interfaces. Example:-Library Management System.