skip to content

With seven years of retained ciphertext and a yearly key rotation, do you backfill old rows or carry every version forever?

level: principalimportance: should knowfreq 30%

answer

  1. divide retention by the rotation period
  2. the count is the real decision
  3. retention can retire a version free
  4. the backup horizon lags retention
  5. census the markers, not the rotation log

basics

~20 s

Start from the arithmetic: with no backfill, live versions converge to retention divided by rotation period - about seven here. Decide what that number should be, then choose between letting retention age versions out, funding a rolling backfill, or making rotation a cheap rewrap.

solid answer

~50 s

The number nobody computes is the one that decides this. Left alone, the set of key versions the estate depends on converges to *retention / rotation period*: seven years and a yearly rotation gives about seven live versions, quarterly gives twenty-eight, monthly eighty-four. Every one of them is material to hold, back up, restore with the manager and account for. So the real question is what that number should be and what you will spend to get it there. Three levers exist: let retention do it - the oldest year's rows expire and the version becomes retirable for free, provided deletion is genuinely enforced and the backup horizon has also passed; fund a rolling backfill of the oldest partitions each year; or change the shape so a rotation is a rewrap of per-object data keys rather than a rewrite of rows. Whichever you pick, the evidence is a census of version markers, and the floor is what proves the retirement stuck.

go deeper

for a junior

Recall that key versions accumulate: every rotation adds one, and none go away by themselves. The number that ends up live depends on how long data is kept and how often the key is rotated.

for a middle

Explain the arithmetic and the consequence: live versions converge to retention divided by rotation period, and each one must be kept, backed up and restorable because any row still naming it depends on it.

for a senior

Show how you would establish the facts: a census of version markers across live storage, backups, replicas and archives, and why the rotation history proves nothing. Be able to run the backfill and to sequence the retirement behind it.

for a principal

Own the target and its funding: state how many live versions the estate may depend on, pick the lever that gets there - retention, a standing backfill, or a structural move to rewrappable data keys - and name the owner, the budget and the reversibility you are keeping.

## Do the arithmetic before the argument The debate is usually conducted as a matter of taste - *shouldn't we re-encrypt the old data?* - when it is a division. Where nothing is ever rewritten, the number of key versions the estate depends on converges to: > **live versions = retention period / rotation period** Seven-year retention with a yearly rotation converges to about seven live versions (briefly eight, in the window after a rotation and before the oldest year's data expires). The same retention with a quarterly rotation gives twenty-eight; monthly gives eighty-four. Nothing is wrong with seven. Something is probably wrong with eighty-four, and the team that chose a monthly cadence to look diligent usually never computed it. So the decision a lead owns is not *rotate or not*. It is: **what is the target number of live versions, and what funds getting there?** ## What each live version actually costs - material that must be held, backed up, and restored with the manager, in every region it serves; - a line in whatever statement the organisation makes about custody, and an answer when an external audit asks how often the key changes and who can prove it; - a version that cannot be retired while any readable copy anywhere still names it; - one more thing that has to survive a disaster-recovery exercise intact, because losing it means losing the data it protected. None of those is dramatic on its own. The point is that the cost is per version and permanent, so the cadence you pick multiplies it. ## The three levers | Lever | What it costs | What it needs to be true | |---|---|---| | Let retention age versions out | nothing | expiry is actually enforced, and the backup horizon has passed too | | Fund a rolling backfill | one campaign per cycle | a resumable, marker-driven job and capacity to run it | | Make rotation a rewrap | a structural change, paid once | objects carry their own data keys, wrapped by the managed key | | Shorten retention | a business decision, not a technical one | someone who can actually approve holding less | **Letting retention do it** is the cheapest and the most often wrong for one reason: *expired* is not the same as *deleted*, and a version is not retirable while a backup you would still restore contains rows naming it. Get the horizon wrong and the first restore after the retirement is the incident. **A rolling backfill** keeps the live set small - move the oldest partition each cycle and you hold two or three versions instead of seven - at the price of a standing annual commitment that competes with production load, and which nobody budgets for after the first year. **Changing the shape** is the structural answer: where each object holds its own data key wrapped by the managed key, moving everything onto a new version is a rewrap of small wrapped keys rather than a rewrite of rows, so the live set can be pulled down to one or two cheaply and repeatedly. It is also the hardest to retrofit, because retrofitting it is itself the full backfill. ## What to decide, and what to state 1. **The target.** How many versions the estate is willing to depend on, as a number. 2. **The mechanism that enforces it.** Retirement, and a floor where the design offers one - otherwise the target is an aspiration. 3. **The evidence.** A census of version markers across live storage, backups within the restore horizon, replicas and archives. Not the rotation log: seven successful rotations say nothing about which rows still name version 1. 4. **The owner and the budget.** Who runs the backfill each cycle, and out of whose capacity - because the default answer is nobody, and the default outcome is a version set that only grows. 5. **The reversibility you keep.** Refusing to serve a version can be undone; destroying its material cannot. Decide deliberately which you are doing, and demand more evidence for the irreversible one. ## The trap worth naming The common failure is not choosing wrong. It is choosing a rotation cadence for how it sounds - monthly, because it reads well in an answer about key hygiene - without computing the version count it implies or funding the backfill that would keep the count down. Two years later the estate depends on two dozen key versions, no one can say which of them any stored row still needs, and retiring the oldest is a research project. A defensible position is a modest cadence, a stated target, a census that proves it, and a floor that enforces it.

  • Why is a monthly rotation cadence often worse than a yearly one for a long-retention corpus?
    Because with no backfill the live-version count is retention divided by cadence: seven-year retention gives about seven versions yearly and eighty-four monthly. Each one must be held, backed up, restored and accounted for, and none can be retired while any copy names it. The cadence buys a tighter bound on future exposure and charges permanent custody for it.
  • What makes 'the data expired, so the version is retirable' wrong more often than it looks?
    Two things. Expiry has to be genuinely enforced - a partition marked expired but still present still names the version - and the backup horizon has to have passed, because a restore of a snapshot taken before expiry brings those rows back. The version is retirable only when no copy you would ever read still names it.
  • Which evidence would you ask for before approving the retirement of the oldest version?
    A census of version markers covering live storage, replicas, exports, archives and every backup inside the restore horizon, plus a statement of when the oldest such backup ages out. Then a survivable window in which the floor is raised and refusals are watched for. The rotation history is not evidence of anything here.

saying these in an interview costs you the question

  • Picks a rotation cadence without computing the resulting version count
  • Treats every extra live version as free
  • Says expired data means the version can be retired
  • Offers the rotation log as proof no row needs the old version
  • Plans a backfill with no owner or recurring budget
  • Destroys retired material before a full restore cycle has passed