DBMS Menu


Problems caused by redundancy in DBMS




Data redundancy in databases refers to the unnecessary duplication of data. It can arise from poor database design or lack of proper normalization. Redundancy can cause several issues:

Problems Caused by Redundancy

1. Wasted Storage

Storing duplicate data consumes more storage than necessary.

2. Data Anomalies

These are inconsistencies that arise due to redundancy.

  • Update Anomalies: When you have the same piece of data stored in multiple places, updating it in one place can lead to inconsistency if it's not updated everywhere.
  • Insertion Anomalies: You might have to insert redundant data in multiple places, leading to inconsistencies.
  • Deletion Anomalies: Deleting data in one table might unintentionally remove necessary data that's needed elsewhere.

3. Increased Complexity

Querying and maintaining redundant data can be more complex.

4. Performance Issues

Duplicate data can slow down search, update, and insert operations.

5. Data Integrity Issues

If data is inconsistent across tables, it can lead to data integrity issues.

Example for Problems Caused by Redundancy:

Let's consider a simplistic example. Suppose you have a table called "Orders" with the following structure and data:


| OrderID | CustomerName | Product   | CustomerAddress   |
|---------|--------------|-----------|-------------------|
| 1       | Madhu        | Laptop    | Hyderabad         |
| 2       | Madhu        | Mouse     | Hyderabad         |
| 3       | Naveen       | Keyboard  | Bengaluru         |

From the table:

Redundancy: The `CustomerName` "Madhu" and his `CustomerAddress` "Hyderabad" are repeated for two orders.

Problems:

  1. Update Anomaly: If Madhu moves to a new address, you'd have to update multiple rows. If you forget to update all the rows, it leads to inconsistent data.
  2. Insertion Anomaly: To insert a new order for Madhu, you have to re-enter his address, leading to further redundancy.
  3. Deletion Anomaly: If you decide to delete the order with the mouse, you might be tempted to delete Madhu's details entirely, but that would remove crucial data associated with the laptop order.

Solution:

Normalizing the database can resolve these problems. In this example, splitting the table into two tables, `Orders` and `Customers`, would be a start:

1. Customers Table:

| CustomerID | CustomerName | CustomerAddress   |
|------------|--------------|-------------------|
| 101        | Madhu        | Hyderabad         |
| 102        | Naveen       | Bengaluru         |
2. Orders Table:

| OrderID | CustomerID | Product  |
|---------|------------|----------|
| 1       | 101        | Laptop   |
| 2       | 101        | Mouse    |
| 3       | 102        | Keyboard |

This design reduces redundancy and eliminates the anomalies.


Next Topic :Decompositions and its problems in DBMS