Data immutability is the idea that information within a database cannot be deleted or changed. In immutable—or append-only—databases, data can only ever be added. Meaning the database will not overwrite or change an item when new information is made available. Even if a mistake is made, it is corrected with a subsequent entry and not overwritten.
To change or delete an entry in an immutable database, a new entry must be created and the old entry must be marked as belonging to a previous version of the database. That way, all history of how a database became the present state is preserved. This makes auditing data changes possible because the audit log is tamper-resistant. (The opposite of an immutable database is a mutable database, wherein the information stored in the database can be overwritten, changed, or deleted.)
How Does Data Immutability Work?
One way to think about data immutability in the “real world” is through medical records. Medical records keep track of all the different procedures, tests, appointments, prescriptions, and so on in a person’s medical history. As a person seeks medical care for different conditions and illnesses, their medical records are updated. When a person gets a new prescription, their old prescriptions are not overwritten or removed from their medical records. Rather, their medical records are updated to reflect both the new prescription and the old ones. In this way, medical records are immutable.
For businesses using a general ledger and double-entry accounting, data immutability is also a particularly significant concept. Every business needs a ledger for bookkeeping. A ledger provides a record of each debit and credit transaction across the lifespan of a company and the total of all of the different debit and credit entries must balance out. Companies that move money at scale will generally use what’s known as a ledger database to record financial transactions and store other significant business data.
Within a double-entry system, accountants can generally look back at transactions within their ledger and reverse-engineer any discrepancies that have happened. However, if the data is not immutable and has been changed, it becomes impossible to figure out what has gone wrong in the case of an inconsistency within the ledger. That’s why it is particularly important for businesses to ensure that the data within their double-entry ledger is immutable.