Database Definitions Architecture
Data
Information encoded in some form.
Database
A logically coherent collection of data with inherent meaning.
- Collection of related data stored on some physical medium.
- Should be grouped.
Advantages
- Better control over redundancy.
- Better consistency of data: enforcing integrity.
- Allow independence between data and the mechanism for their usage.
- Enforce a logical conceptualisation of data, leading to a more.
- Users can have a personalised view of data.
- Data sharing is easier, standards may be enforced
- More efficient storage and search.
- Security can be implemented more easily, e.g. restricting unauthorised access
- Allow inferences and actions (using “rules”).
When not to use a Database
- Simple, well-defined database applications not expected to change at all.
- Stringent, real-time requirements that may not be met because of programming overhead.
- Embedded systems with limited storage.
Database Management Systems (DBMS)
A DBMS is a collection of programs that enables to create and maintain a database.
Special purpose DBMS:
- Bespoke set of programs to create and maintain the database needed by one particular application.
General purpose DBMS:
- Software systems that facilitate the management of databases for various applications.
DBMS Tasks
Define a database:
- Formally describe the types of data to be stored
Construct the database:
- Create the physical structure of the database
- Store actual data on the storage medium, controlled by the DBMS (populating the database)
Manipulate the database and provide functions for:
- Querying
- Updating
- Generating reports
Data Model
A Data Model is a type of data abstraction used to provide a conceptual representation of the data.
- It provides a logical and structured organisation of the data: data is easier to manage, define and manipulate.
- It allows a separation of physical and logical organisation of data.
High Level/Conceptual
Represent “notions”:
- “Classical” models: hierarchical, network and relational
- More recently: object-oriented and functional data models
Low Level/Physical
Represent the way data are physically stored:
- In traditional file processing these are hard-coded, so any changes in the structure of a file may require changing the programs that access the file.
- A mechanism to describe the high level data model separately means that program and data become independent.
Components
Rules
Describe the structure and the meaning of data:
- For high level data models: definitions of data types, relationships, constraints.
- For low level data models: definitions of file and record formats.
Operations
Describe what may be performed on the data:
- For high level data models: definitions of types of retrievals and updates.
- For low level data models: record orderings and access paths (structures that perform the physical search on DB storage).
Architecture
These characteristics can be summarised into an architecture, that is an abstract design describing how a generic database system should look like.
ANSI/SPARC Architecture
The ANSI/SPARC architecture is divided into three levels. At each level, the database is described differently:
- The description of a database is called the database schema.
- Each schema is specified in a particular data model.
- The actual data in the database at a particular moment in time is called a database instance (or state, or snapshot).
Internal Level
Describes the physical storage of the database.
We don’t need to know this one.
- SCHEMA USED: internal schema describing details of data storage and their access paths.
- DATA MODEL: physical.
Conceptual Level
Describes the structure of the whole database for its community of users:
- SCHEMA USED: conceptual schema, describing all stored data and how it is related (global view).
- DATA MODEL: high level.
External Level
Describes the database as seen by each group of its users:
- SCHEMA USED: a number of external schemas, one for each user to represent, hiding what that user is not interested in or has no access to.
- DATA MODEL: high level.
View
A view is a user’s perspective. Like designing a database from the view of the person who is going to use it.
- The idea is to re-define the database from different perspectives.
- A perspective or view, of the database, could.
- Contain subsets of the database.
- Contain virtual data, derived from the database files,
but not explicitly stored.
- Derived attributes, but also derived relationships!
3-Schema Architecture
Data Independence
Capacity to change the schema at one level of a database system without having to change the schema at the next higher level.
The ANSI/SPARC 3 level schema supports two types of data independence:
Logical Data Independence
The capacity to change the conceptual schema without having to change external schema (and the applications using it).
- Adding extra personal details to the lecturers is still of no interest to the students, so the students’ view can remain unchanged.
Physical Data Independence
The capacity to change the internal schema without having to change conceptual (or external) schema.
- Changing the way the physical files are stored, (to improve efficiency, to distribute them in several locations, etc.)
- Does not change the way in which users “see” the database, so the conceptual level can remain unchanged.