Executive Summary: Geospatial & Routing Architecture

The Engineering Challenge Building a modern logistics platform (like food delivery, ride-hailing, or fleet management) requires computing distances and Estimated Times of Arrival (ETA) at an immense scale. The $N^2$ Problem: If you have 1,000 drivers and 1,000 orders, calculating the distance between every possible combination requires 1,000,000 individual route calculations. Speed: These calculations must happen in real-time (under 50ms) to ensure seamless user experiences and prevent dispatching algorithms from timing out. Accuracy: The system must account for real-world constraints such as one-way streets, “no left turn” rules, and dynamic traffic congestion. Standard point-to-point APIs (like basic Google Maps API calls) are too slow and too expensive for massive Distance Matrix generation. You need an internal, highly optimized Routing Engine. ...

June 14, 2026 · 3 min · Lê Tuấn Anh

Why E-commerce Needs Agentic Search?

The search engine is the heart of every e-commerce platform. If customers cannot find a product, they will not buy it. Over the past decade, when referring to Search, we defaulted to Elasticsearch (with the BM25 algorithm). However, as user search behavior evolves—from typing abrupt keywords (“men’s running shoes”) to long queries full of complex intent (“find me waterproof trail running shoes, size 42, under $100, that can be delivered today”), traditional search engines begin to reveal their fatal flaws. ...

May 22, 2026 · 4 min · Lê Tuấn Anh

Part 0: Why the $200K/Year Magento Trap Is Avoidable

Every engineering team that’s built seriously on Magento eventually hits the same three walls: the licensing wall, the scaling wall, and the developer velocity wall. The question is whether you hit them before or after they cost you real money and real customers. Answer-first: A Composable Commerce Platform built on 21 Go microservices, Kratos v2, and Dapr PubSub can replace Magento Enterprise — delivering the same commerce capabilities (multi-warehouse, payment saga, loyalty engine, real-time search) — at zero license cost, with the ability to scale individual services independently during peak traffic. ...

April 1, 2026 · 7 min · Lê Tuấn Anh

Agentic Architecture & Golang Orchestration Power

If you have ever tried to push a RAG or Multi-Agent system written in Python (using LangChain or AutoGen) into a Production environment with thousands of concurrent requests, you have likely tasted the pain. Servers run out of RAM, CPUs become bottlenecked, and latency skyrockets uncontrollably. The root cause does not lie in the LLMs. The root cause lies in the Orchestration Architecture you are using. In Part 1 of this series, we will dissect why Python falls short in the Agentic era, and why Golang, combined with the Eino (CloudWeGo) framework, is the “ultimate weapon” for building the brain of next-generation e-commerce search systems. ...

May 22, 2026 · 5 min · Lê Tuấn Anh

Part 1: DDD Bounded Contexts — Magento to 21 Services

Every Magento team that decides to migrate to microservices faces the same first question: how many services? The industry says 4–6. “Catalog service, Order service, Customer service, Inventory service, Payment service, and maybe CMS.” Every blog post, every conference talk converges on this list. It’s a reasonable starting point — and it’s wrong for serious e-commerce at scale. The Composable Commerce Platform we’re documenting in this series has 21 microservices across 6 bounded context groups. That’s 3–4× the industry recommendation. This article explains why — with a complete Magento module → service mapping table, and the two counter-intuitive domain splits that Magento engineers almost always get wrong. ...

April 8, 2026 · 9 min · Lê Tuấn Anh

Data Ingestion & Atomic Chunking Product Data

In Part 1: The Paradigm Shift - Agentic Architecture & Golang Orchestration Power, we established the Orchestration Engine using Golang and Eino. However, no matter how smart a brain is, it becomes useless if fed with misleading, unstructured, or fragmented information. In the e-commerce domain, product catalog data changes continuously every second: prices fluctuate, inventory is updated, new products are added. Meanwhile, chunking product data to feed into a Vector Database (Qdrant) is entirely different from chunking a PDF document or a news article. ...

May 22, 2026 · 8 min · Lê Tuấn Anh

Part 2: Build a Production Server with Go

