---
id: SVC-PFM-DJE-partitions
title: Partition Maintenance
product_area: platform
module: data-job-engine
repository: services-platform
source_module: modules/partitions
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
owns: []
does_not_own:
  - >-
    Registered history tables and their retention belong to the applications
    that own them.
  - >-
    Engine job and refusal storage is unpartitioned and is outside this
    maintenance pass.
operations: []
events: []
jobs:
  - name: platform.partitions.maintain
    kind: >-
      Daily schedule at 03:17 UTC; deployment creates partitions without
      retirement
    does: >-
      Prepare current and future monthly storage, then archive and retire
      eligible old partitions during the daily pass.
integrations: []
consistency:
  - rule: >-
      Table maintenance proceeds independently and reports overall failure only
      after every table was attempted.
    kind: eventual
    compensation: >-
      A later pass retries failed work and retains detached storage whose
      archive did not finish.
evidence:
  - >-
    services-platform at ad3f6a65:
    modules/partitions/services/maintenance/maintain-partitions.ts,
    partitions-maintenance.work.ts;
    aws/logic/partitions-maintenance.schedule.ts;
    aws/lambda/scheduled-maintenance.ts; partitions.settings.ts;
    db/partitioned-tables.ts, db/partitions.ts; docs/partitions.md.
  - The module declares no HTTP routes at the pinned commit.
controls: [TC-AVL-004, TC-AVL-005, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-005, TC-CHG-006, TC-CHG-007, TC-DAT-001, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Partition Maintenance

## What This Service Is For

History maintenance prepares monthly storage ahead of writes and retires expired months through registered archive behavior.

## Boundary

The module owns maintenance execution without taking ownership of the history records. Product-area assignment keeps this concern here until its home is decided.

## Operations in Words

The module exposes no HTTP operation or Submissions binding. Scheduled and deployment maintenance call its functions directly.

## Events and Jobs

The schema-owner function runs daily maintenance and a deployment-time creation-only pass. Failed table metrics and successful-run heartbeat support operational alarms.

## Consistency Guarantees

Each table has an independent pass. Archive failure preserves detached data, while successful work in other tables remains. Scheduling alone does not establish a global lock against deployment maintenance.
