Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE”...

45
Academic Year 2014 Spring

Transcript of Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE”...

Page 1: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Academic Year 2014 Spring

Page 2: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

MODULECC3005NI:Advanced Database Systems

“DATABASE ARCHITECTURE”

Academic Year 2014 Spring

Page 3: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Topics: Historical Developments

Navigational Data Models Non-navigational Data Model

Data Independence Database Languages

Page 4: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Historical Developments: Navigational Data Models:

Hierarchical Model Network Model

Non-navigational Data Model: Relational Model

Page 5: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model: Developed in the 1960s To manage large amounts of data for complex

manufacturing projects such as Apollo rocket that landed on moon (1969)

Its basic logical structure is represented by an upside-down tree.

The hierarchical structure contains levels, or segments. A segment is equivalent of a file system’s record type.

Page 6: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model: Within the hierarchy, a higher layer is perceived as the

parent of the segment directly beneath it, which is called the child.

The hierarchical model depicts a set of one-to-many (1:M) relationships between a parent and its children segments.

Each parent can have many children, but each child has only one parent.

Page 7: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model: Depends on every entity being subject to a higher one. A simple example is genealogy (each parent can be

identified from the child and vice versa). Another example of a representation of hierarchy of

data is a customer invoice system

Page 8: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model:

Page 9: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model:

Page 10: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model: Hierarchical views can differ between user group

Page 11: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Hierarchical Model- DRAWBACKS:

Data is stored in hierarchies physically. Difficult to change structure once a particular hierarchy

has been designed / formulated, making it less flexible to meet dynamic needs. (e.g. in the customer invoice example: it's not possible to allow a

single payment to be made for several invoices) Unplanned (ad-hoc) queries are difficult to support;- it

may require major restructuring of the hierarchy

Page 12: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Network Model: Network Model was created to represent complex

data relationships more effectively than Hierarchical Model, to improve database performance, and to impose a database standard.

User perceives the network database as a collection of records in 1:M relationships.

Unlike the Hierarchical Model, Network Model allows a record to have more than one parent.

Page 13: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Network Model: The Network Model represents a more complex

structure, allowing non-hierarchical structures Within a model any record may have many immediate

parents as well as many dependents, reflecting more real-world scenarios.

Page 14: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Network Model: A network of data:- customer invoice/payment

example;

Page 15: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Network Model:

Page 16: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Network Model:

Page 17: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Network Model- DRAWBACKS:

Data is stored in linked sets physically. Pointer technology is used to implement relationships

(with overhead, performance issues). Unplanned queries still difficult to support Programmer must be aware of 'sets' (relationships

between record types) and the structural changes. Users have to 'navigate' through database (not a most

user-friendly way to interact with the database).

Page 18: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Relational Model: Relational Model was introduced in 1970 by E. F. Codd

(of IBM) in his landmark paper “A Relational Model of Data for Large Shared Databanks”

Data model that represents data in form of tables or relation.

Page 19: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Relational Model: Relational database model consists of following

three components:1. Data structure: Data are organized in form of tables or relations.

2. Data manipulation: Powerful operations such as SQL languages or

Query-by-example, are used to manipulate data stored in

database.

3. Data integrity: Business rules are specified to maintain integrity of

data when they are manipulated.

Page 20: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Relational Model: Physical Properties

A relation consists of 1 or more columns and 0 or more rows. A row is called a tuple. Each relation is given a unique name. Each column has a name unique within the relation. Each row contains an instance of the data associated with the

relation. A relation with no rows is empty (contains no data), but still exists.

Page 21: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Relational Model: Logical Properties

Columns are unordered, left to right. This property is designed to

preserve the independence of each column. Rows are unordered, top to bottom. This is designed to preserve

the independence of each row. No row may be duplicated in a given relation. Uniqueness in a

relation is guaranteed by the designation of a Primary Key for each

relation.

Page 22: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Relational Model: A Candidate Key is an attribute that uniquely identifies a row in

that relation. A Primary Key is a candidate key that has been selected to be

unique identifier for each row. Primary key values cannot be null, since they would then not

identify a row. Columns can be interchanged without changing the meaning or

use of relation. It makes no difference as whether to insert a new row in front or

at end of table.

Page 23: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Relational Model:

Page 24: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Database Model: ANSI – The American National Standards Institute SPARC – Standards Planning and Requirements

Committee The ANSI/SPARC model is used as a general framework

(benchmark) on which various architectural issues of databases can be discussed on a level-playing field.

However, this is not the only model, and not every database system matches its 'structure'.

Page 25: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

3 Level Architecture :The objective of the 3-Level Architecture is to separate the users’ view,

It allows independent customized user views: Each user should be able to

access the same data, but have a different customized view of the data. These

should be independent: changes to one view should not affect others. It hides the physical storage details from users: Users should not have to deal

with physical database storage details. The database administrator should be able to change the database storage

structures without affecting the users’ views. The internal structure of the database should be unaffected by changes to the

physical aspects of the storage: For example, a changeover to a new disk.

Page 26: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 3 Levels: Consisting of 3 levels, with 3 schemas: External Level (User View):

A collection of individual users' views of the database (database is

seen by users) - External Schema A user's view of the database describes a part of the database that

is relevant to a particular user. It excludes irrelevant data as well as

data which the user is not authorized to access.

Page 27: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 3 Levels: Conceptual Level:

'global' definition/description of database in its entirety ('union‘ of

all users views) at the logical level. It deals with information

structure/content - Conceptual Schema The conceptual level is a way of describing what data is stored

within the whole database and how the data is inter-related. The

conceptual level does not specify how the data is physically stored.

Page 28: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 3 Levels: Conceptual Level (continued): Some important facts about this level are:

DBA works at this level. Describes the structure of all users. Only DBA can define this level. Independent of hardware and software.

Page 29: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 3 Levels: Internal Level:

The internal level involves how the database is physically

represented on the computer system. It describes how the data is actually stored in the database and on

the computer hardware. It deals with information format/physical storage - Internal

Schema

Page 30: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 3 Levels:

Page 31: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 2 Mappings:

Mapping is a process of transforming requests and results between the levels in the ANSI/SPARC model. Programs refer to an external schema, and are mapped by the DBMS to the

internal schema for execution. Data extracted from the internal DBMS level is reformatted to match the

user’s external view.

There are 2 mappings: external/conceptual mapping conceptual/internal mapping

Page 32: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 2 Mappings:

External-Conceptual Mapping: An External-Conceptual Mapping defines the correspondence

between a particular external view and the conceptual view. It tells the DBMS which objects on the conceptual level correspond

to the objects requested on a particular user's external view. If changes are made to either an external view or conceptual view,

then mapping must be changed accordingly.

Page 33: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 2 Mappings:

Conceptual-Internal Mapping: The Conceptual-Internal Mapping defines the correspondence between the

conceptual view and the internal view, i.e. database stored on the physical

storage device. It describes how conceptual records are stored and retrieved to and from the

storage device. This means that conceptual-internal mapping tells the DBMS that how the

conceptual! records are physically represented. If the structure of the stored database is changed, then the mapping must be

changed accordingly.

Page 34: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

ANSI/ SPARC Model – 2 Mappings:

External/ Conceptual

Mapping

Conceptual/ Internal Mapping

Page 35: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Data Independence: The ability to allow users to take a logical view of the

database which is independent of the way that the data is actually stored.

The ANSI/SPARC model based on the 3 schema architecture can be used to explain the concept of Data Independence (DI). Mappings are essential to DI.

Data Independence can be defined as the capacity to change the schema at one level of a database system without having to change schema at next higher level.

Page 36: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Data Independence: This allows users to take a logical view of the

database which is independent of the way that the data is actually stored.

There are two types of Data Independence Logical Data Independence:Logical data is data about database, that is, it stores information about how data is managed inside. For example, a table (relation) stored in the database and all constraints, which are applied on that relation.Logical data independence is a kind of mechanism, which separates itself from actual data stored on the disk. If we do some changes on table format it should not change the data residing on disk.

Page 37: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Data Independence (continued): Physical Data Independence:All schemas are logical and actual data is stored in bit format on the disk. Physical data independence is the power to change the physical data without impacting the schema or logical data.For example, in case we want to change or upgrade the storage system itself, that is, using SSD (Solid-State-Disk/ Drive) instead of Hard-disks should not have any impact on logical data or schemas.

Page 38: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Data Independence:

Different applications will need different views of same data

e.g. CUSTOMER BALANCE

Page 39: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Frontend/ Backend System:

Page 40: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Two Tier System Architecture:

Page 41: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Three Tier System Architecture:

(Java Database Connectivity)

Page 42: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

High Performance, lightweight bound objects ‘thin’ client (compared to the 2-tier architecture), with

less expensive hardware reduction in client-side administration centralised application maintenance enhanced modularity and tier independence;- easier

to modify/replace one tier without affecting others

Three Tier Approach - ADVANTAGES:

Page 43: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

High degree of flexibility in deployment platform and configuration

Improve Data Integrity Improved Security – Client is not direct access to

database Improved load balancing of business logic, by separating

core business logic from database functions. An added advantage is that the 3-tier architecture maps

quite naturally to the Web-enable database environment.

Three Tier Approach - ADVANTAGES:

Page 44: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Web Enabled Database Architecture:

Page 45: Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE ARCHITECTURE” Academic Year 2014 Spring.

Thank you!!!

Questions are WELCOME

Academic Year 2014 Spring