Writing a simple Python script that runs over stdio to demo the Model Context Protocol (MCP) on your local machine is easy. But deploying an MCP Server into a Kubernetes cluster to handle thousands of AI Agent requests per minute without crashing requires a powerful compiled language, a small memory footprint, and excellent concurrency support. That’s why Go (Golang) has become the top choice for Infrastructure and Platform teams. In this article, we will dive deep into using the Go SDK to build a Production MCP Server, while avoiding the pitfalls that engineers new to Agentic AI often fall into. We will also explore advanced concepts like context.Context cancellation handling and Context Window optimization. ...

May 15, 2026 · 8 min · Lê Tuấn Anh

Part 2: Rush Monorepo — 21 Go Services & 2 Frontends

When you have 21 Go microservices and 2 frontend applications, the first infrastructure question isn’t Kubernetes or CI/CD — it’s how do you manage the code itself? Two options fail immediately: polyrepo (21+ separate Git repos, impossible to maintain consistent versions) and a naive monorepo (everything dumped in one folder, phantom dependencies everywhere). You need a proper monorepo manager. Scope note: Rush manages the frontend layer (Next.js, TypeScript packages). Go microservices are managed independently via go.mod and Go workspaces. The structure below reflects the platform’s recommended approach — verify rush.json specifics against your team’s actual repository before adopting wholesale. ...

April 15, 2026 · 9 min · Lê Tuấn Anh

Qdrant Hybrid Search: Solving Semantic and Hard Filters

In Part 2: Data Ingestion & Atomic Chunking - Bringing Product Data into the AI Environment, we established a clean data synchronization pipeline from PostgreSQL to Qdrant via Kafka CDC. But the journey of building a standard e-commerce search engine has just begun. When a user enters: “Asus ROG Zephyrus G14 laptop under $1500 in stock” If using purely Dense Vector Search: The system might return other Asus ROG Zephyrus laptops priced at $2000, or even older out-of-stock models, because the Embedding model only understands general semantic similarity and cannot process strict mathematical comparisons (Hard Filters like price < 1500 and in_stock = true). If using purely Lexical Search (BM25): The system fails when the user searches by intent, such as “thin and light high-performance gaming laptop”, because these keywords do not appear directly in the product description text. The optimal solution for e-commerce is Hybrid Search — combining Dense Search (semantic understanding), Sparse Search/BM25 (exact keyword and SKU matching), and Filterable HNSW (high-performance hard attribute filtering). ...

May 22, 2026 · 7 min · Lê Tuấn Anh

Part 3: Golang + Kratos v2 — Microservice Framework Internals

For engineers coming from Magento PHP, the shift to Go microservices isn’t just a language change — it’s a fundamentally different way of organizing code. Magento has controllers, models, blocks, helpers, and plugins. Go with Kratos v2 has exactly five layers, each with a precisely defined responsibility. Answer-first: A production Go microservice on this platform follows the Kratos v2 directory convention (api/ → cmd/ → internal/biz/ → internal/data/ → internal/server/), uses Google Wire for compile-time dependency injection, exposes both HTTP and gRPC simultaneously on different ports (8xxx/9xxx), and imports a shared common library at v1.9.5 that provides outbox, caching, worker, metrics, and logging — standardized across all 21 services. ...

April 22, 2026 · 11 min · Lê Tuấn Anh

Active RAG & Strict Tool Calling With Real-time APIs

In Part 3: Qdrant Hybrid Search - Solving Semantic and Hard Filters, we successfully built a powerful Hybrid search engine combining Dense Semantic and Sparse Lexical Search. However, a practical e-commerce search system goes far beyond merely retrieving static documents from a vector database. For example, a user asks: “I want to buy a 400L Samsung Inverter refrigerator available at the District 1 branch that has an active promotion.” If we rely solely on a Vector Database, we face two critical errors: ...

May 22, 2026 · 8 min · Lê Tuấn Anh

Part 4: gRPC Internal + REST Gateway — API Contract Lifecycle

Every public-facing API in the Composable Commerce Platform starts as a .proto file. The code — Go gRPC handlers, TypeScript SDK, HTTP routes, request validation, error codes — is generated from that contract. This article documents the conventions that make that system work. Answer-first: Internal services communicate via gRPC (type-safe, binary, ~7× faster than JSON over REST). External clients (browser, mobile app) use REST via the Gateway Service (port 8000). The proto file is the single source of truth for the API contract — and three proto conventions require special attention for engineers coming from Magento: the Money type (never use float for prices), cursor-based pagination (never use offset), and proto-level field validation (validation declared in the contract, not in business logic). ...

April 29, 2026 · 9 min · Lê Tuấn Anh

Critique Loop: Preventing LLM Hallucination

In Part 4: Active RAG & Strict Tool Calling - Connecting LLMs to Real-time APIs, we successfully built a cyclic ReAct graph allowing the LLM to call APIs to check inventory and promotions in real-time. However, in a real-world production environment, giving an LLM access to Tools is not enough to guarantee absolute accuracy. A very common phenomenon is Hallucination or constraint omission: The LLM receives data indicating zero inventory from a Tool, yet in its final synthesized answer, it still recommends that product to the customer; or it ignores the maximum price filter explicitly requested by the user in the initial query. ...

May 22, 2026 · 8 min · Lê Tuấn Anh

Production Agentic Search Optimization in Go

In Part 5: Critique Loop - Preventing LLM Hallucination, we successfully built an automated response auditing module to ensure logical accuracy. However, when deploying this Agentic Search system to a large-scale production environment serving millions of users, you will immediately face practical operational challenges: Unit Economics: Every user search going through multiple LLM calls (from generating answers, calling tools, to self-critiquing) will skyrocket API bills. Latency: Customers won’t patiently wait 5-10 seconds to receive the complete final answer. Observability: How do you trace which nodes a request went through, how many tokens it consumed, and where it encountered errors? The final article in this series will guide you on thoroughly solving these problems by integrating Semantic Caching (Redis), Deterministic Model Routing, Server-Sent Events (SSE) Streaming, and OpenTelemetry Tracing into the Eino (CloudWeGo) framework. ...

May 22, 2026 · 7 min · Lê Tuấn Anh

Part 9: Transactional Outbox & Saga for Guaranteed Delivery

When a customer places an order on the Composable Commerce Platform, seven events need to happen in sequence across four independent services: Order created → Payment authorized → Stock reserved → Fulfillment triggered → Notification sent → Loyalty points awarded → Shipping label generated. Any of these can fail. The network can fail. The database can fail. A third-party payment gateway can time out. Without a reliability mechanism, a 2% failure rate on any step means 2% of all orders are stuck in an inconsistent state, requiring manual intervention. ...

June 3, 2026 · 11 min · Lê Tuấn Anh

Part 10: ADR Walkthrough — 24 Architecture Decisions Explained

21 services. 24 decisions. 3.5 months of deliberation captured in Architecture Decision Records. An ADR (Architecture Decision Record) is a short document that answers the question: “Why did we choose X when Y and Z were also options?” Without ADRs, architectural knowledge lives in engineers’ heads. When they leave, the knowledge leaves too — and the next team rewrites the same component in the way that was already tried and rejected. ...

June 10, 2026 · 11 min · Lê Tuấn Anh

Post-Magento Operations: Running a Vietnam Go Team in Production

Answer-first: A Vietnam Go team can own full production operations for a post-Magento microservices platform — but only if SLOs, runbooks, and escalation paths are defined before cutover, not after. Teams that hand off operations without this infrastructure spend their first 90 days in reactive incident mode. Teams that build it before day one transition smoothly from migration team to engineering team. Series context: This is the final technical post in the E-Commerce Re-Architecture in Vietnam series. For the migration execution playbook, see Remote Team Playbook: Vietnam Engineers Through Migration. ...

July 11, 2026 · 12 min · Lê Tuấn Anh

Managing Vietnam Engineers Through a Magento Migration

Answer-first: The biggest failure mode in running a remote Vietnam team through a Magento migration is not the timezone gap — it’s synchronous dependency on the client-side technical lead for decisions that should be pre-documented. Async-first coordination with defined phase gates eliminates 80% of timezone friction. The remaining 20% requires one weekly sync window and a clear incident escalation path. Series context: This post is part of the E-Commerce Re-Architecture in Vietnam series. For budget planning, read Cost Model: Magento → Go Migration in Vietnam vs US/EU first. ...

July 10, 2026 · 11 min · Lê Tuấn Anh

Tech Radar 10/07: Cloud-Native AI Architecture — Envoy Gateway, K8s Inference Extension & Dapr Agents

