0% found this document useful (0 votes)
28 views52 pages

Chapter 2 - Lecture

Lecture note on database architecture

Uploaded by

DaniTesfay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views52 pages

Chapter 2 - Lecture

Lecture note on database architecture

Uploaded by

DaniTesfay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

CHAPTER – TWO

Database System Concepts and


Architecture

Daniel Tesfay
Introduction

o The architecture of DBMS packages has evolved from the early monolithic systems, where the
whole DBMS software package was one tightly integrated system, to the modern DBMS
packages that are modular in design, with a client/server system architecture.
o In a basic client/server DBMS architecture, the system functionality is distributed between two
types of modules.
₋ A client module is typically designed so that it will run on a user workstation or personal computer.
Typically, application programs and user interfaces that access the database run in the client module.
Hence, the client module handles user interaction and provides the user friendly interfaces such as forms
or menu-based GUIs (graphical user interfaces).
₋ The other kind of module, called a server module, typically handles data storage, access, search, and other
functions.

12/4/2024 Fundamentals of Database Systems 2


Data Models

o One of the fundamental characteristic of the database approach is that it provides


some level of data abstraction.
₋ Data abstraction generally refers to the suppression (prevent from being
published) of details of data organization and storage, and the highlighting of the
essential features for an improved understanding of data.
o A data model a collection of concepts that can be used to describe the structure of a
database provides the necessary means to achieve this abstraction.
o By structure of a database we mean the data types, relationships, and constraints
that apply to the data.
12/4/2024 Fundamentals of Database Systems 3
Data Models(cont..)

o Most data models also include a set of basic operations for specifying
retrievals and updates on the database.
o Data model also include concepts to specify dynamic aspect or behavior of
a database application that allows database designer specify a set of:
₋ valid user defined operations like COMPUTE_GPA, which can be
applied on STUDENT object
₋ Generic operations to insert, delete, modify, or retrieve any kind of object
are often included in the basic data model operations.
12/4/2024 Fundamentals of Database Systems 4
Categories of Data Models
o Many data models have been proposed, which we can categorize
according to the types of concepts they use to describe the database
structure.
₋ High-level or conceptual data models provide concepts that are close
to the way many users perceive data, whereas
₋ Low-level or Physical Data Models provide concepts that describe
the details of how data is stored on the computer storage media,
typically magnetic disks.
12/4/2024 Fundamentals of Database Systems 5
Categories of Data Models

o Conceptual data models use concepts such as:

₋ entities, attributes, and relationships.

₋ An entity represents a real-world object or concept, such as an employee or a

project from the Mini world that is described in the database

₋ An attribute represents some property of interest that further describes an

entity, such as the employee’s name or salary.

₋ A relationship represents an association among the entities, for example, a

works-on relationship between an employee and a project


12/4/2024 Fundamentals of Database Systems 6
Categories of Data Models

o Physical data models describe how data is stored as files in the


computer by representing information such as record formats, record
orderings, and access paths.
o An access path is a structure that makes the search for particular
database records efficient.
o An index is an example of an access path that allows direct access to data
using an index term or a keyword. It is similar to the index at the end of a
book, except that it may be organized in a linear, hierarchical (tree-
structured),or some other fashion.
12/4/2024 Fundamentals of Database Systems 7
Categories of Data Models

o Implementation / Representational Data model: this model


