2 - Database Users and Models
2 - Database Users and Models
Fundamentals
Lecture 2
Dr. Mona Nashaat
Database Users
- Database users interact with data to update, read and modify the
given information.
- There are various types of database users.
- First, to build a database, we need to follow these steps:
2. Database design
3. Implementation
4. Application development
2
Database Users
Step 1 Step 4
Step 2 Step 3
Analysis and Application
Database Implementation
requirement development
design
gathering
3
DBMS Architecture: Three-schema Architecture
- The DBMS’s three-schema architecture divides the conceptual and
physical layers, enabling independent modifications to each layer
without impacting the others.
External Schema
Conceptual schema
Physical schema
4
Disk
DBMS Architecture: Three-schema Architecture
- The three layers of a three-schema architecture are:
1. External Layer
2. Conceptual Layer
3. Internal Layer
5
External layer
- External layer offers a logical perspective of the database, serving
as the accessible portion that users interact with.
- This topmost layer is specifically designed to provide a user-
friendly interface for the database.
Conceptual schema
Physical schema
Disk
6
External layer - Example
7
Conceptual Schema
- The Conceptual schema serves as a high-level representation of
the database.
- The Conceptual schema is commonly visualized using the Entity-
Relationship Model (ER Model), which employs symbols to visually
represent data elements and relationships specific to a given
system.
- In an ER Model, the database is portrayed through an ER
Diagram.
8
Example of ER Diagram
9
Internal Schema
- The internal schema refers to the lowest level of the three-schema
architecture.
- It describes the physical storage structure and organization of data
within the database.
- The internal schema defines how the data is stored on the storage
media, such as disks or tapes, and how it is accessed by the
system. This includes details like data file formats, indexing
techniques, and storage allocation methods.
- It is hidden from the users and applications that interact with the
database through the higher-level schemas.
10
Advantages of Three schema architecture
- Data Independence: The separation of the three schema layers
(external, conceptual, and internal) provides data independence.
Changes made to one layer do not affect the other layers.
- Modular Development: The three-schema architecture enables
modular development of the database system. Each schema layer
can be designed, implemented, and modified independently.
- Enhanced Security and Privacy: The three-schema architecture
helps enforce security and privacy measures. Access controls can
be implemented at the external schema level to restrict user
access to sensitive data, ensuring data security.
11
Advantages of Three schema architecture
- Improved Performance: The separation of the internal schema
allows for efficient storage and retrieval mechanisms to be
implemented.
- Data Consistency and Integrity: The conceptual schema acts as
an intermediary layer between the external and internal schemas,
ensuring data consistency and integrity. It provides a standardized
and consistent view of the data across different external schemas,
enforcing data integrity constraints and validation rules.
12
Disadvantages of three schema architectures
- Increased Complexity: The architecture introduces additional
complexity to the design and development of a database system.
Managing and coordinating the interactions between the external,
conceptual, and internal schemas can be more challenging.
- Higher Overhead: The separation of the three layers can result in
increased overhead in terms of storage and processing. Each layer
requires its own mappings, transformations, and operations, which
may impact system performance and resource utilization.
- Additional Development Effort: Designing and implementing the
three schema layers requires additional development effort.
13
Disadvantages of three schema architectures
- Lack of Flexibility: While the architecture provides data
independence, it may also limit the flexibility to make certain types
of changes. Modifying the conceptual schema, in particular, can
have ripple effects on the external and internal schemas, requiring
updates and adjustments in multiple layers.
- Learning Curve: Understanding and working with the three-
schema architecture may require a steeper learning curve for
developers and database administrators. The concepts and
techniques involved in managing the interactions between the
schemas may be more complex and require additional training and
expertise.
14
Data Models
- Data models are visual representations of data elements and the
connections between them.
- There are two data models in DBMS:
15
The logical model
• The logical model/ conceptual model: it provides concepts that are
close to the way many users perceive data, entities, attributes, and
relation ships (Example: ERD)
16
The physical model
• The physical model: describes how data is stored in the computer
and the access path needed to access and search for data
17