I walked into the HR module at PensionCentral—a platform where HR companies manage and upload schedules for companies and organizations moreso, organizations and branches can register themselves and upload schedules—and found a system built on bulky, synchronous request flows that froze under real load. Every major action—uploading staff records, validating batches, generating pension schedules—blocked the thread and stalled the entire platform. It was functional in theory, but not in production reality.
I tore the flow apart.
The first step was decoupling long-running tasks. Instead of forcing the user to wait for heavy processing to complete, I pushed everything into background jobs using Hangfire. Batch imports, schedule generation, reconciliation—all moved off the request pipeline. The UI instantly stopped choking.
Then I cleaned the data path. Entity Framework Core can be either efficient or disastrous; the difference is in how you write your queries. I rewrote every major operation with strict field selection, projection, and zero over-fetching. No loading entire entities when all I needed was three columns. No silent N+1 queries. No lazy-loading traps. Pure, intentional query design. Execution time dropped. Memory pressure collapsed.
I also audited patterns that looked harmless but were killing performance: mixing async and sync calls, wrapping database operations inside unnecessary loops, and pushing logic into the controller layer. I replaced them with explicit service boundaries and predictable async pipelines. The module became traceable, testable, and far easier to reason about.
On the frontend, I rebuilt the entire interface with React. The old version was rigid and assumed the backend would always return instantly. With background jobs in place, I redesigned the UX around state transitions—pending, processing, completed—with clear job status indicators and structured data tables. The system finally behaved like a real HR operations tool rather than a static form collection page.
In the end, the HR module stopped being a drag on the pension remittance platform and became one of its most stable components. The architecture shifted from request-blocking to event-driven. The data layer became lean. The frontend became responsive to real-world backend latency. And the entire system reflected engineering choices made deliberately—not by accident.