Dapr Workflow Go Tutorial: Orchestrated Saga Pattern

Dapr Workflow Go Tutorial: Orchestrated Saga Pattern Compensation handlers configuration in Dapr to guarantee atomic rollback. How to handle transient workflows when the orchestrator instance restarts mid-transaction. Most Go developers building microservices know the Choreography Saga pattern: service A emits an event, service B reacts, service C reacts to B, and so on. If step C fails, services emit “compensation” events in reverse order. The pattern works elegantly for simple flows, but breaks down as the number of steps grows: debugging a failed saga requires tracing events across five message broker topics, and implementing compensation logic requires every service to understand the full saga’s state. ...

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

Flash Sale Architecture: Rate Limiting & Redis

Flash Sale Architecture: Rate Limiting & Redis [!NOTE] On sourcing: This article describes flash-sale architecture patterns for C10M-scale events; it is not a disclosure of Shopee’s internal systems, and the figures here are engineering targets rather than published Shopee metrics. Shopee has not publicly documented its flash-sale internals in detail. What is public is its database platform choice — Shopee’s adoption of TiDB is documented in PingCAP’s case studies (How Shopee Chose the Right Database, Shopping on Shopee, the TiDB Way). Treat everything else as a reference pattern to validate against your own workload. ...

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

Generative UI with MCP: Architecting AI-Native Frontends

Generative UI with MCP: Architecting AI-Native Frontends Generative UI with Model Context Protocol (MCP) moves frontends from text-only chat interfaces to dynamic, interactive UI components. Using React Server Components, Zod runtime schema validation, dynamic component registries, and iframe sandboxing, AI agents can safely trigger rich native UI components directly from structured tool call outputs. This post covers six pieces of that architecture: moving beyond plain-text chat, reconciling agent reasoning state with live DOM state, managing a versioned component registry, securing and making components accessible, human-in-the-loop confirmation for high-risk actions, and testing/deploying at the edge. ...

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

Go pprof in Kubernetes: Remote Profiling & Flame Graphs

Go pprof in Kubernetes: Remote Profiling & Flame Graphs You’ve instrumented your Go service with net/http/pprof, run go tool pprof locally against the development binary, and spotted the hot path in your flame graph. Then you deploy to Kubernetes and the bottleneck disappears — because the workload profile in Kubernetes differs from local testing (different request mix, connection pool pressure, GC behavior under actual memory pressure, scheduler interference from co-located pods). ...

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

Golang Goroutine Pool Patterns: errgroup & Worker Pools

Golang Goroutine Pool Patterns: errgroup & Backpressure Preventing goroutine leaks in high-concurrency worker pools using errgroup. Writing robust worker pools that propagate context cancellation to all active goroutines. Every Go engineer eventually writes the same mistake: a loop that launches goroutines unconditionally. In a demo with 10 items, this works beautifully. In production with 50,000 incoming webhook events, it spawns 50,000 goroutines simultaneously, exhausts memory, and triggers the OOM killer. Kubernetes restarts the pod. The on-call engineer gets paged at 3 AM. ...

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

GraphRAG vs Naive RAG: Enterprise Architecture Guide

GraphRAG vs Naive RAG: Enterprise Architecture Guide Most RAG (Retrieval-Augmented Generation) implementations look the same: chunk documents, embed them into vectors, store them in a vector database, retrieve by cosine similarity, and inject the top-K chunks into the LLM context. This works for simple document Q&A. It fails systematically for enterprise knowledge bases where the answer to a question depends not on a single document chunk, but on the relationships between dozens of interconnected entities. ...

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

Order Fulfillment Algorithm: Warehouse to Last-Mile

