Attendance Database Overview
Summary
Attendance Service uses the Npgsql PostgreSQL provider and EF Core code-first persistence. AttendanceDbContext owns the bounded-context model and coordinates aggregate state, read models, history, and outbox records.
Audience
- Backend developers, QA engineers, DevOps engineers, solution architects, and support engineers
Overview
Persistence architecture
Confirmed responsibilities
| Concern | Current behavior |
|---|---|
| Provider | Npgsql EF Core provider for PostgreSQL |
| Mapping | Fluent mappings and default Attendance-owned schema in AttendanceDbContext |
| Repositories | Aggregate-specific EF adapters; query surfaces expose composable IQueryable |
| Unit of work | Delegates commits to SaveChangesAsync |
| Tenant filtering | Global filters on 12 tenant business/history objects |
| History | Separate append-oriented audit and timeline objects |
| Messaging | Domain events are translated into outbox rows before the same save |
| Evolution | Three code-first migrations and a current model snapshot |
| Read models | Attendance-local employee profile and payroll-approved snapshot |
| Compatibility | Specialized backfill context and read-only monolith source tooling |
The service does not use shared Attendance tables from another service. Compatibility does not change data ownership.
Source References
microservices/src/attendance-service/attendance-service.csprojmicroservices/src/attendance-service/Infrastructure/AttendanceDbContext.csmicroservices/src/attendance-service/Infrastructure/Persistence.csmicroservices/src/attendance-service/Program.cs
Related Articles
See Also
Keywords
- Attendance persistence
- EF Core
- PostgreSQL
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly