Source of Truth, Replica, Cache, Backup, Archive Defined
In this article
The phrase "source of truth, replica, cache, backup, archive" is not a single technical term, but rather a sequence of distinct data management concepts used in system architecture to ensure data integrity, availability, and durability. Each term describes a specific role a dataset plays within a larger ecosystem. A source of truth is the authoritative master record; a replica is a synchronized copy for availability; a cache is a temporary high-speed copy for performance; a backup is a point-in-time copy for disaster recovery; and an archive is a long-term storage record for historical or legal compliance. These terms are standard technical vocabulary in software engineering, database administration, and IT infrastructure.
The Source of Truth: The Authoritative Record
In any complex system, the Source of Truth (SoT)—often called the Single Source of Truth (SSoT)—is the one location where a piece of data is considered definitive. If two different systems provide conflicting information about a user's email address, the system designated as the source of truth is the one that is believed to be correct. This prevents data fragmentation and ensures that updates are propagated consistently across an organization.
The primary characteristic of a source of truth is that it is the only place where the data is officially "written" or modified. Other systems may read from it, but they do not change the data independently. For example, in a corporate environment, the Human Resources Information System (HRIS) is typically the source of truth for employee names and titles. When a person is promoted, the change is made in the HRIS, and that change then flows to the email directory, the payroll system, and the security badge system.
Maintaining a strict source of truth requires rigorous governance. Common problems occur when "shadow systems" emerge—spreadsheets or side-databases where employees track information because the official source of truth is too slow or difficult to access. This leads to data drift, where the official record becomes obsolete while the unofficial record becomes the de facto truth.
Replicas: Ensuring High Availability
A replica is a copy of the source of truth that is kept up-to-date in near real-time. Unlike a backup, which is a snapshot of the past, a replica is intended to be a live mirror. The primary purpose of replication is to improve system availability and read performance. By distributing replicas across different geographical regions, a company can ensure that if the primary server in New York fails, a replica in London can take over immediately with minimal data loss.
Replication typically follows one of two patterns:
- Synchronous Replication: The primary source of truth waits for the replica to confirm it has received the data before confirming the write to the user. This ensures zero data loss but can slow down the system.
- Asynchronous Replication: The primary source of truth writes the data and immediately confirms it to the user, sending the update to the replica a few milliseconds or seconds later. This is faster but carries a risk of small data loss if the primary fails before the replica is updated.
A common misconception is that a replica can replace a backup. This is dangerous because replicas mirror every action, including mistakes. If a user accidentally deletes a critical database table in the source of truth, that deletion is replicated to all mirrors almost instantly. The replica helps with hardware failure, but it does not protect against human error or data corruption.
Caches: Optimizing Access Speed
A cache is a temporary storage layer that holds a subset of data from the source of truth to reduce latency. While replicas mirror the entire dataset, caches only store the most frequently accessed or "hot" data. Caches typically reside in high-speed memory (RAM) rather than on a hard disk, allowing the system to retrieve information in microseconds rather than milliseconds.
The lifecycle of cached data is governed by a Time-to-Live (TTL) setting. Because the cache is not the source of truth, it can become "stale"—meaning the data in the cache is older than the data in the master record. To manage this, engineers use various invalidation strategies:
- Write-through: Data is written to the cache and the source of truth simultaneously.
- Write-around: Data is written directly to the source of truth, bypassing the cache to avoid filling it with data that might not be read again soon.
- Write-back: Data is written to the cache first, and the source of truth is updated after a delay. This is the fastest method but the riskiest, as a crash could lose data not yet written to the master record.
An example of this in daily use is a web browser. Your browser caches images and CSS files from a website so that when you click "back," the page loads instantly without needing to request the same files from the server again.
Backups: The Safety Net for Recovery
A backup is a point-in-time copy of data used specifically for recovery after a catastrophic event. Unlike a replica, which is live, a backup is a static snapshot. If a database is corrupted by a virus or a developer runs a destructive script, the backup allows the organization to "roll back" the system to a known healthy state from an hour, a day, or a week ago.
Effective backup strategies usually follow the 3-2-1 rule:
- Keep at least three copies of the data (the original and two backups).
- Store the copies on two different types of media (e.g., a local disk and a cloud bucket).
- Keep one copy off-site or in a physically separate location to protect against fires or floods.
The most critical part of a backup strategy is not the backup itself, but the restore test. Many organizations discover too late that their backups were failing or that the data is corrupted because they never attempted to actually restore the data to a working server. A backup is only as good as its last successful restoration.
Archives: Long-Term Preservation
An archive is the final stage of the data lifecycle. While backups are for recovery, archives are for retention. Archiving involves moving data that is no longer actively used—but must be kept for legal, regulatory, or historical reasons—out of the primary production environment and into low-cost, long-term storage.
The key difference between a backup and an archive is the intent. You backup a database so you can recover from a crash today; you archive a database from 2015 because the law requires you to keep financial records for ten years. Archives are often stored on "cold storage" media, such as magnetic tape or specialized cloud tiers (like Amazon S3 Glacier), where retrieval times can take minutes or hours because the data is not kept in an active state.
Archiving helps maintain system performance. By moving millions of old records out of the source of truth and into an archive, the primary database remains lean, searches run faster, and the cost of high-performance storage is reduced.
Comparing Data Roles: A Summary
To visualize how these interact, imagine a library. The Source of Truth is the original master manuscript of a book. The Replica is an exact photocopy kept in a secondary branch library so people in another town can read it. The Cache is the book currently sitting on the librarian's desk because it is the most popular book of the week. The Backup is a microfilm copy stored in a vault to be used if the library burns down. The Archive is the collection of books from the 1800s moved to a climate-controlled basement because they are rarely read but too valuable to throw away.
Choosing which to implement depends on the specific risk you are mitigating:
- Latency issues? Implement a Cache.
- Server downtime/Regional failure? Implement a Replica.
- Accidental deletion/Ransomware? Implement a Backup.
- Storage costs/Legal compliance? Implement an Archive.
- Data inconsistency/Confusion? Establish a Source of Truth.
Frequently Asked Questions
Is a replica the same as a backup?
No. A replica is a live copy that updates in real-time; if you delete data in the source, it is deleted in the replica. A backup is a static snapshot from a specific time; if you delete data in the source, you can still retrieve it from the backup.
Can a cache become the source of truth?
Technically, a system can be designed this way, but it is considered a dangerous architectural flaw. Caches are volatile (stored in RAM) and can be cleared at any time. If the cache is the only place the data exists, a power outage or system reboot results in permanent data loss.
How often should I perform backups versus archiving?
Backups should happen frequently (hourly or daily) to minimize data loss (Recovery Point Objective). Archiving happens infrequently, usually on a schedule based on the age of the data (e.g., moving records to the archive once they are older than two years).
What happens if the source of truth is corrupted?
If the source of truth is corrupted, the corruption will likely spread to the replicas. In this scenario, the system administrator must disable the replicas and restore the data from the most recent healthy backup to establish a new, clean source of truth.
Why not just use one giant database for everything?
Using one database for active data, backups, and archives leads to massive performance degradation. Searching through billions of archived records slows down the queries for active users, and the cost of storing cold data on high-performance SSDs is prohibitively expensive.