Order Fulfillment Algorithm: Warehouse to Last-Mile Executive Summary & Fulfillment Fundamentals When an order is confirmed, the fulfillment system executes a multi-step decision pipeline: Available-to-Promise (ATP) Check: Filter candidate warehouses by real-time uncommitted stock. Cost & Proximity Scoring: Evaluate shipping distance, labor rate, carrier capacity, and SLA risk. Split vs. Consolidate Trade-Off: Determine whether to ship from multiple warehouses or wait for inventory consolidation. CONDOR & Anticipatory Dispatch: Pre-position stock globally based on probabilistic ML demand forecasts. Last-Mile VRP Solving: Optimize driver routes using vehicle routing solvers (OR-Tools / GraphHopper). Step 1 — Real-Time Inventory & Available-to-Promise (ATP) Physical stock on hand does not equal sellable stock. Fulfillment systems distinguish between raw inventory counts and uncommitted inventory: ...

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

PayPay Architecture: Scaling Payments to 70M Users

PayPay Architecture: Scaling to 70M Users & 100k Peak TPS PayPay launched in October 2018 and grew to 10 million users in just 3 months — a growth rate that no Japanese fintech had ever seen. By 2025, the platform had crossed 70 million registered users and processed 7.8 billion payments per year. Behind this growth is an engineering team that has had to scale not just their infrastructure, but their entire engineering culture: from service standardization and GitOps-driven deployments to chaos engineering and AI-powered fraud detection. ...

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

Prompt Engineering vs Fine Tuning: 2026 AI Decision Guide

Prompt Engineering vs Fine Tuning vs RAG: Complete 2026 Decision Guide Prompt Engineering vs Fine Tuning: Executive Decision Framework Answer-first: In the prompt engineering vs fine tuning evaluation, prompt engineering offers rapid prototyping with zero setup cost, whereas fine tuning Small Language Models (SLMs) via QLoRA bakes domain knowledge into weights, reducing TTFT latency under 250ms and cutting API token spend by 90%. Small Language Models (SLMs, 1B–8B parameters) combined with fine-tuning and local inference (vLLM) rival proprietary frontier LLMs on specialized domain tasks at a fraction of the cost. The playbook below rests on three architectural choices: ...

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

Real-Time Ride-Hailing Architecture: Uber & Grab Stack

Real-Time Ride-Hailing Architecture: Matching, Spatial Indexing & Websockets The moment you open the Uber or Grab app, a cascade of real-time systems activates simultaneously: your phone begins transmitting GPS coordinates, a geospatial index updates your location, a matching engine re-evaluates nearby driver availability, a pricing model recalculates the fare based on supply-demand ratios, and a push notification pipeline prepares to deliver your match confirmation in under 3 seconds. What makes this hard is not any single component — it is the combination of all of them, processing millions of concurrent users, each with sub-second latency requirements, continuously. This post walks through all six layers of the real-time ride-hailing architecture stack, from GPS ingestion to driver notification, using Uber and Grab’s engineering practices as the reference model. ...

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

Self-Hosting GraphHopper on Kubernetes with OSM Data

Self-Hosting GraphHopper on Kubernetes with OSM Data GraphHopper is arguably the most capable open-source routing engine available — it supports Contraction Hierarchies (CH) for sub-millisecond route queries, custom vehicle profiles, turn restrictions, and the full OpenStreetMap road network. The problem most teams encounter is not the algorithm; it is the operational challenge of running it in Kubernetes: loading a large OSM PBF file, sizing JVM memory correctly, handling the long CH pre-processing startup time, and updating map data without downtime. ...

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

What is Vibe Coding? Why AI Code Review is the Future

What is Vibe Coding? Why AI Code Review is the Future In February 2025, Andrej Karpathy, former Tesla AI Lead and OpenAI co-founder, tweeted a phrase that would define a new paradigm in software development: “There’s a new kind of coding I call ‘vibe coding’, where you fully give in to the vibes, embrace exponentials, and forget that the code even exists.” In the months since, vibe coding has evolved from a catchy meme into one of the most significant AI software engineering trends of the decade. Non-technical founders are shipping complex web apps in hours, product managers are replacing spreadsheet systems with automated dashboards, and engineers are building features at a velocity that was previously unimaginable. ...

May 31, 2026 · 11 min · Lê Tuấn Anh

Production Agentic AI Swarm: OpenClaw & LiteLLM

