Skip to main content

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 Assets row.
  • 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 jsonb evidence payloads.

Ownership counts

CategoryCount
Persisted object sets / tables7
Aggregate roots1
Aggregate children2
Evidence objects (audit, timeline)2
Messaging objects (outbox, processed-event)2
Compatibility objects (separate tables)0
Tenant-filtered object sets5
Non-filtered object sets2
Primary keys7
Enforced foreign keys2
Owned value-object mappings4
Non-primary-key indexes14
Unique indexes3
Migrations1

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

See Also

Keywords

  • Asset persistence
  • Database Overview
  • Draft database documentation

Source References

  • microservices/src/asset-service/Infrastructure/AssetDbContext.cs
  • microservices/src/asset-service/Infrastructure/Persistence.cs
  • microservices/src/asset-service/Program.cs
  • microservices/src/asset-service/Infrastructure/Migrations/AssetDbContextModelSnapshot.cs

Revision Information

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