Skip to main content

Expense Database Overview

Summary

The runtime ExpenseDbContext owns the production persistence model and outbox conversion. ExpenseDbContextFactory creates it for design-time migration tooling. ExpenseBackfillDbContext derives from it for transition tooling and changes only compatibility-identifier generation.

Audience

Backend developers, database reviewers, QA, architects, DevOps, support, and implementation teams.

Confirmed persistence

Context or factoryScopeConfirmed distinction
ExpenseDbContextProduction runtimeOwns every Expense EF mapping, tenant filters, and outbox conversion during SaveChanges
ExpenseDbContextFactoryDesign timeCreates ExpenseDbContext with a non-request privileged tenant context for migration tooling
ExpenseBackfillDbContextTransition toolingDerives from ExpenseDbContext and disables store generation for CompatId; it is not a second production store

No additional production runtime, read-only, reporting, or legacy-source DbContext is confirmed. The monolith source reader and derived backfill target context are transition tools, not another production system of record.

Requires confirmation

Production migration governance, retention, archival, masking, performance targets, concurrency roadmap, operational-store access, and rollback ownership remain unconfirmed unless narrowed above.

Source References

  • microservices/src/expense-service/Infrastructure/ExpenseDbContext.cs
  • microservices/src/expense-service/Infrastructure/Persistence.cs
  • microservices/src/expense-service/Backfill/ExpenseBackfillTypes.cs

See Also

Keywords

  • Expense database
  • Database Overview

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-16
  • Review cycle: Quarterly