Production Agentic AI Swarm: OpenClaw & LiteLLM Docker cap-drop security patterns that protect local credentials from AI agents. Setting up model fallbacks and pool-key routing in LiteLLM to bypass API rate limits. Conversational AI chatbots that just answer questions are no longer the interesting part of the stack. What’s driving most of the recent engineering work is Agentic AI: autonomous systems capable of planning, executing, and iterating on multi-step workflows without constant human supervision. (For a deeper analysis of these Agentic System Architecture principles, see our Agentic System Architecture masterclass). ...

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

Microfinance Core Banking: Architecture & Engineering Guide

Microfinance Core Banking: Architecture & Engineering Guide Building a Core Banking System (CBS) for a Microfinance Institution (MFI) presents a radically different set of engineering challenges compared to traditional retail banking. While commercial banks focus heavily on individual credit scores and card networks, microfinance operates on high-frequency, low-value transactions, group-based lending, and offline field collections. If you are an engineer or Business Analyst transitioning into fintech, understanding the architectural nuances of platforms like Apache Fineract (Mifos X) or Musoni is critical. This guide we will break down the 5 must-have modules of a Microfinance CBS, providing the database schemas, mathematical formulas, double-entry mappings, and the actual Product Requirements Document (PRD) snippets you need to build them. ...

May 28, 2026 · 11 min · Lê Tuấn Anh

Goroutine Leak Detection and Fix in Production Go Services

Goroutine Leak Detection and Fix in Production Go Services Writing automated test cases that detect goroutine leaks before deploying. Analyzing production runtime stack traces to locate orphaned channels. A Kubernetes pod abruptly restarts with exit code 137. The memory metrics dashboard shows a slow, perfectly linear staircase pattern stretching over three days. There are no panic logs in stdout, no database errors, and no abnormal CPU spikes. Just a slow, silent OOM (Out Of Memory) death. ...

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

Replace MySQL Sharding with TiDB: Architecture Guide

Replace MySQL Sharding with TiDB: Distributed SQL Architecture Scaling a relational database is one of the most demanding challenges in system design. As applications grow from thousands to millions of active users, the database ceases to be a simple storage engine and becomes the primary bottleneck of the entire system architecture. In this technical guide, we explore the architectural progression of scaling MySQL—beginning with replication topologies, stepping through the complexities and operational hazards of manual database sharding (including proxy middleware like Vitess), and evaluating NewSQL alternatives, specifically the distributed architecture of TiDB. ...

May 26, 2026 · 16 min · Lê Tuấn Anh

Serverless E-Commerce: Cloudflare Workers & D1 Architecture

Serverless E-Commerce: Cloudflare Workers & D1 Architecture Edge-native schema migrations and connection tuning for SQLite-based D1. Managing distributed lock states in Durable Objects without causing bottleneck stalls. Running a traditional PHP/MySQL stack for e-commerce works until a flash sale hits. Then you’re scaling servers, tuning Redis, and hoping your monolithic database doesn’t lock up. If you are exploring moving away from Magento or simply evaluating the edge, there is a radically different approach: building a transactional e-commerce engine entirely on Cloudflare’s edge network. ...

May 25, 2026 · 9 min · Lê Tuấn Anh

How Databases Shaped Go, PHP, Node.js, and Rust

How Databases Shaped Go, PHP, Node.js, and Rust Databases are the most critical I/O bottleneck in backend systems. Over the past 20 years, network latency, connection limits, and transaction safety have forced programming languages to rethink their concurrency models, evolve new syntaxes, and invent smarter ORMs. Here is a deep architectural breakdown of how database constraints drove the evolution of PHP, Node.js, Rust, and Go. 1. Connection Models & Concurrency Process-per-request models exhaust physical database connections under heavy load; languages with embedded multiplexed connection pools avoid saturating downstream database clusters. ...

May 25, 2026 · 9 min · Lê Tuấn Anh

Magento AI Integration: Modernize Without Rebuilding

Magento AI Integration: Modernize Without Rebuilding Queue-based worker systems that isolate Magento from LLM latency. Writing robust fallback routes when third-party AI translation services go offline. The hype surrounding artificial intelligence in e-commerce is deafening. Every SaaS platform promises “one-click AI personalization,” leaving legacy Magento (Adobe Commerce) merchants feeling trapped. Facing the choice of a multi-million dollar replatforming project or falling behind the AI curve, many e-commerce leaders make a critical mistake: they attempt to force AI workloads directly into Magento’s monolithic core. ...

May 24, 2026 · 11 min · Lê Tuấn Anh

Dapr State Store Consistency Trade-offs Explained

Dapr State Store Consistency Trade-offs Explained Dapr State Store Architecture & Consistency Models In distributed applications, state management remains one of the most complex challenges. When transitioning to a microservices architecture, each service typically requires independent data storage and querying capabilities. This leads to technology fragmentation, where a system might simultaneously use Redis for caching, PostgreSQL for transactional data, and Cassandra for large unstructured data. Dapr (Distributed Application Runtime) emerged to solve this issue through a robust abstraction mechanism. ...

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

OAuth 2.1 & Prompt Versioning for Production AI Agents

Production AI APIs: OAuth 2.1, Gateway Rate Limiting & Prompt Versioning Running AI APIs in production for the past 18 months has produced three lessons that I did not find in any “getting started with LLMs” tutorial. They emerged from incidents, postmortems, and that specific kind of 2 AM Slack message where a word you never wanted to see — “silent,” as in “silent failure” — appears in a production context. ...

May 18, 2026 · 14 min · Lê Tuấn Anh

Argo CD 3.4 & 3.3 Guide: GitOps Upgrades & Cluster Pause

Argo CD 3.4 & 3.3 Guide: GitOps Upgrades & Cluster Pause (2026) GitOps is steadily becoming the gold standard for configuration management and application deployment on Kubernetes. Among the tools available, Argo CD continues to maintain its leading position. In the first half of 2026, the Argo project released two landmark versions: Argo CD 3.3 and Argo CD 3.4. These releases address numerous headaches related to application lifecycle management, synchronization performance, and incident response capabilities. ...

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

Autonomous Hybrid-AI Pipeline: Cron to State-Machine

Autonomous Hybrid-AI Pipeline: Cron to State-Machine Production AI content pipelines need deterministic orchestrators, multi-tier memory systems, and cost-aware model routing to handle automated ingestion reliably. Replacing monolithic background jobs with event-driven agents gives resilient execution, zero-idle resource usage, and stricter output verification. This post covers four pieces of that architecture: Topology & Orchestration: Master-worker agent swarms managed by explicit state machines. Memory System Architecture: Working memory (context window), short-term memory (Redis session), and long-term memory (Vector/Graph RAG). Tool Calling & MCP: Protocol-driven tool execution via Model Context Protocol. AgentOps & Governance: Tracing, fallback cascades, evaluation gates, and hardware Wake-on-LAN power optimization. 1. Agent System Topology & State Machine A resilient pipeline replaces stateless cron scripts with an explicit Finite State Machine (FSM). By encapsulating pipeline operations within state transitions, every step—from hardware boot to scraping, filtering, and drafting—is recorded with atomic rollback safety. ...

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

Is Magento Worth It in 2026? The 2.4.9 Reality

Is Magento Still Worth Investing in 2026? Enterprise Architecture & Cost Analysis The question is not “Is Magento good?” The real question is: is Magento a good investment for your business, right now, given your constraints? Magento can still power very large commerce operations, but it demands a level of engineering ownership that many teams underestimate. The most useful lens in 2026 is to look at the massive architectural shift introduced by Magento Open Source 2.4.9 (officially released on May 12, 2026), and contrast it with what you can actually run in production today. ...

May 17, 2026 · 10 min · Lê Tuấn Anh

Laravel in the AI Era: 10 Predictions for 2028

Laravel in the AI Era: 10 Predictions for 2028 The moment I realized the Laravel ecosystem was fundamentally changing wasn’t when an AI wrote a clever algorithm. It was when I watched Claude 3.5 Sonnet scaffold a complete multi-tenant invoicing module — Migrations, Eloquent Models with relationships, Form Requests, Controllers, and Blade views — without a single syntax error, in under 45 seconds. Writing boilerplate is no longer an engineering skill. It is a commodity. ...

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

