Employee Database
Summary
This section documents the Employee Service persistence model verified from EF Core configuration, migrations, the current model snapshot, domain entities, repositories, query code, and relevant legacy source. It does not expose connection details, production database identifiers, event payloads, or operational runbooks.
Audience
- Backend developers and QA engineers
- Solution architects and DevOps engineers
- Support engineers working with safe consistency concepts
Overview
Employee Service owns a PostgreSQL-backed EF Core model in the employee schema. EmployeeDbContext persists the Employee aggregate, departments, designations, audit history, timeline entries, and transactional outbox records. The monolith retains separate Legacy persistence during transition; no shared-table ownership is assumed.
Scope and model
| Category | Confirmed scope | Page |
|---|---|---|
| Architecture | Context, repositories, unit of work, provider | Database overview |
| Ownership | Service and data boundaries | Ownership and boundaries |
| Employee aggregate | Root, owned employment values, child collections | Employee aggregate storage |
| Organization | Departments, designations, logical assignments | Organization storage |
| Profile | Contact, profile, bank, document-reference storage | Profile and contact storage |
| History | Timeline and technical audit | Audit and timeline storage |
| Messaging | Transactional outbox storage | Outbox storage |
| Isolation | Tenant identifiers and query filters | Tenant isolation |
| Evolution | Migrations and development seeding | Migrations and seeding |
| Reads | Indexes, search, pagination | Indexing and query patterns |
| Transition | Monolith and compatibility boundaries | Compatibility and backfill |
| Integrity | Constraints and transaction participation | Data integrity and transactions |
| Testing | Safe database-oriented testing | Database testing guide |
| Inventory | Persisted objects, relationships, indexes | Schema reference |
Transitional boundaries
Employee Service and the monolith currently have separate employee/organization persistence models and different identifier types. No Employee Service backfill runner or durable legacy-ID mapping table was found. Cutover ownership, reconciliation, and historical migration remain Requires confirmation.
Public-safety limitations
This documentation intentionally omits deployed database names, connection material, hosts, credentials, internal infrastructure identifiers, personal records, government-identifier examples, raw event bodies, and direct production-edit instructions.
Source References
microservices/src/employee-service/Infrastructure/EmployeeDbContext.csmicroservices/src/employee-service/Infrastructure/Persistence.csmicroservices/src/employee-service/Infrastructure/Migrations/microservices/src/employee-service/Domain/Employees/Employee.csData/AppDbContext.cs
Related Articles
See Also
- Platform tenant concepts
- Future Employee event documentation (Not implemented)
Keywords
- Employee persistence
- EF Core
- Tenant-scoped data
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly