Database Design concepts INFO 1408 Lecture 3 What is a database?
-
date post
21-Dec-2015 -
Category
Documents
-
view
220 -
download
0
Transcript of Database Design concepts INFO 1408 Lecture 3 What is a database?
Objectives
Introduce the three layers of data abstractionIntroduce the terms physical and Logical data independence
Towards a definition ………
Take a moment or two to think about how you would define a database. Write down the key words you would use.Describe a database to your neighbour
A typical domestic ‘database’
Is this Organised? Efficient? Easily accessible? Flexible? …… good for much other than keeping things off the floor?
Paper based databases
•Have been around for a long time
•Data is organised and quickly accessibleSo is easier to maintain – fewer errors
•But is not all that flexible – things are filed in one place only (why would it not be a good idea to have duplicates)
Are managed by a
We will explore some features of a DBMS ……..Layers of data abstractionPhysical data independenceLogical data independence
Computer based Databases
Some important features of a DBMS
Moves data to and from physical data filesManages multiple usersManages transactions as an ‘all or nothing’ unit of workSupports a Query Language to retrieve data from the databaseManages back upsProvides Security mechanisms
Layers of Data abstraction
Allows us to consider User views of the data – which can be different for each user. More about this later in the term
This is achieved by thinking of 3 Layers of abstraction
Externallayer
Logicallayer
Physicallayer
What the user
How the database the data for viewing
How the computer’s operating system
the data
D
atabaseFile
Databas
eFile
Databas
eFile
Databas
eFile
Databas
eFile
Internal Schema
UserView 1
UserView 2
UserView ….External
layer
Logicallayer
Physicallayer
Physical Data independence
Logical Data independence
The Physical layerThe data files that actually contain the data
Data could be stored over multiple disc drives – by running in parallel
(Microsoft is an exception in that everything is stored in one file – this limits the number of concurrent users, this is why it is not used for large enterprises.)
The DBMS works with the computer’s Operating system (OS) to manage the file storage.
The user of the database does not need to know how the DBMS does this. They just ask for the information and the DBMS supplies it. A little like you ordering a meal at a restaurant, it just arrives- you don’t know how it was cooked or what the ingredients are.
D
atabaseFile
Databas
eFile
Databas
eFile
Databas
eFile
Databas
eFile
Internal Schema
UserView 1
UserView 2
UserView ….External
layer
Logicallayer
Physicallayer
Physical Data independence
Logical Data independence
Logical Layer
The logical layer transforms the physical data into a common This structure is the one that the designer would recognise. It covers all the data requirements of all the users. This is what we will be working on when we start to design databases later on.This ‘abstracted’ format is known as a Depending on the DBMS data could be formatted as 2 dimensional tables or a hierarchical structure (similar to an organisation chart)
D
atabaseFile
Databas
eFile
Databas
eFile
Databas
eFile
Databas
eFile
Internal Schema
UserView 1
UserView 2
UserView ….External
layer
Logicallayer
Physicallayer
Physical Data independence
Logical Data independence
External Layer
This is the layer where users with the database and issue queriesThe DBMS handles the transformation of selected items from the data structures in the logical layer to form each user viewThese user views can be stored for future use, or may be used only temporarily and then discarded – an query.
When we start to create a database we need to look at each user requirements- These requirements will give us all of the views requiredUsing some methods ( that we will learn) we can create the Internal schema which will organise the data so all user requirements can be met.
D
atabaseFile
Databas
eFile
Databas
eFile
Databas
eFile
Databas
eFile
Internal Schema
UserView 1
UserView 2
UserView ….External
layer
Logicallayer
Physicallayer
Physical Data independence
Logical Data independence
Physical Data Independence
There can be differing degrees of independencePrior to systems having data independence any change to the way data was stored would require a change to every computer program that used the data – time consuming and expensive
D
atabaseFile
Databas
eFile
Databas
eFile
Databas
eFile
Databas
eFile
Internal Schema
UserView 1
UserView 2
UserView ….External
layer
Logicallayer
Physicallayer
Physical Data independence
Logical Data independence
Logical Data Independence
The ability to make changes to the logical layer without disrupting existing users and processes
Activities such as: Adding a new database object Adding data items to an existing
object
What key words would you now use to describe a database to a colleague?Take a moment to jot down the key words
Does your definition include words such as..
efficient
organised
flexible
consistent
maintainable
data
accessible
Reliable
Error free
Robust
secure