AI-Native Frontend in 2028: 10 Architecture Predictions

AI-Native Frontend in 2028: 10 Architecture Predictions Executive Summary & AI Playbook Baseline Transitioning to AI-native operations requires an end-to-end strategy across 5 foundational pillars: Context Engineering & DDD: Aligning agent context windows with Domain-Driven Design bounded contexts to eliminate prompt hallucination. AI Platform Layer: Centralizing LLM API gateways, semantic caching, rate limiting, and model fallback cascades across all frontend and backend clients. Internal Ops Automation: AI-assisted code review, automated documentation generation, and internal operational workflow orchestration. Policy-as-Code & Agentic CI/CD: Enforcing automated security governance, static analysis rubrics, and evaluation gates before merging AI-generated code. AI-Native System & UI Architecture: Generative UI runtimes using Model Context Protocol (MCP), dynamic component registries, and streaming state synchronization. 1. Context Engineering & Domain-Driven Design (DDD) Context engineering injects structured, domain-scoped data into LLM prompts using Domain-Driven Design (DDD) boundaries to prevent hallucinations and optimize context window consumption. ...

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

OSRM Shared Memory on Kubernetes: Zero-Downtime Updates

OSRM Shared Memory on Kubernetes: Live Traffic Updates with Zero-Downtime The Challenge of Operating Large-Scale OSRM on Kubernetes Normally, the osrm-routed process loads the entire binary map file directly into its Heap Memory. For massive files weighing tens of gigabytes, a single Kubernetes Pod can take anywhere from 5 to 10 minutes to finish loading before it becomes healthy and ready to serve traffic. This creates two fatal operational issues: ...

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

Surge Pricing Algorithm & Spatial Indexing Architecture

Surge Pricing Algorithm & Spatial Indexing Architecture Why is it that every time it rains, ride-hailing fares double, or even triple? It’s not a human operator manually adjusting the prices behind a desk. Rather, it’s the result of an incredibly sophisticated Stream Processing engine running in the background executing the surge pricing algorithm. This analysis breaks down the architecture of a real-time dynamic pricing system: indexing geographical rider demand and driver supply using Uber’s H3 hexagonal spatial grids, aggregating supply/demand ratios over Redis sliding windows, and calculating dynamic fare multipliers while damping oscillations and preventing boundary gaming. We also cover why Scaling your Database to handle Surge traffic is a strict prerequisite to prevent your system from crashing during massive traffic spikes. ...

May 12, 2026 · 9 min · Lê Tuấn Anh

Architecting Agentic E-commerce Search with Golang

Architecting Agentic E-commerce Search with Golang Practical strategies for tuning vector search precision without bloating RAM. How to coordinate multiple AI search agents to prevent search query latency spikes. If customers cannot find a product, they cannot buy it — search is core infrastructure for any e-commerce platform. User search behavior has evolved from typing short, abrupt keywords (e.g., “men’s running shoes”) to submitting complex, goal-oriented queries (e.g., “find me a pair of men’s waterproof trail running shoes, size 42, under $100, that can be delivered by tomorrow”). Against these multifaceted intents, traditional keyword search engines show their limitations. ...

May 10, 2026 · 10 min · Lê Tuấn Anh

Magento Enterprise Project Scoping & Agency Cost Matrix

Magento Enterprise Project Scoping & Agency Cost Matrix Vendor management templates and scope definition checklists for outsourced dev. Common project scoping pitfalls that lead to budget overruns in custom integrations. Magento development in Vietnam can look very different depending on what you are actually buying — and many failed projects come down to a mismatch between what was scoped and what was built. This guide is for the person managing or commissioning a Magento project: the PM, the CTO, or the e-commerce director who needs to evaluate a proposal, structure an engagement via a strict cost matrix, and track delivery without being misled by vague timelines or unspecified complexity. ...

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