RadixTrie-image
Architecture

Database Archiving: Getting Data Growth Back Under Control

A database that only grows costs more to store, takes longer to restore and becomes harder to move. How database archiving works on SQL Server, Oracle and PostgreSQL, and what an archive assessment tells you.
Need a hand with this? Talk to a senior database DBA ↓
By RadixTrie26 November 20264 min read
Database archiving moves data that is no longer in daily use out of the production database, and keeps it where it can still be queried. Most business databases only ever grow. Every transaction since go-live is still there, sitting next to today's work. For years that costs nothing anyone notices. Then the storage bill, the backup window and the restore time all become problems at once. This article explains what uncontrolled data growth costs, why deleting old rows is not the answer, and how an archive assessment works.

What data growth really costs

  • Storage, several times over. Every terabyte in production is also in each standby, each backup, each backup copy off site and each test environment that is refreshed from production.
  • Restore time. Restoring a database takes longer as it grows. The recovery time the business was promised when the database was a tenth of the size is no longer true, and often nobody has measured the new number.
  • Backup and maintenance windows. Backups, integrity checks and index maintenance run longer until they no longer fit in the night.
  • Performance. Large tables mean larger indexes, slower scans and plans that worked at one size and fail at another.
  • Blocked change. Upgrades, platform moves and cloud migrations are all harder when the database is very large. The copy takes too long, the cutover window is too short, and the project stalls.
  • Slow test environments. When a refresh from production takes days, teams stop doing it and test on stale data.
If you have not restored your largest database recently, you do not know how long it takes. Size is the main reason a restore that once took hours now takes days.

Retention rules cut both ways

Some data must be kept. Financial, tax and industry rules set minimum periods, and auditors ask for records from years back. Other data must go. Privacy laws such as POPIA and the GDPR say that personal information should not be kept for longer than the purpose it was collected for. A database that keeps everything forever is not the safe option. It fails the second rule while trying to meet the first. Archiving is how you meet both: keep what you must, in a cheaper place, for a defined period, and remove what you have no reason to hold. The retention periods themselves are a decision for your business and its legal advisers. Our part is to make the database able to carry them out.

Why deleting old rows does not work

The obvious fix is a job that deletes anything older than a few years. On a large table this usually goes badly.
  • Big deletes are slow and heavy. They generate large volumes of log, hold locks and compete with production work.
  • The space does not come back by itself. On PostgreSQL, deleted rows leave space that is reused inside the table but is not returned to the operating system without rewriting the table. On SQL Server, shrinking files to reclaim space fragments indexes. On Oracle, segments keep their high-water mark until they are reorganised.
  • Related tables break. Old orders point to customers, payments and documents, so rows cannot be removed table by table without understanding the relationships.
  • Somebody still needs the data. Reports, disputes and audits reach back further than anyone expects.
A design built for archiving avoids these problems. The most common tool is partitioning: the table is divided by date, so that a whole month or year can be detached or moved in one quick operation, without deleting rows one at a time. SQL Server, Oracle and PostgreSQL all support partitioning, with different features and, on some editions, different licensing, which is one of the things an assessment checks.

How an archive assessment works

An archive assessment answers three questions with evidence from your own database: what is taking the space, which of it is still used, and what can safely move. It runs in the following steps.
  1. Measure. Size and growth rate for every large table and index, so you know where the growth comes from. It is usually a small number of tables.
  2. Watch. The database is observed over a period that includes month-end and other peaks, to see which data is actually read and written, and how far back real queries reach.
  3. Map. The relationships between tables, the reports and interfaces that read old data, and the retention rule that applies to each kind of record.
  4. Recommend. Which data stays in production, which moves to an archive, which can be removed, and what each choice saves in storage and restore time.
  5. Design. How the archive is kept queryable, how data moves on a schedule without touching business hours, and how a record is brought back if it is needed.
The result is a written plan with sizes, dates and risks, not a tool recommendation. The archive itself is then built for your environment, because the right design depends on your platform, your application and your rules. It should also be portable, so that it still works after an upgrade or a move to another platform.

What it looks like in practice

Two of our published case studies show the pattern. In one, we reduced a 30TB PostgreSQL database to 13TB. In another, we helped a client decommission PostgreSQL databases that were no longer used. Both started the same way: measure first, then decide.

Database archiving: common questions

Is archived data still available?

Yes. A proper archive is queryable. It is slower and cheaper than production, and access is controlled, but a record from seven years ago can still be found when a dispute or an audit asks for it.

Will the application need to change?

Sometimes a little. If screens or reports read old data directly, they need to know where it now lives. The assessment lists every place this applies before anything moves.

Should we archive before a migration or upgrade?

Usually yes. A smaller database copies faster, cuts over in a shorter window and costs less on the new platform. See our article on Oracle to PostgreSQL migration for where the time goes.

How RadixTrie helps

RadixTrie works on databases and nothing else: SQL Server, Oracle and PostgreSQL. You speak to a senior engineer directly, with no service desk in between. The team shares the context of your environment, so you never depend on one person. We give straight advice, including when the answer is to leave something alone. And we come to you first: when we see a trend that will hurt, you hear it from us before your users do. Archiving work is part of our database consulting services and our wider support and managed DBA services. An archive assessment of one database is the usual first step. To start, talk to a senior DBA.
Is your largest database too big to restore in time?

Need a hand with this?

Tell us what you run today and when it has to move. A senior database DBA will reply directly, usually within one working day. Prefer email or phone? Write to expert@radixtrie.com or call +27 10 143 0304, or use the contact page to book a 30-minute call. We provide DBA services in the United Kingdom, United States, Canada and Australia, as well as South Africa.

By submitting this form you agree to our Privacy Policy and consent to being contacted about your enquiry. Conversations stay confidential and focused on your environment.

TAGSDatabase ArchivingData GrowthData RetentionSQL ServerOraclePostgreSQL