Retention and archiving for retail transaction tables that never stop growing
Retail systems accumulate a particular kind of weight: millions of small transaction records, each trivial, together slowing every query, backup, and upgrade. The instinctive answers are both wrong, keep everything live forever (performance dies by inches) and delete old data (the audit trail and the analysis history die at once). Retention policy is the designed middle: live, archived, and destroyed, each with a period and a reason.
Sort the data by who still needs it
| Consumer | Needs | Typical horizon |
|---|---|---|
| Operations (returns lookup, receipt queries, statements) | Fast access to recent transactions by store/customer/item | Months to ~2 years live |
| Finance and tax audit | Complete, provable transaction and posting history | Your jurisdiction's statutory period (often 6 to 7+ years), archived is fine, destroyed is not |
| Analysis (year-over-year, basket history) | Aggregates and line detail for comparisons | Aggregate indefinitely; line detail as long as comparisons need it |
| Privacy obligations | Personal data (member details, customer-linked records) not kept beyond purpose | Your privacy rules' clock, which can require action before the finance clock expires |
The last row is the one retention projects discover late: keeping everything forever is itself a compliance position, and not always a lawful one. Design the clocks together, finance, privacy, operations, or each will silently veto the others' plans.
Archive means reachable
- Data leaves the live tables into an archive that is still queryable, archived transaction stores, a reporting database, or exported structured files with their keys intact. The test: a three-year-old customer transaction can be produced, with effort proportionate to its age, when a tax query or a dispute needs it.
- Archive in small, regular batches (monthly, in the quiet hours) rather than a heroic annual purge, small batches fail small and can be rehearsed.
- Record what moved, when, and the counts reconciled before and after. An archive run without a reconciliation is a deletion with good branding.
- Aggregates survive independently: the monthly category/store/member summaries that reporting lives on are kept even where line detail is archived or eventually destroyed, so long-run comparisons never depend on resurrecting archives.
Backups are not archives
A backup answers "restore yesterday"; an archive answers "show me the record from three years ago, readable, with its context", different systems, different tests, and a common governance error is assuming the first covers the second. Backups rotate, compress, and depend on the software that wrote them; archives are kept in forms that survive software change, for exactly the retention period the matrix states, and are tested by retrieval, not by existence. When the retention design is built, state explicitly which obligations the archive carries (tax inspection, dispute evidence, regulatory look-back) and design the archive to those retrievals. The backup strategy then returns to its proper job, surviving the bad Tuesday, unburdened by decade-long duties it was never shaped to carry.
Test the archive before you need it
An archive that has never been read is a hypothesis. Schedule the restore test like the backup test it resembles: once a year, retrieve a sample archived period, a store's month of transactions from three years ago, and prove it can be produced, read, and reconciled to the summaries that stayed live. The test routinely finds the real problems: a key structure that changed in an upgrade, an export nobody can open, a field whose meaning drifted. All fixable in a drill; none fixable in the middle of a tax audit with a deadline. Record the drill and its time-to-answer in the retention policy file, when the real request comes, that number is the difference between a commitment you can make and a hope you can express.
A retrieval, rehearsed: the three-year-old invoice
Test the archive the way it will be used. A tax query asks for the invoice detail behind a transaction from three years ago last March, not the summary, the lines, with the tax treatment as recorded at the time. The retrieval should produce it in minutes from the archive, in a form an inspector accepts, with the totals agreeing to that period's filed figures. Run this rehearsal annually per archive class and record the elapsed time and any gap found; an archive that has never been rehearsed is a hypothesis. The gaps rehearsals find are almost always contextual, not volumetric, the data is there, but the code table that explains it was not archived with it, or the document images live in a system whose retention was set differently. Fixing those joins in a rehearsal is an afternoon; fixing them during an inspection is a negotiation.
Success: live tables sized for operations, backups and upgrades that stop growing teeth, an archive that can answer an auditor in a day, and a written policy in which every class of retail data has a period, a place, and a reason.
, Dex Carter, Tech Writer