Lec - 3-Database Users and Database Models
Lec - 3-Database Users and Database Models
End users
•Those whose jobs require access to the database
•Naive or parametric end users
•canned queries and updates
•Casual end users
•occasional, special-purpose access
•Sophisticated end users
•deep knowledge of database design and DBMS facilities
•Standalone users
•users of personal databases
System analysts
•Determine requirements of end users
Application programmers
•Implement complex specifications (business logic) as programs
A Database Management system is not always directly available for users and applications to access and store
data in it. A Database Management system can be centralized (all the data stored at one location),
decentralized (multiple copies of database at different locations) or hierarchical, depending upon its
architecture.
Database architecture focuses on the design, development, implementation and maintenance of computer
programs that store and organize information for businesses, agencies and institutions. A database architect
develops and implements software to meet the needs of users.
-The design of a DBMS depends on its architecture. It can be centralized or decentralized or hierarchical. The
architecture of a DBMS can be seen as either single tier or multi-tier. The tiers are classified as follows:
1. 1-tier architecture
2. 2-tier architecture
3. 3-tier architecture
4. n-tier architecture
1-tier architecture:
One-tier architecture involves putting all of the required components for a software application or technology
on a single server or platform.
1-tier architecture
Basically, a one-tier architecture keeps all of the elements of an application, including the interface, Middleware
and back-end data, in one place. Developers see these types of systems as the simplest and most direct way.
2-tier architecture:
The two-tier is based on Client Server architecture. The two-tier architecture is like client server application.
The direct communication takes place between client and server. There is no intermediate between client and
server.
2-tier architecture
3-tier architecture:
A 3-tier architecture separates its tiers from each other based on the complexity of the users and how they use
the data present in the database. It is the most widely used architecture to design a DBMS.
3-tier architecture
This architecture has different usages with different applications. It can be used in web applications and
distributed applications. The strength in particular is when using this architecture over distributed systems.
Database (Data) Tier − at this tier, the database resides along with its query processing languages. We
also have the relations that define the data and their constraints at this level.
Application (Middle) Tier − at this tier reside the application server and the programs that access the
database. For a user, this application tier presents an abstracted view of the database. End-users are
unaware of any existence of the database beyond the application. At the other end, the database tier is
not aware of any other user beyond the application tier. Hence, the application layer sits in the middle
and acts as a mediator between the end-user and the database.
User (Presentation) Tier − End-users operate on this tier and they know nothing about any existence of
the database beyond this layer. At this layer, multiple views of the database can be provided by the
application. All views are generated by applications that reside in the application tier.
N-tier architecture:
N-tier architecture would involve dividing an application into three different tiers. These would be the
1. logic tier,
2. the presentation tier, and
3. The data tier.
N-tier architecture
It is the physical separation of the different parts of the application as opposed to the usually conceptual or
logical separation of the elements in the model-view-controller (MVC) framework. Another difference from the
MVC framework is that n-tier layers are connected linearly, meaning all communication must go through the
middle layer, which is the logic tier. In MVC, there is no actual middle layer because the interaction is
triangular; the control layer has access to both the view and model layers and the model also accesses the view;
the controller also creates a model based on the requirements and pushes this to the view. However, they are not
mutually exclusive, as the MVC framework can be used in conjunction with the n-tier architecture, with the n-
tier being the overall architecture used and MVC used as the framework for the presentation tier.
Hierarchical Model
Network Model
Entity-relationship Model
Relational Model
Hierarchical Model
This database model organizes data into a tree-like-structure, with a single root, to which all the other data is
linked. The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real-world relationships like index of a book, recipes etc.
In hierarchical model, data is organized into tree-like structure with one one-to-many relationship between two
different types of data, for example, one department can have many courses, many professors and of-course
many students.
Network Model
This is an extension of the Hierarchical model. In this model data is organized more like a graph, and are
allowed to have more than one parent node.
In this database model data is more related as more relationships are established in this database model. Also, as
the data is more related, hence accessing the data is also easier and fast. This database model was used to map
many-to-many data relationships.
This was the most widely used database model, before Relational Model was introduced.
Entity-relationship Model
In this database model, relationships are created by dividing object of interest into entity and its characteristics
into attributes.
E-R Models are defined to represent the relationships into pictorial form to make it easier for different
stakeholders to understand.
This model is good to design a database, which can then be turned into tables in relational model(explained
below).
Let's take an example, If we have to design a School Database, then Student will be an entity with attributes
name, age, address etc. As Address is generally complex, it can be another entity with attributes street name,
pincode, city etc, and there will be a relationship between them.
Relational Model
In this model, data is organised in two-dimensional tables and the relationship is maintained by storing a
common field.
This model was introduced by E.F Codd in 1970, and since then it has been the most widely used database
model, infact, we can say the only database model used around the world.
The basic structure of data in the relational model is tables. All the information related to a particular type is
stored in rows of that table.
The main data objects are termed as Entities, with their details defined as attributes, some of these attributes are
important and are used to identity the entity, and different entities are related using relationships.
Let's take an example to explain everything. For a School Management Software, we will have to store
Student information, Teacher information, Classes, Subjects taught in each class etc.
Considering the above example, Student is an entity, Teacher is an entity, similarly, Class, Subject etc are
also entities.
An Entity is generally a real-world object which has characteristics and holds relationships in a DBMS.
If a Student is an Entity, then the complete dataset of all the students will be the Entity Set
ER Model: Attributes
If a Student is an Entity, then student's roll no., student's name, student's age, student's gender etc will be its
attributes.
An attribute can be of many types, here are different types of attributes defined in ER database model:
1. Simple attribute: The attributes with values that are atomic and cannot be broken down further are simple
attributes. For example, student's age.
2. Composite attribute: A composite attribute is made up of more than one simple attribute. For example,
student's address will contain, house no., street name, pincode etc.
3. Derived attribute: These are the attributes which are not present in the whole database management system,
but are derived using other attributes. For example, average age of students in a class.
4. Single-valued attribute: As the name suggests, they have a single value.
5. Multi-valued attribute: And, they can have multiple values.
ER Model: Keys
If the attribute roll no. can uniquely identify a student entity, amongst all the students, then the attribute roll no.
will be said to be a key.
1. Super Key
2. Candidate Key
ER Model: Relationships
When an Entity is related to another Entity, they are said to have a relationship. For example, A Class Entity is
related to Student entity, becasue students study in classes, hence this is a relationship.
For example, if 2 entities are involved, it is said to be Binary relationship, if 3 entities are involved, it is said to
be Ternary relationship, and so on.