Difference Between Corruption and Inconsistancy

  • Hello All,

    I'm just wondering about the semantics here, so that I get this clear in my mind.

    What is the difference (if any) between a corrupt database and a database that is inconsistent.

    Are people using these words interchangeably or should we be more careful how we use them?

    Many thanks,

    Dave.

    Dave Morris :alien:

    "Measure twice, saw once"

  • Corruption is when something is actually wrong with the database. For example a page is corrupt and cannot be read anymore from disk.

    Inconsisteny is a problem within the data itself and the way it has been modelled. But the database itself can still be perfectly fine.

    For example, two tables store customer information. Dave has been stored twice with the same email address. One table is updated and the email address gets a new value. The database is now inconsistent, because Dave now has two possible email addresses, but which one is correct? The risk for inconsistency can be minimized by correctly normalizing the model. Another important factor for inconsistency are transactions. If a transactions fails halfway through and doesn't roll back, it can leave the database in an inconsistent state. That's why transactions need to adhere to the ACID model, where the C stands for consistency.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Hi Koen,

    Thanks very much for the reply. Your clear explanation has helped me understand this.

    Your point that data modeling is one cause of inconsistency within the data as well as transactions is very helpful. I can see how the ACID concept fits into this whole idea too.

    Thanks again,

    Dave.

    Dave Morris :alien:

    "Measure twice, saw once"

  • Of course, database corruption can lead to inconsistency.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Point noted 🙂

    Thanks again.

    Dave Morris :alien:

    "Measure twice, saw once"

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply