Professional
Order Store Service
Overview
Order Store Service maintained a consolidated view of orders assembled from events produced by multiple systems, including order creation, payments, courier assignment, warehouse reservation, claims, documents and customer changes. REST APIs exposed the accumulated state, while asynchronous workflows evaluated whether enough information had arrived to continue downstream processing. I contributed extensively to the service, including the order-picking authorization flow, logistics and customer enrichment, database-backed concurrency control, EF Core and SQL performance improvements, and asynchronous integration-test infrastructure.
My Role
- Implemented a major end-to-end order-picking authorization workflow that consumed commands, persisted readiness state, validated required order data and published OrderAuthorizedForPickingEvent when all prerequisites were satisfied.
- Built and extended order enrichment from courier, pickup-point, delivery, picking-instruction, warehouse-reservation and invoice-payment events, including persistence, mappings and integration tests.
- Implemented a local customer projection with event-driven updates and a synchronous fallback to the Online service when required customer data was not yet available locally.
- Designed database-backed locking for concurrent order and customer event processing across multiple service instances.
- Improved EF Core and SQL Server performance through split and no-tracking query paths, repository optimizations, indexing and removal of expensive ORM behavior.
- Extended complex claim and return handling for bundled products, replacements and relationships between original and generated order items.
- Built and stabilized test infrastructure for asynchronous consume-and-publish workflows, including fake publishers and synchronization around published events.
- Performed a cross-solution migration to .NET 6 covering application projects, tests, Docker runtime configuration and CI/CD.
Architecture & Technology
- ASP.NET Core REST API exposing persisted order, customer-order and history projections
- Event-driven consumers processing commands and integration events from the Oriflame messaging platform over Azure Service Bus
- EF Core with SQL Server for order projections, statuses, logistics data, customer information, payments, documents and synchronization state
- Event Hub publishers for downstream order and warehouse-management events
- Readiness evaluation based on persisted event and command statuses before publishing dependent downstream events
- Database-backed order and customer locks for coordinating concurrent processing across horizontally scaled service instances
- Polly-based retry policies with failed message handling delegated to the messaging platform dead-letter queue
- Application Insights telemetry, audit logging, health checks and AKS deployment through Azure DevOps and GitOps
Engineering Challenges
- Build a coherent order projection from events arriving independently and potentially in different orders from multiple upstream systems.
- Determine when enough distributed state had been collected to safely authorize an order for warehouse picking without relying on one synchronous request.
- Handle multiple events for the same order or customer concurrently across horizontally scaled service instances.
- Keep increasingly rich order graphs performant as persisted relationships and API retrieval requirements grew.
- Handle incomplete or optional event payloads while preserving enough state for downstream publishing and API consumers.
- Test asynchronous workflows deterministically when consuming one message could eventually result in persistence changes and additional published events.
Decisions & Trade-offs
- Track received events and commands as persisted order statuses and evaluate readiness against that accumulated state. This allowed downstream actions to wait for required information without coupling upstream systems into a synchronous orchestration chain.
- Use database-backed order and customer locks rather than process-local synchronization. Because multiple service instances ran in AKS, coordination had to remain effective across process boundaries.
- Persist enriched order data such as courier details, pickup points, warehouse information, payments and customer data locally. This made the order projection useful to APIs and downstream publishers without repeatedly querying every originating service.
- Use a synchronous Online-service fallback only when required customer information was missing from the local event-driven projection. This preserved the normal asynchronous flow while providing a recovery path for incomplete customer state.
- Optimize shared EF Core repository paths with split queries, no-tracking reads and targeted indexes instead of relying on implicit ORM loading behavior. This reduced unnecessary database work on large order graphs.
- Create dedicated test publisher infrastructure so integration tests could observe asynchronous downstream events directly and verify complete consume-persist-publish flows.
Results & Impact
- Delivered an event-driven picking-authorization workflow spanning message consumption, persisted readiness state, customer and logistics enrichment, downstream event construction and publishing.
- Expanded the order projection with logistics, payment, customer and warehouse information required by APIs and downstream fulfillment processes.
- Improved reliability of concurrent event processing through database-level coordination for orders and customers.
- Improved database access characteristics through EF Core query optimization, index design and repository-level performance work.
- Added regression coverage for complex order scenarios including bundled-product returns, replacements and asynchronous publishing.
- Strengthened the platform through reusable asynchronous integration-test infrastructure, production observability and a cross-solution migration to .NET 6.