Asset Database Limitations
Summary
Consolidated, source-backed list of the persistence limitations and unconfirmed areas that reviewers must weigh before treating Asset Management as a hardened system of record.
Audience
Backend engineers, database reviewers, architects, QA, support, operations, security reviewers, and product owners.
Overview
Every item below is derived from the current source checkout. Limitations are stated with source-backed wording; recommendations for change belong here and in the Database Testing Guide, not in the verified inventories on other pages.
Confirmed persistence limitations
| Area | Verified limitation |
|---|---|
| Endpoint authorization | Foundation endpoints are anonymous and tenant-scoped; authorization is not a database-enforced control. |
| Tenant isolation | Application-only (EF global query filters + explicit predicates + header/claim trust); there is no database row-level security. |
| Elevated context | A SuperAdmin claim bypasses all tenant query filters. |
| Employee/labor references | AssignedToUserId and LaborId have no foreign keys — identifier-only. |
| Workflow reference | WorkflowInstanceId has no foreign key to the Workflow Service — identifier-only. |
| Document reference | DocumentServiceId/StorageObjectId have no foreign keys — bytes live in Document Service. |
| Asset-code uniqueness | Enforced in the application layer only; the AssetCode index is non-unique with no database unique constraint. |
| Serial-number uniqueness | No uniqueness constraint of any kind. |
| One active assignment | No database constraint guarantees a single current custodian. |
| Concurrency | No RowVersion, timestamp, or concurrency token; no optimistic or pessimistic locking. |
| Distributed transactions | External Workflow and Document Service calls occur outside the local database transaction; there is no distributed atomicity. |
| Document compensation | No compensation if an external document store succeeds while the later local save fails. |
| Outbox cleanup | No cleanup, replay, or dead-letter table for the outbox. |
| Processed-event ledger | Modeled but unused; the service has no inbound consumer, and there is no cleanup. |
| Retention governance | No retention, archival, or cleanup worker for any object. |
| Query pagination | List and workspace reads are capped (Take) but not paginated; reads load full entities without database projection. |
| Compatibility identity | CompatId is a transitional numeric identity mirroring the monolith record space. |
| Migration history | A single initial migration exists; rollback (Down) is present but untested in source. |
| Persistence test coverage | No dedicated EF/DbContext, repository, migration, transaction, or concurrency test suite exists. |
| Backfill ownership | Backfill operational ownership and retirement plan are not established in source. |
Classification
Transitional persistence with confirmed structural and governance gaps.
Requires confirmation
Authorization governance, tenant hardening, uniqueness and one-active-assignment constraints, concurrency strategy, retention and cleanup policy, compatibility retirement, migration governance, rollback testing, and dedicated persistence test ownership require confirmation.
Related Articles
See Also
Keywords
- Asset persistence
- Database Limitations
- Draft database documentation
Source References
microservices/src/asset-service/Infrastructure/AssetDbContext.csmicroservices/src/asset-service/Infrastructure/Persistence.csmicroservices/src/asset-service/Domain/Asset/Asset.csmicroservices/src/asset-service/Infrastructure/Migrations/AssetDbContextModelSnapshot.cs
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly