Skip to content

chore(db): retire the four per-service databases (ADR-0030 Phase 4)#262

Merged
TechGardenCode merged 1 commit into
mainfrom
chore/retire-per-service-databases
Jul 18, 2026
Merged

chore(db): retire the four per-service databases (ADR-0030 Phase 4)#262
TechGardenCode merged 1 commit into
mainfrom
chore/retire-per-service-databases

Conversation

@TechGardenCode

Copy link
Copy Markdown
Owner

Phase 4 of the ADR-0030 backend consolidation. The techgarden modular monolith is live in dev and validated (techgarden PR #112, deployed + Phase-3 green 2026-07-17), so the four old per-service databases are retired from the shared postgresql cluster.

What this removes

  • 4 Database CRs: iris-database, dopamenu-database, plates-database, notifications-database (databases.yaml)
  • 4 managed roles: iris_app, dopamenu_app, plates_app, notifications_app (cluster.yaml)
  • 4 ExternalSecrets: {iris,dopamenu,plates,notifications}-db-app-credentials (app-externalsecrets.yaml)

techgarden-database + techgarden_app + techgarden-db-app-credentials are untouched.

This drops NO data

Every Database CR is databaseReclaimPolicy: retain, and cnpg never drops a role it stops managing. So merging this leaves the four DBs and roles intact but unmanaged — a safe soak window. Reverting this PR fully restores management. The actual DROP DATABASE / DROP ROLE is a separate manual step run by hand after soak.

Bitwarden

  • 6389718c… is KEPT — it was iris_app's entry, promoted in PR1 to back techgarden_app (referenced by the live api deployment + techgarden-db-app-credentials). Removing the iris-db-app-credentials k8s ExternalSecret is safe; the Bitwarden entry stays.
  • Orphaned entries to delete manually after this merges (not in this PR): 14eb7f8b (dopamenu), e333d7be (plates), 7015df9c (notifications).

Manual follow-up (after soak, by hand)

DROP DATABASE iris; DROP DATABASE dopamenu; DROP DATABASE notifications; DROP DATABASE plates;
DROP ROLE iris_app; DROP ROLE dopamenu_app; DROP ROLE plates_app; DROP ROLE notifications_app;

Full runbook: projects/api/deploy/phase-4-teardown.md in the techgarden repo (PR #113).

🤖 Generated with Claude Code

The techgarden monolith is live and validated, so the iris/dopamenu/plates/
notifications databases, their managed app roles, and their per-service
ExternalSecrets are removed from the shared postgresql cluster. Only techgarden_app
+ techgarden-database remain.

reclaim=retain, and cnpg does not drop an unmanaged role, so this change drops NO
data — the DBs/roles persist until dropped by hand. iris's Bitwarden entry
(6389718c) is KEPT: it was promoted to back techgarden_app and the live api. Only
dopamenu/plates/notifications had their own entries (deleted separately in Bitwarden).

Follow-up (manual, after soak): DROP DATABASE + DROP ROLE for the four, then delete
the three orphaned Bitwarden entries.
@TechGardenCode
TechGardenCode merged commit 28d4713 into main Jul 18, 2026
6 checks passed
@TechGardenCode
TechGardenCode deleted the chore/retire-per-service-databases branch July 18, 2026 04:06
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