[VS-NfD] Store read events in their own table with retention and partitioning #224
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#224
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan reference:
20-massnahmenplan.md-> Phase 3, Variante AADR: ADR 0023
Effort: M (2 AT)
Depends on: #222
Context
Read events have a different volume profile, a different retention period
and a different legal basis than
audit_log. Mixing them would force onepolicy onto both.
Current state
audit_log(apps/api/prisma/schema.prisma:74–91) holds auth and adminevents and has no retention job yet (#196) and no partitioning.
Acceptance criteria
("who read page X", "what did user Y read", both within a period).
and tested — not left as an operational chore.
documented default and the deletion itself logged.
documented) — evidence nobody can read is not evidence.
operator can size storage.
docs/architecture/data-model.mddocuments the table.Out of scope
SIEM forwarding of read events beyond the catalogue from #201, and
tamper-proofing.
Implemented in PR #280 (commit
2bdb0ec), contained in the merged chain (PR #281, run 596 green; own run 593 failed only on runner infra). Monthly RANGE partitions with DEFAULT safety-net partition; daily read-trail-maintenance job (job fence 9->10) creates months ahead incl. per-partition dedup indexes and prunes under readTrail.retentionDays (default 365) - whole months by DROP, remainder by ranged delete, audited as read_trail.pruned (catalogue v1.2). Site-Admin query path GET /admin/system/read-events (pageId/actor/channel/period). Growth measured: ~1 MB per 1000 events incl. indexes (data-model.md). Fresh-DB test runs the real migration chain and proves partition shape, per-partition P2002 and DROP pruning. Live: read_events on test is relkind=p with 4 partitions.