Asset Database Overview
Summary
Source-backed overview of Asset Management persistence ownership, technology, and verified model totals.
Audience
Backend engineers, database reviewers, architects, QA, support, operations, security reviewers, and product owners.
Overview
Asset Management uses EF Core 8 with the Npgsql PostgreSQL provider through one runtime AssetDbContext. The context owns the canonical Asset aggregate, its child entities, append-only audit and timeline evidence, and messaging-support records. A derived backfill context reuses the same model with transition-specific identity generation, and a design-time factory supports schema tooling. Data is grouped in a single dedicated logical schema owned solely by Asset Service; physical deployment names, connection details, and infrastructure values are intentionally omitted.
Confirmed persistence behavior
- Seven persisted object sets across seven tables, each with a Guid primary key.
- Four owned value-object mappings (asset code, name, serial number, assignee) persist as columns on the
Assetsrow. - Two aggregate-child foreign keys (assignment history, document references) use cascade deletion.
- Fourteen non-primary-key indexes appear in the model snapshot — twelve configured explicitly and two convention-generated from the child relationships — of which three are unique and eleven are non-unique; seven are composite and six are tenant-prefixed.
- Five object sets carry a tenant query filter; the outbox and processed-event ledgers do not.
- One authored migration and one current model snapshot exist.
- Two enum types (asset status, asset condition) are stored as strings; three columns hold
jsonbevidence payloads.
Ownership counts
| Category | Count |
|---|---|
| Persisted object sets / tables | 7 |
| Aggregate roots | 1 |
| Aggregate children | 2 |
| Evidence objects (audit, timeline) | 2 |
| Messaging objects (outbox, processed-event) | 2 |
| Compatibility objects (separate tables) | 0 |
| Tenant-filtered object sets | 5 |
| Non-filtered object sets | 2 |
| Primary keys | 7 |
| Enforced foreign keys | 2 |
| Owned value-object mappings | 4 |
| Non-primary-key indexes | 14 |
| Unique indexes | 3 |
| Migrations | 1 |
Classification
Implemented persistence model with Transitional compatibility and backfill behavior.
Requires confirmation
Production ownership, retention, archival, recovery targets, concurrency policy, and final system-of-record status require confirmation. Physical schema name, connection details, and deployment topology are deliberately excluded.
Diagram
Related Articles
See Also
Keywords
- Asset persistence
- Database Overview
- Draft database documentation
Source References
microservices/src/asset-service/Infrastructure/AssetDbContext.csmicroservices/src/asset-service/Infrastructure/Persistence.csmicroservices/src/asset-service/Program.csmicroservices/src/asset-service/Infrastructure/Migrations/AssetDbContextModelSnapshot.cs
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly