What is logical data independence?

Overview

Data independence is a property of a database management system (DBMS) that allows us to change the schema at one level of DBMS without affecting the schema at the next higher level. This allows us to keep the data and programs separate.

We can use the three-schema architecture to implement data independence properties, as shown below:

The three-schema architecture

There are two types of data independence:

The three-schema architecture

Schema is defined at three different levels in this architecture:

External schema

It is the part of the database that the user is specifically interested in. Different views are made at this level for the user. For instance, a user can view course details and section details simultaneously without worrying about the exact process running at the back end.

Conceptual schema

The database structure is defined at this level for a community of users. The structure explains this level's data types, entities, and relationships. However, the user keeps intricate details hidden, such as the physical storage structure.

Internal schema

This stage defines how the data is physically stored on the storage devices, such as a hard disk. Complete details of physical storage and access paths are provided.

Logical data independence

  • It separates the external view from the logical schema.
  • It allows us to change the middle level of DBMS, the logical schema level, without changing the external views, programs, or API.
  • It's complex and challenging to achieve because data retrieval depends upon the logical structure of data.
  • It occurs at the user interface level; end-user view data is not affected by any changes in the logical view of the data.

Examples

Logical data independence is primarily concerned with the structure or changing the data definition and the logical schema. Any changes that can be made at this level to the database are listed as follows:

  • Add an attribute, entity, or relationship
  • Delete an attribute, entity, or relationship
  • Modify an attribute, entity, or relationship

We can perform the functions above without modifying any existing application program.

How to achieve logical data independence

DBMS uses a modified external to logical layer mapping to preserve the property of logical data independence. The mapping is automatically performed by DBMS itself. It absorbs the changes made to the logical layer.

Note: Changes must be made to the application program if new fields are added or deleted from the database.

Copyright ©2024 Educative, Inc. All rights reserved