Unit - 1.2
Unit - 1.2
Unit 1
Database System Concepts and Architecture: Data Models, Schemas, and
Instances - Three-Schema Architecture and Data Independence - Database
Languages and Interfaces - The Data base System Environment - Centralized
and Client/Server Architectures for DBMSs.
Data Models
A Data Model in Database Management System (DBMS) is the concept of tools that
are developed to summarize the description of the database.
A collection of concepts that can be used to describe the structure of a database.
Data Models provide us with a transparent picture of data which helps us in creating
an actual database.
It shows us from the design of the data to its proper implementation of data.
Data models define how the logical structure of a database is modeled.
Data Models are fundamental entities to introduce abstraction in a DBMS.
Data models define how data is connected to each other and how they are processed
and stored inside the system.
o Components of ER Model:
Entity: An entity is referred to as a real-world object. It can be a name,
place, object, class, etc. These are represented by a rectangle in an ER
Diagram.
Attributes: An attribute can be defined as the description of the entity.
These are represented by Eclipse in an ER Diagram. It can be Age, Roll
Number, or Marks for a Student.
Relationship: Relationships are used to define relations among different
entities. Diamonds and Rhombus are used to show Relationships.
o 2. Representational Data Model:
o This type of data model is used to represent only the logical part of the database
and does not represent the physical structure of the database.
o 3. Physical Data Model :
o Provide concepts that describe the details of how data is stored in computer
system, such as record formats, orderings of records, access paths (indexes).
o An access path is a structure that makes the search for particular database records
efficient.
Schemas
Schema is the overall description of the database. The basic structure of how the data
will be stored in the database is called schema.
A database schema is the skeleton structure that represents the logical view of the
entire database. It defines how the data is organized and how the relations among
them are associated. It formulates all the constraints that are to be applied on the
data. (or)
A database schema is the logical representation of a database, which shows how
the data is stored logically in the entire database. It contains list of attributes and
instruction that informs the database engine that how the data is organized and how
the elements are related to each other.
In actual, the data is physically stored in files that may be in unstructured form, but to
retrieve it and use it, we need to put it in a structured form. To do this, a database
schema is used. It provides knowledge about how the data is organized in a database
and how it is associated with other data.
Database State:
o Refers to the content of a database at a moment in time.
o Initial Database State:
o Refers to the database state when it is first populated or loaded with initial
data.
o Valid State:
o A state that satisfies the structure and constraints specified in the schema.
Distinction
o The database schema changes very infrequently.
o The database state changes every time the database is updated.
o Schema is also called intension.
o State is also called extension.
Figure 4: Example for Database State
Data Model is a high level design which defines the kind of tables, the fields in those
tables and the relations between different tables. Database schema describes the
type(int, string etc) and constraints like length of field should be less than 20
characters.
Instances
The situation where a data or information is stored in the database at a particular
moment of time is called an instance.
In a database, there will be many read, and write operations. So we can't say we have
content in the database as the data in the database is changing frequently.
So,Instance in DBMS represents the data/information present in the database at
a particular instance/time.
Let's say we have a STUDENT table, below is the representation of the table on 16th
May.Suppose a new student is enrolled in the university on 17th May. Now the
database will be updated and this is shown below.
Now, if we say we need instance of STUDENT table on 16th May, Table present at
the left will be returned.
But, when we say we need instance of STUDENT table on 17th May, Table present
on the right will be returned.
Finally, we can say that the content of database at a point of time is called instance or
database state.
Three-Schema Architecture
The three-schema architecture divides the database into three-level used to create a
separation between the physical database and the user application.
In simple terms, this architecture hides the details of physical storage from the user.
The database administrator (DBA) responsible is to change the structure of database
storage without affecting the user’s view. It deals with the data, the relationship
between them and the different access methods implemented on the database. The
logical design of database is called a schema.
The framework of this type of architecture includes an external schema, a conceptual
level, an internal schema, and then the database itself. The various levels of the
database are mapped, which leads to the transformation of response and request in the
database.
The three-schema architecture is as follows:
This interface is further divided into four categories on the basis of technology used.
Menu based :
o In this, all the options are displayed in form of a list or menu, through which we
can select any option and that option leads us to the destination.
o Example: When we search anything in a web browser then it shows all the
possible results in a list manner, from which we can click on any option.
o Or access any website, where all available options are arranged in menu form.
Form based:
o In this, a form type structure is shown to the user to insert data or operate data in a
database.
o Example: online form filling for exams.
o This is also a good option to prevent redundancy because each and every user
need to go through these forms to access or manipulate databases.
o This concept makes computing very easy for those who have only basic
knowledge of computer operation.
The DBA staff works on defining the database and tuning it by making changes to its
definition using the DDL and other privileged commands.
DDL compiler processes schema definitions, specified in the DDL, and stores
descriptions of the schemas in the DBMS catalog.
DBMS catalog includes information such as the names and data types of data item,
names and sizes of files, storage details of each file, mapping information among
schemas, and constraints. These are accessed by various modules of DBMS as shown
by dotted lines.
Casual users use interactive query interface. The queries are parsed and validated for
correctness of the query syntax, the names of files and data elements, and so on by a
query compiler that compiles them into an internal form.This internal form is
subjected to query optimization.
The query optimizer is concerned with the rearrangement and possible reordering of
operations, elimination of redundancies, and use of correct algorithms and indexes
during execution.It consults the system catalog for statistical and other physical
information about the stored data and generates executable code that performs
necessary operations for the query and makes calls to the runtime processor.
Application programmers write programs in host language (C, C++, Java) and
submitted to a pre-compiler.
The pre-compiler extracts DML commands from an application program, and these
commands are sent to DML compiler for compilation into object code for database
access.
The rest of the program is sent to the host language compiler.The object codes for
the DML commands and the rest of the program are linked, forming a canned
transaction whose executable code includes calls to the runtime database processor.
Parametric users Canned transactions are executed repeatedly, whosimply supply
the parameters to the transactions. Each execution is considered to bea separate
transaction. An example is a bank withdrawal transaction where theaccount number
and the amount may be supplied as parameters.
The runtime database processor executes (1) the privileged commands, (2) the
executable query plans, and (3) the canned transactions with runtime parameters. It
works with the system catalog and may update it with statistics.
The runtime database processor handles other aspects of data transfer, such as
management of buffers in the main memory. Some DBMSs have their own buffer
management module while others depend on the OS for buffer management.
The stored data manager, which in turn uses basic operating system services for
carrying out low-level input/output (read/write) operations between the disk and main
memory.
Concurrency control and backup and recovery systems modules are integrated
into the working of the runtime database processor for the purposes of transaction
management.
Centralized and Client/Server Architectures
for DBMSs
In Centralized Architecture, the mainframe computers are used for processing
all system functions including User application Programs and User Interface
Programs as well as DBMS functionalities.
This is because in earlier days, most users accessed such systems via Computer
Terminals, which can’t Process, and they have only display capability. Therefore, the
Processing used to takeplace in these Computer Systems and the display information
is sent to display terminals and these terminals are connected to mainframe computers
via various kinds of Networks.
As the days pass by, we are now having Personal Computers (PC’s) in the market.
But still in the beginning Centralized Architecture for DBMS was used. Gradually the
DBMS systems started to make use of Processing Power in the used side i.e
Computers have come with Processing Power and in turn led to the use of
Client/Server Architecture.
-------------------------------------------------------------------------------------------------------