Answer-first: In 2026, Platform Engineering for AI is no longer about picking the right LLM framework. The real questions are: Who controls token cost? Who routes traffic intelligently to the right GPU pod? Where does agent state go after a crash? Three CNCF projects — Envoy AI Gateway, the K8s Gateway API Inference Extension, and Dapr Agents — are converging to answer those questions at the infrastructure layer, so application code doesn’t have to. ...

July 10, 2026 · 9 min · Lê Tuấn Anh

Magento Migration Cost: Vietnam vs US/EU Team (2026 Model)

Answer-first: A full B2B Magento → Go migration with a Vietnam team costs $320,000–$520,000 over 12–18 months. The equivalent US/EU team costs $900,000–$1,500,000 for the same scope. The Vietnam advantage is not lower quality — it’s a structural market difference of $580,000–$980,000 in direct labor savings. Break-even on management overhead typically occurs at month 4–6. Series context: This post is part of the E-Commerce Re-Architecture in Vietnam series. For the technical architecture this budget funds, read Zero-Downtime: Moving from Magento to Microservices. ...

July 9, 2026 · 9 min · Lê Tuấn Anh

Go Engineers in Vietnam: Vetting for Magento Migration

Answer-first: Vetting Go engineers for Magento migration requires a different interview framework than greenfield hiring. The critical signal is not Go syntax fluency — it’s distributed systems experience under legacy coupling constraints. Five production scenarios reveal whether a candidate can actually own migration work versus only build clean APIs from scratch. Series context: This post is part of the E-Commerce Re-Architecture in Vietnam series. For background on the migration architecture this team will execute, read Zero-Downtime: Moving from Magento to Microservices first. ...

July 8, 2026 · 11 min · Lê Tuấn Anh

Tech Radar 03/07: Autonomous AI Swarms & OpenClaw on K8s

Answer-first: LLMs are now commodities; the new battleground is orchestrating Autonomous Swarms (multi-agent systems) on Kubernetes. To run these swarms safely in 2026, Platform Engineers must merge advanced K8s scheduling, Zero Trust identity, and robust state management. Here is the definitive blueprint for operating AI Swarms on Kubernetes. Core Orchestration: State & Scale Answer-first: Treat AI agents as stateless Deployments while offloading memory and workflows to external vector databases and Dapr. This prevents data loss during pod restarts and ensures horizontal scalability. ...

July 3, 2026 · 3 min · Lê Tuấn Anh

Tech Radar 24/06: K8s AI OS & GKE Hypercluster

Welcome to this week’s Tech Radar. In our previous issue, we dove deep into Kratos Clean Architecture & Dapr. Today, we are discussing a monumental shift: Kubernetes has officially become the Operating System (OS) for AI. Let’s review the massive breaking news from Google Cloud, Microsoft, and the absolute dominance of Golang over the past 72 hours. 1. Tech News Radar: K8s “AI OS”, GKE Hypercluster & AKS Answer-first: Kubernetes has evolved far beyond a container orchestrator to become the standard Operating System for AI, currently handling 66% of generative AI workloads. Massive updates like GKE Hypercluster (managing 1 million chips) and AKS on Bare Metal reaffirm K8s’ absolute dominance in 2026. ...

June 24, 2026 · 5 min · Lê Tuấn Anh

Tech Radar 22/06: Dapr v1.18 & Kratos Clean Architecture

Welcome to this week’s Tech Radar. In our previous issue, we explored Kratos Clean Architecture & Dapr Pub/Sub. Today, we tackle the most complex domain of distributed systems: Stateful Orchestration. We will dissect how to implement Dapr Workflows and the Actor model within Kratos. Before we dive into the code, let’s look at the breaking news from the past 72 hours. 1. Tech News Radar: Dapr v1.18 & KubeCon India 2026 Answer-first: The past 72 hours brought massive shifts. Dapr v1.18 dropped with WorkflowAccessPolicy for hard-gated workflow security, OpenTelemetry officially graduated from CNCF at KubeCon India, and Go 1.26.4 shipped. Meanwhile, Kubernetes 1.33 reaches End-of-Life on June 28. ...

June 22, 2026 · 6 min · Lê Tuấn Anh

gRPC vs REST vs GraphQL: Communication Protocols in Go

