Last Updated on May 17, 2023 by Prepbytes
In this article, we will define data independence in relation to database management systems. We will do our best to cover every aspect of data independence in DBMS. Let’s begin by defining data independence in DBMS and then delving into the explanations and examples.
What is Data Independence in DBMS?
Data independence refers to the capability of changing a DBMS’s schema definition at one level without changing it at the next higher level.
Let’s use an illustration to clarify data independence.
Why do We Need Data Independence in DBMS?
A database system often stores a lot of data in addition to the information input by users. Data can be found and retrieved more easily since the system stores metadata about the data. It is difficult to change or update metadata once it has been recorded in a database. A database management system (DBMS) must, however, change as it expands in order to accommodate its customers’ demands. If all of the data were dependent, updating the schema or data would be a time-consuming and difficult operation.
It is set up in a tiered structure to handle the issue of updating metadata and ensure that altering data at one level has no impact on changing data at another. Although each piece of information is independent, they are all connected.
Data independence, therefore,therefore helps to keep data separate from the programs that use it.
Levels of Database
A review of Database Levels is necessary before learning about Data Independence. The graphic below illustrates the three tiers of the database.
- Physical/Internal
- Conceptual
- External
Think about a sample university database. This is how the implementation will seem at the various levels:
Type of Schema | Implementation |
---|---|
External Schema | View 1: Course info(cid:int,cname:string) View 2: studeninfo(id:int. name:string) |
Conceptual Schema | Students(id: int, name: string, login: string, age: integer) Courses(id: int, cname:string, credits:integer) Enrolled(id: int, grade:string) |
Physical Schema | Relations stored as unordered files. Index on the first column of Students. |
Types of Data Independence in DBMS
There are two different forms of data independence in DBMS.
- Physical data independence
- Logical data independence.
Physical Data Independence
You can better distinguish between conceptual levels and internal/physical levels when there is physical data independence. It enables you to describe the database logically rather than having to detail its physical architecture. Physical data independence is simple to obtain in comparison to logical data independence.
Physical independence makes it simple to modify the actual hardware, which has an impact on the conceptual framework. Any modifications made would be incorporated into the conceptual and internal level mapping. The internal level of the database and subsequent transition from the conceptual level of the database to the internal level enable physical data independence.
Examples of changes under Physical Data Independence
Any of the adjustments below won’t have an impact on the conceptual layer because of their physical independence.
- Using a new storage device like Hard Drive or Magnetic Tapes
- Modifying the file organization technique in the database.
- Switching to different data structures.
- Changing the access method.
- Modifying indexes.
- Changes to compression techniques or hashing algorithms.
- Change of Location of Database from say C drive to D Drive
Logical Data Independence
To modify the conceptual framework without changing the logical data is to have logical data independence.
- External views
- External API or programs
Any modifications will be incorporated into the mapping between the conceptual and external levels. Logical data independence is more difficult to acquire than physical data independence.
Examples of changes under Logical Data Independence
Because of their logical independence, none of the changes below will have an impact on the external layer.
- Without rewriting current application scripts, it is feasible to add, modify, or remove a new attribute, entity, or relationship.
- two recordings are combined to form one.
- dividing a record already held into two or more records
Difference between Physical and Logical Data Independence
Logical Data Independence | Physical Data Independence |
---|---|
The major focus of logical data independence is on altering the definition or structure of the data. | mostly interested in data storage. |
It is challenging since data retrieval mostly depends on the logical organisation of the data. | It is easy to retrieve. |
Logical data independence is more challenging to accomplish than logical physical independence. | Physical data independence is simple to acquire compared to logical data independence. |
If new fields are added to the database or existing ones are removed, you must make modifications in the application software. | Typically, there is no requirement for change at the application program level when the physical level changes. |
Anytime the logical structures of the database are modified, there must be considerable modification at the logical levels. | It may or may not be necessary to make adjustments at the internal levels to enhance the structure’s performance. |
Concerned with conceptual schema | Concerned with internal schema |
Example: Add/Modify/Delete a new attribute | Example: change in compression techniques, hashing algorithms, storage devices, etc |
Importance of Data Independence
- Helps you to increase the data’s quality
- Database system upkeep costs decrease
- Standards enforcement and enhanced database security
- Application software data structures don’t need to be changed.
- Allowing developers to concentrate on the Database’s overall structure rather than worrying about the inside implementation
- It enables you to enhance a damaged or undivided state.
- Database inconsistency is greatly decreased.
- In order to enhance the system’s performance, simple physical changes must be made.
Conclusion
A DBMS must have the data independence property in order to change the database schema at one level of a database system without having to update the schema at the next higher level. The two stages are physical and logical data independence. Physical data independence makes it easier to separate conceptual levels from internal/physical levels. Having logical data independence means that you can change the conceptual framework without changing the logical data. Physical data independence is easier to achieve than logical data independence. Data Independent assists you in improving the quality of your data.
Frequently Asked Questions (FAQs)
Q1. Why is database data independence required?
Ans. It is in charge of separating the internal level of a database structure from the conceptual level. Physical data independence allows for the provision of a logical description or overview of the database, without the need to specify the details of the database’s logical structure.
Q2. What is data integrity in relation to DBMS?
Ans. The overall accuracy, completeness, and consistency of data is referred to as data integrity. Data integrity also refers to the security and safety of data in terms of regulatory compliance, such as GDPR compliance. It is upheld by a set of processes, rules, and standards that were put in place during the design phase.
Q3. What is data independence and what are its different types?
Ans. The ability to modify one level of a DBMS without affecting the data structure or access methods of the next higher level is referred to as data independence. There are two kinds of it: physical and logical.
Q4. What are the characteristics of data independence?
Ans. Data independence refers to the ability to change the schema at one level of a database system without affecting the schema at the next higher level.