BIT202 ยท 2080 ยท 5 marks
What is data independence? How three schema architecture ensures logical and physical data independence?
What is data independence? How three schema architecture ensures logical and physical data independence? [5]
Quick answer
Data independence is the ability to modify the schema definition at one level of the database system without affecting the schema definition at the next higher level.
Data Independence and Three Schema Architecture
What is Data Independence?
In simple terms, it means changes made to the structure or storage of data do not require changes to the application programs that use the data.
There are two types of data independence:
| Type | Description |
|---|---|
| Logical Data Independence | Ability to change the conceptual schema without changing external schemas or application programs |
| Physical Data Independence | Ability to change the internal/physical schema without changing the conceptual schema |
Three Schema Architecture
The ANSI/SPARC Three Schema Architecture divides the database into three levels:
+-----------------------------+
| External Level (View) | <-- User views / subschemas
+-----------------------------+
| Conceptual Level | <-- Logical structure of entire DB
+-----------------------------+
| Internal Level | <-- Physical storage details
+-----------------------------+
-
External Schema (View Level): Describes how individual users or groups see the data. Different users can have different views.
-
Conceptual Schema: Describes the overall logical structure of the entire database -- what data is stored, relationships, constraints, etc.
-
Internal Schema: Describes the physical storage structure -- file organization, indexes, access paths, etc.
How Three Schema Architecture Ensures Data Independence
1. Physical Data Independence
- Achieved through the mapping between Internal and Conceptual levels.
- If the physical storage is changed (e.g., changing file organization, adding indexes, moving data to new storage), only the internal schema and its mapping to the conceptual schema need to be updated.
- The conceptual schema remains unchanged, so application programs and user views are not affected.
- Example: Changing a sequential file to a B-tree index does not affect the logical description of the data.
2. Logical Data Independence
- Achieved through the mapping between Conceptual and External levels.
- If the conceptual schema is changed (e.g., adding a new attribute, splitting a table), only the mapping between conceptual and external schemas needs to be updated.
- The external schemas (user views) remain unchanged, so application programs are not affected.
- Example: Adding a new column to a table does not affect existing user views that do not use that column.
Summary
Change in Internal Schema
|
v
Update Internal-Conceptual Mapping --> Physical Data Independence
|
v
Conceptual Schema unchanged
|
v
Update Conceptual-External Mapping --> Logical Data Independence
|
v
External Schema (Applications) unchanged
The three schema architecture acts as a buffer between levels, ensuring that changes at one level are isolated from other levels, thus providing both physical and logical data independence.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.