Prerequisite: This is Part 12 of the System Design Masterclass. Previous parts built the reliability patterns — this part covers comparing communication protocols and data formats for microservice communication. Answer-first: gRPC is optimized for internal microservices using binary Protobuf serialization over multiplexed HTTP/2 or HTTP/3 streams. REST uses standard JSON over HTTP/1.1 or HTTP/2, serving as the default for public APIs. GraphQL operates as an aggregator at the API gateway or Backend-for-Frontend (BFF) layer, allowing clients to query specific properties, but requires complexity limits and DataLoader batching to prevent server degradation. ...

June 18, 2026 · 10 min · Lê Tuấn Anh

Go API Rate Limiting: Token Bucket & Redis Lua

Prerequisite: This is Part 11 of the System Design Masterclass. Previous parts built the core components — this part covers securing APIs and managing client traffic spikes at scale. Answer-first: API rate limiting defends backend services by restricting request volume. Security requires a layered defense: Web Application Firewalls (WAF) block edge-level volumetric spikes, API Gateways manage L7 credentials and quotas, and application middleware enforces fine-grained business limits. Client identification must rely on validated, secure IP parsing (using the PROXY protocol or rightmost X-Forwarded-For checks). ...

June 18, 2026 · 9 min · Lê Tuấn Anh

Go Observability & pprof — Memory Leaks, CPU Profiling & GODEBUG

Prerequisite: This is Part 10 of the System Design Masterclass. Previous parts built the architecture — this part teaches you how to see inside a running system and diagnose production performance issues. Answer-first: Go’s built-in pprof profiler provides CPU sampling, heap allocation analysis, goroutine stack inspection, and blocking profiler — all available as HTTP endpoints in running production services with minimal overhead. Heap diff between two snapshots is the fastest way to identify memory leaks. ...

June 18, 2026 · 9 min · Lê Tuấn Anh

Consistent Hashing in Go — Virtual Nodes & CRC32 Ring

Prerequisite: Part 9 of the System Design Masterclass. Read Part 4: Database Scaling for context on horizontal partitioning strategies. Answer-first: Consistent Hashing minimizes key remapping when cluster membership changes. Adding or removing one node from a modulo-hash cluster remaps nearly all keys (catastrophic cache miss storm). Consistent Hashing remaps only $K/N$ keys — the theoretical minimum necessary. Why Modulo Hashing Fails When Scaling Answer-first: hash(key) % N changes to hash(key) % (N+1) when a node is added, causing nearly all key-to-node mappings to change. This creates a massive cache miss storm as the entire working set must be reloaded from the database simultaneously. ...

June 18, 2026 · 8 min · Lê Tuấn Anh

Saga Pattern in Go — Temporal, Outbox Pattern & Debezium

Prerequisite: Part 8 of the System Design Masterclass. Read Part 7: Idempotent API Design first — compensating transactions in Saga must be idempotent. Answer-first: The Saga Pattern coordinates distributed transactions across microservices by decomposing a large transaction into a sequence of local transactions. If any step fails, the system automatically executes compensating transactions in reverse order to undo completed steps. Each local transaction must be idempotent. What Are the Problems with 2PC in Microservices? Answer-first: Two-Phase Commit (2PC) is a blocking protocol with a coordinator single point of failure. If the coordinator crashes between the Prepare and Commit phases, all participants are blocked indefinitely with locks held — a catastrophic failure mode in microservices. These are the same core banking distributed transaction challenges seen in legacy systems. ...

June 18, 2026 · 8 min · Lê Tuấn Anh

Idempotent API Design in Go — Idempotency Key & Redis SetNX

Prerequisite: Part 7 of the System Design Masterclass. Read Part 6: Distributed Locks — concurrent duplicate request blocking relies on the same mutual exclusion primitives. Answer-first: API idempotency ensures that retrying an identical request (same Idempotency-Key) never produces additional side effects beyond the first execution. This is foundational for payment APIs where network timeouts force client retries, and a duplicate execution would mean a double charge. What Is an Idempotency Key? Answer-first: An Idempotency Key is a unique token — typically UUID v4 — generated by the client and attached as an Idempotency-Key HTTP header. The server uses this key to detect duplicate requests: if the key has been seen before, return the cached response from the first execution without re-executing the handler. ...

June 18, 2026 · 8 min · Lê Tuấn Anh