Data integrity

Data integrity is the maintenance and assurance of the accuracy, completeness, and consistency of data over its entire lifecycle. It is the property that data remains correct and unaltered, whether at rest in storage, in transit across a network, or being processed by an application.

The concept has two complementary dimensions. Physical integrity guards against corruption of the bits themselves, from hardware faults, bit rot on disk, and noise or loss during transmission. Logical integrity guards against errors in what the data means, such as values that violate business rules, broken relationships between records, or partial updates that leave a database in an invalid state. Most systems need both.

The techniques that deliver data integrity fall roughly along these two lines. Logical integrity is enforced through transactions and the ACID properties, which keep concurrent operations from corrupting one another and roll back partial failures. Schema constraints encode the application’s invariants so that invalid data is rejected at write time. The most prominent are referential integrity, enforced through foreign keys, together with type checking and normalization.

Physical integrity is enforced through checksums and hash functions, which detect when stored or transmitted data has been altered. A checksum computed at write time and rechecked at read time turns silent corruption into a detectable error. Cryptographic hashes add tamper resistance, since a plain checksum can be forged by an attacker who knows the algorithm. Beyond detection, replication and the durability property of a storage system protect integrity against the total loss of a data copy, so that a single failed node does not destroy the only correct version.

A common pitfall is confusing data integrity with replica consistency. Consistency is about whether copies agree with one another right now. Integrity is about whether any given copy is itself correct and complete. A system can be strongly consistent yet hold corrupt data, or eventually consistent yet preserve integrity within each replica. The two concerns reinforce each other but are not the same.

In information security, integrity is the "I" in the CIA triad, alongside confidentiality and availability, and is treated as a goal of security more broadly. There it carries a narrower sense: protecting data from unauthorized modification. The broader data-integrity concerns above subsume that sense while also covering accidental corruption and logical validity.

See also