You are on page 1of 9

INFS2608 Lecture 1 Database Environment Notes

Three-Level Architecture

 All users should be able to access same data.


o E.g. If one application changes bank balance from $200 to $300, then all the other
applications should immediately see $300.
 A user’s view is immune to changes made in other views
o Changes can be made in other views and users should not need to know about the
physical database storage structure.
o If you upload a PDF file on Moodle, then we don’t need to know whether it is on a
hard disk drive or if it is on a solid state drive and in a certain sense we don’t care
because we expect that Moodle keeps on working regardless of where the data is
stored.
 Users should not need to know physical database storage details.
 DBA should be able to change database storage structures without affecting the users’
views.
 Internal structure of database should be unaffected by changes to physical aspects of
storage.
 DBA should be able to change conceptual structure of database without affecting all users.

ANSI-SPARC Three-Level Architecture

(master model)
 External Level
o Users’ view of the database.
o Describes that part of database that is relevant to a particular user.
 Conceptual Level
o Community view / Master View of the database.
o Any data that is needed by any of the applications
o Describes what data is stored in database and relationships among the data.
 Internal Level
o Physical representation of the database on the computer.
o Describes how the data is stored in the database

Data Independence

 Logical Data Independence


o First level of data independence
o Refers to immunity of external schemas to changes in conceptual schema.
o Conceptual schema changes (e.g. addition/removal of entities) should not reuire
changes to external schema or rewrites of application programs.
o For example, the addition or removal of new entities, attributes, or relationships to
the conceptual schema sternal schemas or having to rewrite existing application
programs.
 Physical Data Independence
o A level down from logical data independence
o Refers to immunity of conceptual schema to changes in the internal/ physical
schema.
o Internal schema changes (e.g. using different file organizations, storage
structures/devices) should not reuire change to conceptual or external schemas
o 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.

Database Languages

 Data Definition Language (DDL)


o Allows the DBA or user to describe and name entities, attributes, and relationships
reuired for the application plus any associated integrity and security constraints.
 Data Manipulation Language (DML)
o Provides basic data manipulation operations on data held in the database.
o Procedural DML
 Allows user to tell system exactly how to manipulate data. (
 Have programming structures, steps and conditions and variables.
 This means that the user must express all the data access operations that
are to be used by calling appropriate procedures to obtain the information
reuired.
 Typically, such a procedural DML retrieves a record, processes it and, based
on the results obtained by this processing, retrieves another record that
would be processed similarly, and so on.
 This process of retrievals continues until the data reuested from the
retrieval has been gathered.
 PL/SL is a procedural language

o Non-Procedural DML
 Allows user to state what data is needed rather than how it is to be
retrieved. (just a single statement, SELECT * from TABLE – SL is a non
procedural language)
Data Model

“Integrated collection of concepts for describing data, relationships between data, and constraints on
the data in an organization.”

 Data Model comprises:


o a structural part; (operators to create)
o a manipulative part; (operators to update/query)
o Possibly a set of integrity rules.
 Purpose: To represent data in an understandable and logical structured way.
 Categories of data models include:
o Object-based
o Record-based
o Physical

 Object-Based Data Models


o Entity-Relationship
o Semantic
o Functional
o Object-Oriented.
 Record-Based Data Models
o Relational Data Model
o Network Data Model
o Hierarchical Data Model.
 Physical Data Models
Conceptual Modelling

 Conceptual schema is the core of a system supporting all user views.


 Should be complete and accurate representation of an organization’s data requirements.
 Conceptual modelling is process of developing a model of information use that is
independent of implementation details.
 Result is a conceptual data model.

Functions of a DBMS

 Data Storage, Retrieval and Update.


 A User-Accessible Catalog.
 Transaction Support.
 Concurrency Control Services.
 Recovery Services. Authorization Services.
 Support for Data Communication.
 Integrity Services.
 Services to Promote Data Independence.
 Utility Services

System Catalog

 Repository of information (metadata, data dictionary) describing the data in the database.
 One of the fundamental components of DBMS.
 Typically stores:
o names, types, and sizes of data items;
o constraints on the data;
o names of authorized users;
o data items accessible by a user and the type of access;
o usage statistics.

Multi-User DBMS Architectures

1. Teleprocessing

2. File-server

3. Client-server

 Teleprocessing
o Mainframes where you would use TelNet to
connect from a terminal to the mainframe or
the central computer.
o Traditional architecture – all of the computing
sits in the middle surrounded by dummy
terminals that are only communicating with
the users but all the processing done in the
mainframe computer.
o Now this is coming back due to cloud computing  something like this.
 File-Server
o File-server is connected to several workstations across a network. Database resides
on file-server.
o Difference is the stations are not
dumb terminals but actually have
the database applications (e.g.
Oracle DBMS) on the individual
machines. Only the data is stored
on the file service.
o DBMS and applications run on
each workstation.
o Disadvantages include:
 Significant network
traffic.
 Copy of DBMS on each
workstation.
 Concurrency, recovery
and integrity control
more complex
 E.g. Which DBMS is responsible for it?
 Need to physical store copies of DMBS on each of the application
 Need a lot of network power.

Traditional Two-Tier Client-Server

 Client (tier 1) manages user interface and runs


applications.
 Server (tier 2) holds database and DBMS.
 Advantages include:
o wider access to existing databases;
o increased performance;
o possible reduction in hardware costs;
o reduction in communication costs;
o Increased consistency.
Three-Tier Client-Server

 Client side presented two problems preventing true scalability (problems two-tier):
 ‘Fat’ client, requiring considerable resources on client’s computer to run effectively.
 Significant client side administration overhead.
 By 1995, three layers proposed, each potentially running on a different platform.
 Advantages three-tier (presentation – business – data)
o ‘Thin’ client, requiring less expensive hardware.
o Application maintenance centralized.
o Easier to modify or replace one tier without affecting others.
o Separating business logic from database functions makes it easier to implement load
balancing.
o Maps quite naturally to Web environment.