₋ Entity referred as a Tables
₋ Attribute referred as columns
₋ Database compatible table names
₋ Database compatible column names
₋ database specific data types
₋ Difficult for users to understand
₋ Significantly more effort required to enhance in co[arson to Logical model

12/4/2024 Fundamentals of Database Systems 8


Data Model Case: Sales Database

 Conceptual /Logical Data model

 Physical Data model

 Implementation/Representational Data Model


Conceptual /Logical Data model
1. Conceptual (high-level, semantic) Data Models:
₋ Provide concepts that are close to the way many users perceive data. (Also
called entity-based or object-based data models.)
Product Sales Store
⁻ Highly abstract
Z Z ⁻ Easily understood

Z
⁻ Easily enhanced
⁻ Only Entities are visible
Time
⁻ Abstract relationship between
Entities
10
Physical Data model
1. Physical (low-level, internal) data models: Provide concepts that describe
details of how data is stored in the computer. These are usually specified in an
ad-hoc manner through DBMS design and administration manuals

o Physical model presents attributes for each Entity.


o Key attributes specified
o Non-Key attributes
o Primary key –Foreign key attributes
o User Friendly attribute names
o More detailed than conceptual
o Database agnostic
Implementation/Representational Data Model
3. Implementation (representational) data models: Provide
concepts that fall between the above two, balancing user views
with some computer storage details.

o Entity referred as a Tables


o Attribute referred as columns
o Database compatible table names
o Database compatible column names
o database specific data types
o Difficult for users to understand
o Significantly more effort required to enhance in
co[arson to Logical model
Schema vs Instance(State)

₋ Database Schema: The description of a database. Includes descriptions of the


database structure and the constraints that should hold on the database.

₋ Schema Diagram: A diagrammatic display of (some aspects of) a database


schema.

₋ Schema Construct: A component of the schema or an object within the schema,


e.g., STUDENT, COURSE.

₋ Database Instance: The actual data stored in a database at a particular moment


in time. Also called database state (or occurrence).

13
Database Schema Vs. Database State

o Database State: Refers to the content of a database at a moment in time.

₋ Initial Database State: Refers to the database when it is loaded

₋ Valid State: A state that satisfies the structure and constraints of the database.

o The database schema changes very infrequently. The database state


changes every time the database is updated.
Three-Schema Architecture
o Proposed to support DBMS characteristics of:
₋ Program-data independence.
₋ Support of multiple views of the data.
o Defines DBMS schemas at three levels:
1. Internal schema at the internal level to describe physical storage structures and access
paths. Typically uses a physical data model.
2. Conceptual schema at the conceptual level to describe the structure and constraints for
the whole database for a community of users. Uses a conceptual or an implementation
data model.
3. External schemas at the external level to describe the various user views. Usually uses
the same data model as the conceptual level.
15
Three-Schema Architecture

o Mappings among schema levels are needed


to transform requests and data. Programs
refer to an external schema, and are mapped
by the DBMS to the internal schema for
execution.

16
Centralized vs Client-Server DBMS Architectures
Centralized DBMS Architectures

o Centralized DBMS:
₋ Combines everything into single system including DBMS
software, hardware, application programs, and user
interface processing software.
₋ User can still connect through a remote terminal
however, all processing is done at centralized site.
₋ Data is stored and managed on a single central server
₋ The clients will access resources directly without
request
₋ All data operation, Update, query, delete, and data
management are performed at the central location
Centralized DBMS Architectures

o Characteristics of Centralized DBMS:


₋ Single Point of Data Storage: All the data is stored on one central server,
simplifying data management.
₋ Minimal Client-Side Processing: Clients usually have a minimal role,
mainly focused on displaying data and user interaction.
₋ Single Database Management System: Only one DBMS instance handles
all operations, making it easier to maintain consistency and security.
₋ Direct Communication: Clients directly communicate with the central
server for data retrieval and updates.
Centralized DBMS Architectures

Advantages of Centralized DBMS: Disadvantages of Centralized DBMS


₋ Ease of Management: Centralized architecture o Scalability Issues: As the number of clients grows, the
simplifies data management, backup, and central server may become a bottleneck, affecting
security. performance.

₋ Consistency: Since all data is stored in one place, o Single Point of Failure: If the central server goes down,

there’s a reduced risk of inconsistency. the entire system becomes unavailable.

₋ Security: Data security is easier to implement as o Limited Flexibility: Clients depend entirely on the

all data access points are controlled from a single central server for data processing, limiting their

server. autonomy.

₋ Cost-Effective: With centralized hardware and o Network Dependency: Performance is heavily

software, the costs are lower for smaller dependent on the network's reliability and speed.

organizations.
Client-Server DBMS Architectures

o In Client-Server DBMS Architecture, the database is hosted on a server, and clients


(computers or devices) connect to the server to interact with the database.

o The architecture is split into two main components:

₋ the client and the server. The server manages the database and handles
requests from the client, while the client sends requests to the server and
displays the results.
Client-Server DBMS Architectures

o Characteristics of Client-Server DBMS:


₋ Separation of Concerns: The client handles the presentation, while the
server handles the data processing and storage.

₋ Multiple Clients: The system can support multiple clients accessing the
database concurrently.

₋ Distributed System: The server and clients can be located on different


machines, communicating over a network.
Client-Server DBMS Architectures
Advantages of Client-Server DBMS Disadvantages of Client-Server DBMS
o Scalability: Easily scalable as more clients can be o Complexity: More complex to implement than a
added to the system without affecting the server’s centralized DBMS because of the distributed nature and
performance drastically. network dependencies.
o Separation of Concerns: Easier maintenance and o Network Dependency: The system’s performance is reliant
updates since the client and server roles are distinct. on network speed and reliability. Slow networks may
o Improved Performance: Offloads some of the impact client-server communication.
processing tasks to the client, which reduces the o Single Point of Failure: While the server can be redundant,
load on the server. if the server fails and there is no backup, the system can
o Security and Centralized Control: The database go down.
server can manage access control and encryption,
ensuring security.
Use cases of Client Server DBMS (Application Areas)

o Large-scale enterprise applications where multiple users access the


same database concurrently (e.g., customer relationship management
(CRM) systems, e-commerce platforms).

o Online banking, where clients/users interact with the server to access


account information and perform transactions.

o Distributed applications, where the client layer might be installed on


various devices (e.g., desktops, mobile phones), and the server handles
the data processing and storage.
Client-Server DBMS Architectures

o Basic Client-Server Architectures components


₋ Specialized Servers (Dedicated Server)
₋ Clients
₋ DBMS Server
Specialized Servers (Dedicated Server)

o Dedicated servers are servers specifically configured to perform a single specialized function, ensuring optimal
performance and resource allocation.

o Examples of Dedicated servers include:

₋ File Server: Manages file storage and sharing.


₋ Web Server: Hosts and delivers web pages (E.g., Apache HTTP Server, IIS, Google Webserver(GWS), Tomcat).

₋ Mail Server: Handles email sending and receiving.


₋ Database Server: Manages databases and processes queries.
₋ Printer Server: A Printer Server is a specialized server that manages print tasks and connections between client

devices and printers. It allows multiple users to share one or more printers efficiently in a networked

environment.
o Advantages: High performance, reliability, security, and scalability.
Clients

₋ Provide appropriate interfaces and a client version of the


system to access and utilize the server resources.

₋ Clients maybe diskless machines or PCs or Workstations


with disks with only the client software installed.

₋ Connected to the servers via some form of a network.

₋ A clint always send request to the server


DBMS Server

o DBMS server is specialized software that manages, stores, and retrieves data
for applications or users over a network.

₋ Provides database query and transaction services to the clients

₋ Sometimes called query and transaction servers

o Key features include: Data Storage and Retrieval, Security, Concurrency,


and Query processing
Types of Client Server Architecture

₋ Two Tire Client Server Architecture

₋ Three Tire Client-server Architecture


Two Tier Client-Server Architecture

o In a two Tire Client-Server Architecture, Client and Server Layers are available

₋ Client Layer:

• Acts as front-end interface for user


• At a client layer, user interface or application programs run on the client side
• Interface called ODBC (Open Database Connectivity) provides an Application
program interface (API) allow client side programs to call the DBMS. Most
DBMS vendors provide ODBC drivers.
Two Tier Client-Server Architecture

o Server Layer:

₋ Acts as the back-end system.


₋ Responsible for processing client requests, managing databases, and business logic.
₋ Can host databases (DBMS) or application services.
₋ Examples: Database servers like MySQL, Oracle, or SQL Server.
o Examples of Two-Tire architecture includes:
₋ Desktop Application i.e. Library management System, where the client sends SQL
queries to the database server, retrieves book records, and displays them to the user.
Logical two-tier client server architecture
Three Tier Client-Server Architecture

o The three-tier client-server architecture is a network model that organizes an


application into three separate layers: the presentation layer, the application
layer, and the data layer. This architecture is designed to improve scalability,
maintainability, and performance by separating concerns.

o Common for Web applications

o Presentation Layer (Client Tier)


₋ User interface layer that interacts directly with user
₋ Handles input from user and display output result to the user
Three Tier Client-Server Architecture
o Application Layer(Middle Tire )
₋ It is Intermediate Layer
₋ stores the web connectivity software and the rules and business logic
₋ This is responsible to process the client request, execute application logic and
interact the data layer.
₋ Acts like a channel for sending partially processed data between the database
server and the client.
₋ Examples: Web Server, API and Application Servers (Apache Tomcat, IIS)
Three Tier Client-Server Architecture

o Data Layer (Database Tire)


₋ Store and manage application data
₋ Includes Database Server that handles
Data Query,, update and manage data
₋ Examples: MySQL, Oracle, SQL Server,
PostgreSQL etc..
Data Independence
o Data independence is a capacity of DBMS to change the schema at one level of a
database system without having to change the schema at the next higher level.
1. Logical Data Independence: The capacity to change the conceptual schema
without having to change the external schemas and their application programs.
2. Physical Data Independence: The capacity to change the internal schema without
having to change the conceptual schema.
₋ For example, the internal schema may be changed when certain file structures are
reorganized or new indexes are created to improve database performance

36
DBMS Languages
₋ DDL(Data Definition Language ), is used by the DBA and database designers to specify
the conceptual schema of a database. In many DBMSs, the DDL is also used to define
internal and external schemas (views).
₋ SDL (storage definition language), is used to specify the internal schema.
₋ VDL (view definition language), Specifies user views/mappings to conceptual schema
₋ DML (Data manipulation language), is used to manipulate the database. Typical
manipulations include retrieval, insertion, deletion and modification of the data. This can be
embedded in a general-purpose programming language (host language), such as COBOL,
C or an Assembly Language and alternatively, stand-alone DML commands can be applied
directly (query language).
₋ DCL: Access Control language (Grant, Revoke)
37
DBMS Interfaces

o Stand-alone query language interfaces.

₋ Example: Entering SQL queries at the DBMS interactive SQL interface

o Programmer interfaces for embedding DML in programming


languages:
₋ Like Pre-compiler and Procedure (Subroutine) Call Approach
o User-friendly interfaces:
₋ Menu-based, forms-based, graphics-based, etc.
DBMS Interfaces

o Web Browser as an interface


o Interfaces for the DBA:
₋ Creating accounts, granting authorizations
₋ Setting system parameters
₋ Changing schemas or access path
Database system environment

41
Classification of DBMS Based on Data Model

• Traditional o Emerging
• Network o Object Oriented Model
• Hierarchical o Object Relational Model
• Relational
Classification of DBMS Based on Data Model

o Network Model
₋ Structure: Data is represented as a graph, with entities as nodes and
relationships as edges. This allows for many-to-many relationships.

₋ Relationships between records are maintained through pointers.

₋ More flexible than the hierarchical model.

₋ Example: Banking systems, where accounts (nodes) are linked to


customers, branches, and transactions (other nodes).
Example of Network Model Schema
Network Model

o Advantages:
₋ Network Model is able to model complex relationships and represents
semantics of add/delete on the relationships.
₋ Can handle most situations for modeling using record types and
relationship types.
₋ Language is navigational; uses constructs like FIND, FIND member, FIND
owner, FIND NEXT within set, GET, etc.
• Programmers can do optimal navigation through the database.
Network Model

o Disadvantages:

₋ Navigational and procedural nature of processing

₋ Database contains a complex array of pointers that thread


through a set of records.

• Little scope for automated “query optimization”


Hierarchical DBMS

₋ The hierarchical model represents data as hierarchical tree


structures.

₋ Each hierarchy represents a number of related records.

₋ There is no standard language for the hierarchical model.


Hierarchical Model
o Advantages:
₋ Simple to construct and operate
₋ Corresponds to a number of natural hierarchically organized domains, e.g., organization
(“org”) chart
₋ Language is simple:
• Uses constructs like GET, GET UNIQUE, GET NEXT, GET NEXT WITHIN PARENT, etc.

o Disadvantages:
₋ Navigational and procedural nature of processing
₋ Database is visualized as a linear arrangement of records
• Little scope for "query optimization"
Relational Model

o Structure: Data is stored in tables (relations), where each row represents a


record, and columns represent attributes. Relationships are managed
through keys (primary and foreign keys).

o Uses SQL (Structured Query Language) for data manipulation.

o Data is logically structured rather than relying on physical storage.


Comparison of Traditional Models

Feature Hierarchical Model Network Model Relational Model


Graph with nodes and Tables with rows and
Data Structure Tree-like hierarchy
edges columns
Many-to-many using
Relationships One-to-many Many-to-many
foreign keys
Flexibility Low Medium High
Ease of Use Complex for updates Complex due to pointers Simple with SQL
Scalability Limited Moderate High
Inventory and sales
Examples Organizational charts Banking systems
systems
Object-oriented and Object Relational Models

o Both the Object-Oriented Model (OOM) and the Object-

Relational Model (ORM) are advanced database models

that bridge the gap between object-oriented programming

and database systems.


Aspect Object-Oriented Model (OOM) Object-Relational Model (ORM)
• Directly integrates object-oriented concepts like • Extends the relational model with object-oriented
Definition inheritance, encapsulation, and polymorphism into features like user-defined types and object
the database. support.
• Stores data in relational tables but allows object-
Data Structure • Stores data as objects
like structures through extensions.
• Objects, classes, and methods are fundamental. • Built on the relational foundation.
Key
• Inherits all OOP features like inheritance and • Adds features like complex data types,
Characteristics
polymorphism. inheritance, and methods.
• Data is stored in tables, but tables can include
Storage • Objects are stored directly as instances of classes.
object-like attributes.
Query
• Uses an object query language (OQL). • Extends SQL with object-oriented features
Language
Data • Data is manipulated using relational queries with
• Data is manipulated via object methods.
Manipulation additional object-oriented capabilities.
Schema • Highly flexible and aligned with object-oriented • Slightly less flexible due to its relational
Flexibility programming. foundation.
• Efficient for applications with complex objects and • Balances object-oriented features with the
Performance
relationships. performance of relational systems.
Complexity • Complex to implement • Easier to adopt
• Scalable for object-oriented use cases but less so • Scalable for both object-oriented and traditional
Scalability
for traditional relational workloads. relational use cases.
Thank You!

You might also like