Skip to content

feat(pdm): use one DynamoDB table per algorithm - #136

Merged
prdai merged 4 commits into
mainfrom
feat/algorithm-seed-table
Nov 26, 2026
Merged

prdai merged 4 commits into
mainfrom
feat/algorithm-seed-table

Conversation

@prdai

@prdai prdai commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

what changed

  • PDM data now lives in one DynamoDB table per algorithm, named <prefix>-<algorithmId>. Prefixes are rads-personal-data and secure-rads-personal-data, exposed as the PdmTablePrefix stack output.
  • Seeding creates tables on demand. Secure seeding also creates a dedicated per-algorithm table CMK and records PdmTableKeyArn on the registry algorithm table, separate from the PCR-bound enclave key.
  • Both PDM handlers (records and count) resolve the table from the validated algorithm id. The Makefile and benchmark use the prefix for seeding.
  • Execution-service no longer needs a PDM table. After feat(pdm): serve size checks from an mTLS count endpoint #139 it gets counts from PDM's /count, so the pre-rebase execution-service table params, IAM grants, and table-derived count call are dropped.
  • The secure PDM role gets kms:Decrypt scoped by kms:ViaService=dynamodb, required to read CMK-encrypted tables. Execution-service does not touch PDM tables.
  • Seeding retries DynamoDB InternalServerError in the batch writer.
  • Removed the shared PersonalDataTable from both PDM stacks. Deploying deletes the existing shared tables.

why

Per-algorithm tables make isolation, IAM scope, encryption keys, TTL, backup/restore, and deletion native DynamoDB boundaries instead of per-item conventions. See #130.

verification

  • bun run typecheck and bun run lint pass in seeding, both pdm-service trees, and both execution-service trees.
  • serverless package succeeds for both PDM stacks after the rebase; the secure template keeps the mTLS count API from feat(pdm): serve size checks from an mTLS count endpoint #139.
  • uvx ruff==0.17.4 check . and uvx ruff==0.17.4 format --check . pass in benchmark.
  • Pre-rebase deploy: seeded all five datasets in both trees, confirmed five tables per tree with SSE and distinct keys on the secure side, and PdmTableKeyArn stored per algorithm.
  • Pre-rebase ehealth 150k: rads 136.5 s single / 132.6-137.6 s at 4 concurrent; secure-rads 156.9 s single / 148.7-152.3 s at 4 concurrent, all exit:0, zero DynamoDB throttles.
  • Not verified: a combined deploy of this branch with feat(pdm): serve size checks from an mTLS count endpoint #139's count endpoint, or the full 300-run matrix.

notes

prdai and others added 3 commits November 26, 2026 07:07
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
@prdai
prdai force-pushed the feat/algorithm-seed-table branch from d66decf to fdfcf50 Compare November 26, 2026 01:38
@prdai
prdai marked this pull request as ready for review November 26, 2026 02:55
@prdai
prdai merged commit 9bd3461 into main Nov 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant