Order Splitting Algorithm: Graph Coloring & OPA in Golang

Prerequisite: Review Part 8: Intelligent Order Release for previous context on order batching and VRPTW before starting this guide. Order Splitting at Scale: Graph Coloring, Bin Packing, and OPA in Go Answer-first: Real-time e-commerce order splitting is a Constraint Satisfaction Problem (CSP). The standard pipeline relies on Open Policy Agent (OPA) for dynamic rules, Golang (gonum) for Graph Coloring to resolve logical conflicts, and First-Fit Decreasing Bin Packing for physical constraints, executing in sub-50ms during synchronous checkout. Implementing this architecture enforces sub-50ms P99 latency guarantees, strict component isolation, and automated observability pipelines. ...

August 1, 2026 · 6 min · Lê Tuấn Anh

Warehouse Picker Routing: GraphHopper, OR-Tools & C++

Prerequisite: Review Part 9: Order Splitting Algorithm for the previous module on box estimation and graph coloring algorithms. Warehouse Picker Routing Optimization (GraphHopper & OR-Tools) Answer-first: Minimizing walking distance for warehouse pickers requires solving the Traveling Salesperson Problem (TSP) inside a physical building. The 2026 standard architecture uses a Java-based Indoor GraphHopper instance to generate a 100x100 Distance Matrix from custom OpenStreetMap (OSM) data, which is then fed into a C++ Google OR-Tools gRPC Microservice to calculate the absolute optimal pick sequence in under 15 milliseconds. ...

August 1, 2026 · 5 min · Lê Tuấn Anh

Ecommerce Microservices Architecture Diagram: 21-Service Go

Ecommerce Microservices Architecture Diagram: 21-Service Blueprint E-Commerce Architecture Patterns: Monolith vs Microservices Answer-first: An ecommerce microservices architecture diagram organizes enterprise capabilities into 6 core bounded domains (Commerce Flow, Product & Content, Logistics, Post-Purchase, Identity & Access, Platform Operations), orchestrating 21 Go microservices via gRPC and Dapr Pub/Sub event mesh. This architecture achieves sub-50ms P99 latency, isolates database-per-service failures, and guarantees reliable checkout rollbacks using distributed Saga workflows. Monolithic vs Microservices E-Commerce Comparison Dimension Monolithic E-Commerce Microservices E-Commerce Scaling Vertical scaling of entire monolith application Independent horizontal scaling per domain (e.g., Catalog 10x Cart) Database Architecture Single shared database with cross-table SQL joins Database-per-service (PostgreSQL, Redis, Elasticsearch) with zero cross-domain access Deployment Frequency Low frequency; all-or-nothing monolithic releases High frequency; independent CI/CD pipelines per microservice Fault Tolerance Low; a single bug or memory leak crashes the entire store High; failure in one domain (e.g., Reviews) does not block Checkout Complexity Low initial architectural and operational complexity High distributed complexity (Saga pattern, gRPC contracts, Dapr mesh) Operational Cost Lower initial cost; scales expensively at high traffic Higher initial infrastructure setup; cost-effective at high scale Practical latency and memory metrics comparing an Envoy-based API Gateway to a custom Go reverse proxy under 100k concurrent connections. How to tune circuit breaker thresholds (go-resiliency/breaker) to prevent premature service isolation during temporary network jitters. When transitioning from a monolithic platform to a distributed microservice setup, the hardest question isn’t “How do we write the code?” — it’s “How do these moving parts talk to each other safely, and why is each boundary drawn exactly where it is?” ...

April 12, 2026 · 10 min · Lê Tuấn Anh