Cross-Service Data Consistency: Maintaining data integrity across services without distributed database transactions—handling stock updates, payment states, and order statuses across isolated MongoDB instances.
Complex Checkout Orchestration: Coordinating checkout flows involving multiple sequential synchronous calls (user → product → payment → expedition → transaction) without making order-service a fragile single point of failure.
Multi-Platform API Management: Serving distinct API contracts for web and mobile clients without duplicating business logic within core domain services.
Dynamic Service Discovery: Managing dynamic routing and service discovery to avoid hardcoded host/port configurations as the microservice ecosystem scales.
§ 02Solution
Orchestration-Based Saga Pattern: Implemented in order-service to manage state transitions via direct service calls, executing manual compensations/rollbacks (stock release, payment/shipping cancellation) upon order failure.
Decoupled BFF Layer: Separated web (website-api) and mobile (mobile-api) BFFs to handle client-specific data aggregation, keeping domain services focused purely on core business logic.
Dynamic Service Registry: Integrated Netflix Eureka as a central service registry, enabling API Gateways and BFFs to dynamically locate service endpoints without hardcoded routing.
§ 05Gallery
§ 01 / 03
Reactive Communication: Adopted Spring WebClient for non-blocking, asynchronous inter-service I/O, optimizing performance for concurrent fan-out requests.
Standardized Stateless Auth: Centralized stateless JWT issuance and verification via user-service to secure requests consistently across downstream services (payment, expedition, transaction).
Independent Domain Scalability: Established a modular architecture where each domain service can be developed, tested, and deployed independently without cross-team bottlenecks.
Tailored Client APIs: Delivered optimized, platform-specific API contracts for web and mobile applications without altering underlying domain logic.
Seamless Service Extensibility: Created a scale-ready foundation capable of instantly integrating new microservices via dynamic Eureka discovery without host configuration changes.
§ 04Highlights
0110 Independent Microservices: Isolated databases, deployment lifecycles, and domain responsibilities for each service (Database-per-Service pattern).
02Automated Service Discovery: Dynamic routing powered by Netflix Eureka, eliminating hardcoded host/port configurations across services.
03Dedicated BFF Pattern: Separate Backend-for-Frontend services for web and mobile to maintain concise, platform-tailored API contracts.
04Saga Orchestrator (order-service): Coordinates 5 downstream services within a single, unified checkout workflow.
05Stateless Authentication: JWT-based (HS256) security issued and validated centrally via user-service.
06Reactive Inter-Service Communication: Leverages Spring WebClient for non-blocking I/O performance.
07Order State Machine: Enforces strict state transition validation (PENDING → PAYMENT_CONFIRMED → SHIPPED → DELIVERED / CANCELLED).
08Dynamic Shipping Calculation: Real-time, distance-based cost calculation managed by expedition-service.