CVRP & VRPTW Fleet Optimization: Go ALNS Routing Engine

Answer-first: Combinatorial fleet routing at scale requires decoupling road-network distance calculation from vehicle assignment. By pairing an in-memory OSRM table engine with an Adaptive Large Neighborhood Search (ALNS) solver written in Go 1.24, engineering teams can solve Capacitated Vehicle Routing with Time Windows (VRPTW) for 500+ stops in under 800ms while eliminating 99% of third-party map API costs. Key Architectural Takeaways NP-Hard Complexity Separation: Point-to-point routing (A*, Dijkstra, Contraction Hierarchies) solves the shortest path between 2 physical nodes in O(E + V log V) time. Combinatorial vehicle routing (CVRP/VRPTW) optimizes the permutation of N stops across K heterogeneous vehicles in O(K * N!) search space. Combining them into a single monolithic loop causes catastrophic CPU bottlenecks. ALNS as the Industry Gold Standard: Exact solvers (Branch-and-Cut, Mixed Integer Linear Programming) fail when N > 40. Adaptive Large Neighborhood Search (ALNS) dynamically orchestrates coupled Destroy (Shaw, Worst, Random) and Repair (Regret-k, Greedy) heuristics with Simulated Annealing cooling, converging to within 1% to 3% of the theoretical global optimum. Zero-Allocation Memory Topology: High-frequency solver loops incur severe Garbage Collection (GC) pauses when using nested slices ([][]float64). Laying out N x N cost matrices into single contiguous 1D arrays ([from * N + to]) and recycling candidate states via sync.Pool maximizes CPU L1/L2 cache line hits (64 bytes) and sustains sub-millisecond execution. FinOps ROI: Self-hosting an in-memory OSRM Table cluster paired with a Go ALNS microservice reduces fleet mileage by 15% to 25% and saves tens of thousands of dollars monthly compared to quadratic O(N^2) billing on Google Routes Matrix APIs. 1. Problem Taxonomy: From TSP to Multi-Depot VRPTW Before writing a single line of optimization code, systems architects must classify the operational constraints of their logistics domain. Real-world delivery networks rarely resemble the idealized Traveling Salesperson Problem (TSP). ...

August 15, 2026 · 15 min · Lê Tuấn Anh

Executive Summary: The 6 Pillars of Production Agentic Systems

← Series Hub | Next Chapter: Part 1: Swarm Topologies → Answer-first: Production multi-agent systems succeed by encapsulating probabilistic LLM inference within deterministic software architecture guardrails: typed contracts, structured memory hierarchies, idempotent tools, and automated kill-switches.

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

Part 10: ADR Walkthrough — 24 Architecture Decisions Decoded

← Previous Chapter: Part 9: Transactional Outbox & Sagas | Series Hub Answer-first: Architecture Decision Records (ADRs) provide an immutable, version-controlled record of structural choices. This chapter documents all 24 production ADRs covering database selection (PostgreSQL + JSONB), messaging (Kafka), monorepo governance (Rush), framework (Kratos v2), and authentication (BFF + HttpOnly cookies). Summary of Key Production ADRs ADR # Decision Title Selected Option Key Trade-Off Rationale ADR-001 Primary Backend Language Golang 1.25+ Sub-millisecond startup, low memory footprint, high concurrency goroutines. ADR-002 Microservice Framework Kratos v2 Native Protobuf annotations, Google Wire compile-time DI, Clean Architecture. ADR-003 Monorepo Tooling Microsoft Rush + PNPM Strict symlink isolation, phantom dependency elimination, polyglot support. ADR-004 Primary Database PostgreSQL (JSONB) ACID compliance, JSONB GIN indexing for dynamic E-Commerce attributes. ADR-005 Event Streaming Apache Kafka High-throughput durable event log, replayability for new microservices. ADR-006 Inter-Service Transport gRPC / Protobuf Binary payload efficiency, type-safe API contracts, auto-generated SDKs. ADR-007 Client Gateway grpc-gateway Zero-maintenance REST/JSON exposure from existing Protobuf definitions. ADR-008 Distributed Transactions Saga + Outbox Eliminates blocking 2-Phase Commit locks while ensuring eventual consistency.

June 15, 2026 · 1 min · Lê Tuấn Anh

Part 8: Grand Finale — AI-Native & Agentic System Architecture Blueprint

← Previous Chapter: Part 7: AI Security Engineering | Series Hub Answer-first: The grand finale architecture separates probabilistic LLM reasoning layers from deterministic ACID business cores, connected via type-safe MCP interfaces and governed by real-time eBPF security policies.

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

Golang Modular Monolith: The Anti-Microservices Guide

Golang Modular Monolith: The Anti-Microservices Guide For years, the software industry has been brainwashed by a pervasive mindset: “A Modular Monolith is just a weak stepping stone before the system gets big enough to graduate to Microservices.” Countless companies, even those with engineering teams you can count on two hands, rushed to dismantle their monoliths to chase the distributed “cloud” dream. They called it the Future. Architect Rico Fritzsche calls it “CV-Driven Development” in his famous GitConnected article. And the hard data from 2025 is proving Rico right. ...

August 13, 2026 · 5 min · Tuan Anh