PayPay Microservices: GitOps & Kubernetes Blueprint

Prerequisite: This is the starting part of the series — no prior part is required. Later parts assume the concepts introduced here. Answer-first: PayPay scales over 100 microservices for 60+ million users in Japan by combining Domain-Driven Design boundaries with GitOps CD automation using ArgoCD and Argo Rollouts. Automated canary deployments validate new code against live production metrics before full traffic shifting. Answer-first: PayPay enforces stable deployments by combining branch promotion workflows with GitOps tools like ArgoCD. Declarative configuration files in git serve as the single source of truth, allowing ArgoCD to automatically reconcile cluster state, execute canary rollouts, and enable instant rollbacks of microservices. ...

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

Event Sourcing & CQRS: Immutable Ledger for Microservices

Prerequisite: Familiarity with the concepts introduced in Part 2 — Distributed Sql Acid Latency. Review it first if the terminology in this part is unfamiliar. Answer-first: Event sourcing and CQRS replace mutable database updates with an immutable append-only event log. Core banking systems record financial state changes as domain events, projecting read models asynchronously while guaranteeing auditability and zero data loss. Series (Part 3 of 8): This article builds upon the ACID transactions foundation from Part 2. We will design a ledger using Event Sourcing — the exact solution that Monzo, Starling Bank, and many large neo-banks use to scale. ...

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

Part 4: gRPC Internal & REST Gateway: API Contract Lifecycle

Prerequisite: This is the starting part of the series — no prior part is required. Later parts assume the concepts introduced here. Answer-first: Combining internal gRPC transport with an automated REST JSON Gateway (grpc-gateway) provides sub-millisecond HTTP/2 inter-service RPC performance while exposing standard OpenAPI/REST endpoints to web/mobile clients, guaranteed through Protocol Buffer contract linting and backward-compatible schema versioning. The sequence diagram below illustrates the end-to-end request lifecycle as an external REST/JSON HTTP client payload is transcoded by the API Gateway into high-performance gRPC Protobuf binary calls across internal microservices. ...

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

Active RAG & Strict Tool Calling With Real-time APIs

Prerequisite: Familiarity with the concepts introduced in Part 3 — Qdrant Hybrid Search. Review it first if the terminology in this part is unfamiliar. 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

Banking Microservices Architecture: Event Sourcing & Saga

Answer-first: Modernizing core banking monoliths requires transitioning to event-driven microservices using Event Sourcing, CQRS, and the Saga Pattern. Emitting immutable domain events for every ledger mutation enables decoupled scaling, complete financial auditability, and sub-millisecond query responses across composable banking modules. Prerequisite: Part 3: Transaction Isolation and ACID Guarantees on database lock behaviors. Series context (Part 4 of 8): This guide assumes familiarity with ACID transactions and database concurrency. Understanding why consistency guarantees are hard at the database layer is essential context before introducing distributed patterns here. ...

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

Distributed Transactions in Go with Temporal Saga Pattern

Distributed Transactions in Go with Temporal Saga Pattern Distributed transactions in Go microservices are commonly implemented using the Temporal Saga pattern: replacing blocking Two-Phase Commit (2PC) locks with imperative workflow orchestration, dynamic reverse compensations (saga.AddCompensation), and PostgreSQL idempotency tables to keep financial event consistency during network partitions. This guide covers: The Zombie Activity Pitfall: Why setting StartToCloseTimeout without database-level idempotency locks causes phantom debits during prolonged TCP network partitions. Dynamic Compensation Registration: How to structure workflow.NewSaga in Go so that partial failures (e.g., debit succeeds, fraud check passes, but ledger credit fails) only execute compensation for steps that actually mutated state. Handling Non-Compensable External Side-Effects: Practical design patterns for handling third-party banking APIs (e.g., SWIFT/ACH wires) that cannot be programmatically rolled back. Workflow Determinism Invariants: How to write Go workflows that use Temporal signals and queries without triggering fatal non-deterministic replay panic errors. Section 1: FinTech Distributed Transaction Mechanics: 2PC vs Saga & Dual-Entry Accounting Invariants In modern distributed financial systems, microservice architectures decompose monoliths into autonomous domains: Account Management, Fraud Detection, Core Ledger, Payment Gateway Integration, and Customer Notifications. While this decomposition provides organizational velocity and independent database scaling, it shatters the traditional ACID guarantees provided by single-instance relational databases. ...

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

Zero-Trust Service Mesh Security in Go: SPIFFE/SPIRE & Istio

Zero-Trust Service Mesh Security in Go: SPIFFE/SPIRE & Istio Introduction: The Zero-Trust Imperative in Modern Financial Microservices Traditional perimeter security models relying on firewalls, Virtual Private Clouds, and static IP addresses fail to protect modern microservices processing sensitive payment data. Container IP addresses are ephemeral and static Kubernetes secrets risk exposure, so enterprise financial architectures need Zero-Trust models that cryptographically authenticate every inter-service communication. The Payment Card Industry Data Security Standard version 4.0 (PCI-DSS 4.0) explicitly mandates stricter access controls, continuous identity attestation, automated key rotation, and cryptographic verification of all system components accessing the Cardholder Data Environment (CDE). Meeting these requirements demands a shift to a Zero-Trust Architecture (ZTA), where network locality confers zero trust: every service request must be explicitly authenticated, authorized based on strong workload identity, and encrypted in transit using short-lived cryptographic credentials. ...

July 23, 2026 · 19 min · Lê Tuấn Anh

Event-Driven Microservices in Go: NATS JetStream & CQRS

High-Throughput Event-Driven Microservices in Go with NATS JetStream & CQRS Section 1: Architectural Rationale: Why Go + NATS JetStream for Event-Driven Microservices Beyond tens of thousands of transactions per second, synchronous request-response designs start hitting database write contention and cascading latency spikes. Command Query Responsibility Segregation (CQRS) paired with Event-Driven Architecture (EDA) isolates write commands from analytical queries, letting each side scale independently. To overcome these structural boundaries, high-scale engineering organizations adopt Command Query Responsibility Segregation (CQRS) paired with Event-Driven Architecture (EDA). By explicitly separating the write path (commands) from the read path (queries), CQRS allows each side to scale independently according to its access patterns. Commands execute lightweight state mutations against write-optimized engines, emitting immutable domain events into a high-performance message broker. Decoupled consumer workers asynchronously consume these events to populate specialized, read-optimized views (such as Redis key-value pairs, Elasticsearch documents, or PostgreSQL materialized read tables). ...

July 23, 2026 · 16 min · Lê Tuấn Anh

Laravel vs Golang: When to Add Features in Each?

Laravel vs Golang: When to Add Features in Each? This post is part of the Magento to Go Migration series — a CTO playbook for migrating with a Vietnam engineering team. The Real Question Every Tech Lead eventually faces a pivotal architectural dilemma: “Do we add this new feature directly to Laravel, or is this the right moment to introduce a dedicated Golang microservice?” The answer is rarely a simple choice between “Laravel is better” or “Go is better.” Instead, making the right engineering decision requires evaluating the specific operational profile of the feature you are building. High-velocity CRUD features, admin tools, and complex business workflows belong in Laravel. Conversely, real-time WebSocket feeds, high-throughput auth validation, and compute-heavy pipelines belong in Go. ...

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

High-throughput Go Framework Benchmarks: Gin, Fiber, Kratos

High-throughput Go Framework Benchmarks: Gin, Fiber, Kratos The Testing Methodology (Beyond Hello World) We set up our benchmark tests on standard AWS hardware using a c6i.2xlarge instance (8 vCPUs, 16 GiB RAM) running Ubuntu 22.04 LTS. Both the testing client and the server running the Go application were placed in the same VPC to completely minimize any margin of error caused by physical network latency. In this testing scenario, each framework will process a GET request directed to the /ping endpoint. This endpoint does not merely return a static JSON response; it is forced to execute a middleware to extract (or generate) a Request ID from the HTTP Header (X-Request-ID), attach that information to the processing context, and execute a simulated query against a PostgreSQL database via a database connection retrieved from an optimized connection pool. Utilizing a simulated database query allows us to accurately measure the framework’s asynchronous interaction capabilities during an I/O block, while also evaluating its resource deallocation mechanisms and its ability to propagate Context Cancelation signals down the stack. ...

July 17, 2026 · 16 min · Lê Tuấn Anh

Build Production Go MCP Servers: The Definitive Guide

Build Production Go MCP Servers: The Definitive Guide Introduction: The Rise of Agentic Infrastructures The ecosystem of AI is shifting from passive chat boxes to autonomous agents. Building a Go MCP server allows developers to safely connect AI models with databases and APIs. Anthropic’s Model Context Protocol (MCP) establishes this secure, bidirectional communication between AI client environments and backend service APIs. When we deployed our first suite of agentic tools, our Claude desktop client crashed immediately due to a single un-routed fmt.Println statement. We quickly realized that while spinning up a simple Python-based calculator running over standard I/O is trivial, building a highly resilient MCP server in an enterprise environment requires a completely different level of engineering rigor. ...

July 15, 2026 · 17 min · Lê Tuấn Anh

Go Engineers in Vietnam: Vetting for Magento Migration

Prerequisite: Familiarity with the concepts introduced in Magento Migration Cost Vietnam Vs Us Eu. Review it first if the terminology in this part is unfamiliar. Answer-first: Vetting Go engineers in Vietnam for Magento migrations requires assessing distributed systems design skills—such as Saga orchestration, CDC outbox patterns, and dual-write conflict resolution—rather than basic syntax fluency. 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. ...

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

Composable E-Commerce Migration: Overcoming Tech Debt

Composable E-Commerce Migration: Overcoming Tech Debt See the 21-service e-commerce architecture blueprint for the domain boundaries this migration targets. In theory, MACH (Microservices, API-first, Cloud-native, Headless) and Composable Commerce are the “holy grail” of the e-commerce industry. However, when systems scale to process millions of transactions, issues regarding data consistency, domain decomposition, and observability costs surface. This guide details the lessons and architectural patterns from migrating a monolithic Magento application into a 21-service Go microservices platform. ...

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

Microservice Extraction: When to Split the Monolith

Answer-first: Extracting a module from a modular monolith into an independent microservice is justified only when domain isolation, asymmetric CPU/RAM scaling, or strict regulatory isolation demands it. Having pre-enforced DDD bounded contexts ensures extraction requires introducing network RPC adapters (gRPC) and Anti-Corruption Layers rather than refactoring internal core domain logic. Prerequisite: Before reading this part, please review Part 6: Migration Playbook. What You’ll Learn: Extraction Threshold Metrics: Quantitative triggers (e.g. CPU saturation ratios) that justify extraction. Interface Wrappers & Anti-Corruption Layer: How to write a Go ACL interface that switches dynamically between internal memory execution and gRPC implementations. Database Separation Loops: Replicating database tables using Change Data Capture (CDC) and Transactional Outbox during zero-downtime migrations. Saga vs 2PC Orchestration: Trade-offs between distributed 2-Phase Commit locking and Saga state machine workflows. Advocating for a Modular Monolith architecture does not equate to a conservative “put absolutely everything in one place” mentality. In reality, even the greatest Monolith systems like Shopify, Sentry, or GitLab possess a few “satellites” (Microservices) orbiting their central core. ...

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

Monolith vs Microservices: Engineering Trade-Offs | Go Guide

Prerequisite: Before reading this part, please review Part 0: Executive Summary — How Amazon Prime Video Saved 90% on Infrastructure. Part 1: Architectural Decision Framework Answer-first: Deciding between a Modular Monolith and Microservices depends on organizational scale, transaction consistency requirements, and latency limits. Teams with under 50 developers should build a modular monolith to avoid the administrative and operational “microservice premium”, using direct memory function calls to bypass network latency and complex distributed transaction protocols. ...

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

AWS ECS vs EKS for E-commerce: Architecture & Cost Comparison (2026)

AWS EKS vs ECS: Architecture, Cost & Use Cases (2026) Answer-first: When deciding between AWS ECS and EKS, choose ECS Fargate for speed and zero control plane costs if you lack Kubernetes expertise. Choose EKS if you require the CNCF ecosystem (ArgoCD, Dapr, KEDA) and have dedicated DevOps engineers to manage the $73/month control plane fee. Feature AWS ECS (Elastic Container Service) AWS EKS (Elastic Kubernetes Service) Control Plane Cost $0 (Free) $73/month (~$876/year) Scalability Good (ASG-based) Excellent (Karpenter ~45s provisioning) Complexity Low (AWS-native) High (Requires Kubernetes expertise) I’ve run both in production. At Vigo Retail, I architected a 21-service Go microservices platform on EKS handling 8,000 RPS peak and 25M+ requests/month. I’ve also managed ECS clusters for smaller AWS-native projects. This guide is what I wish existed before I made those decisions. ...

June 26, 2026 · 19 min · Lê Tuấn Anh

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

Answer-first: Integrating Dapr v1.18 with Kratos Clean Architecture enables resilient event-driven sagas and stateful microservice orchestration in Go. By isolating workflow definitions within the biz layer and wrapping Dapr SDK calls inside data adapters, applications achieve zero-downtime state persistence and strict security boundaries under WorkflowAccessPolicy CRDs. Tech Radar 22/06: Dapr v1.18 & Kratos Clean Architecture Architecting resilient distributed applications requires effective stateful orchestration. This briefing analyzes Dapr Workflows and the Actor model within the Kratos Clean Architecture framework. ...

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

Zero DevOps E-commerce with Cloudflare Workers & Turborepo

Zero DevOps E-commerce with Cloudflare Workers & Turborepo For a stateful edge checkout pattern, pair it with Cloudflare D1 and Durable Objects for real-time carts. Tired of maintaining expensive Kubernetes clusters, fine-tuning Auto-scaling groups on AWS, or wiring together complex CI/CD pipelines just to keep an e-commerce store alive? Welcome to the Zero DevOps era. This guide we dissect Aura Store — a production-grade Cloudflare Workers E-commerce platform built entirely on Edge infrastructure, powered by a Turborepo Monorepo. Everything you see below is drawn directly from the running codebase. ...

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

Go Microservices Architecture: Production Guide

Go microservices from domain design to Kubernetes deployment — gRPC, Dapr, OpenTelemetry, and GitOps patterns with explicit operational trade-offs.

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

Golang gRPC Microservices: Protobuf, TLS & Middleware

Golang gRPC Microservices: Protobuf, TLS & Middleware Why gRPC for Go Microservices? gRPC over HTTP/2 with binary Protobuf serialization reduces payload sizes and lowers latency compared to REST/JSON: gRPC REST/JSON Serialization Protobuf (binary, schema-enforced) JSON (text, schema-optional) Payload size 3–10× smaller Baseline Streaming Unary, Client, Server, Bidirectional HTTP/2 SSE (server-only), WebSocket (separate) Contract .proto file (language-agnostic codegen) OpenAPI (opt-in, often stale) Latency ~0.5ms p50 inter-service ~2–5ms p50 inter-service Browser support gRPC-Web (needs proxy) Native Best for Internal microservices, streaming Public APIs, browser clients Step 1: Define Your Service with Protobuf Contract-first API design with Protocol Buffers guarantees strict schema enforcement and language-agnostic code generation: ...

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

Composable Banking Architecture Pattern: Migration from Monolith

Composable Banking Architecture: Monolith to Modular Answer-first: The composable banking architecture pattern replaces monolithic core banking systems with modular, independent Packaged Business Capabilities (PBCs). By leveraging Go microservices, Saga orchestration, and the Strangler Fig migration pattern, banks can decouple their legacy ledgers without risky “Big Bang” cutovers. Migration Path from Monolith to Composable Transitioning to a composable core requires a phased approach to mitigate operational risk: API Gateway & Anti-Corruption Layer (ACL): Shield the legacy core behind a gateway and translate modern API requests into legacy formats using an ACL. Shadow Routing: Deploy the new composable service (e.g., a new Go-based ledger) in parallel. Mirror live traffic to it and reconcile the outputs without affecting actual customer balances. Incremental Cutover (Strangler Fig): Once reconciliation achieves 100% parity, route read traffic to the new service, followed by write traffic, effectively “strangling” that specific domain out of the monolith. Legacy core banking systems were designed in a different era. Temenos T24, Finacle, and Flexcube shared one defining assumption: the bank’s entire product catalogue — deposits, lending, payments, trade finance — would live inside a single, tightly coupled application and a single, shared database. That assumption held when banking moved at human speed. It breaks completely when product releases need to go from months to days, when a single fraud engine update must not risk a payments outage, and when engineers on a COBOL codebase are retiring faster than they can be replaced. ...

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

Dual-Write Prevention via Transactional Outbox in Go

Prerequisite: Read the previous article: Chapter 3: Distributed Rate Limiting with Redis & GCRA Algorithm. When your Golang application migrates from a Monolith to event-driven Microservices, you will immediately face an architectural nightmare: the Dual-Write Problem. 1. What is the Dual-Write Problem? Dual-Write occurs when an app attempts to write to a Database and publish to a Message Broker (Kafka) simultaneously. Without a distributed transaction, network failures will cause the two systems to fall out of sync. ...

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

High-Concurrency Architecture: C10M & Scaling in Go

Answer-first: High-concurrency B2B commerce platforms achieve 25M monthly throughput by coupling Go microservices, distributed queues, and resilient database connection pooling. Prerequisite: This is the executive summary and introductory overview of the High Concurrency Systems series. No prior reading is required to start here. You can view the full series roadmap at the Series Hub. Despite the massive advancements in cloud computing, enterprise applications facing explosive traffic growth inevitably hit a brutal wall: the Database and the Network layer. The root cause lies not in the hardware, but in the Architecture. We attempt to solve the “Millions of Requests per Second” (C10M) problem by simply throwing more servers at it (Vertical/Horizontal Scaling), only to realize that stateful bottlenecks, cache stampedes, and dual-write inconsistencies bring the entire cluster to its knees. ...

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

Go Microservices Distributed Tracing Architecture (2026)

Go Microservices Distributed Tracing Architecture (2026) Monitoring complex Go microservices requires more than isolated logs. When a request traverses HTTP APIs, Kafka event streams, and asynchronous worker pools, you need absolute visibility to pinpoint latency bottlenecks and failures. By 2026, OpenTelemetry (OTel) has cemented itself as the vendor-neutral standard for telemetry. This guide explores the architecture of distributed tracing in Go, from SDK context propagation to advanced Collector Gateway configurations. ...

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

Building Production-Grade MCP Servers in Go & Python

Prerequisite: Familiarity with the concepts introduced in Part 1 — Protocol. Review it first if the terminology in this part is unfamiliar. Part 2 — Building Production-Grade MCP Servers in Go/Python Answer-first: Building production-grade MCP servers requires adhering to Domain-Driven Design (DDD) bounded contexts, stateless scaling, and structured JSON-RPC error handling. By using Go memory buffer pools (sync.Pool) and context cancellation timeouts, production MCP servers process high-concurrency tool calls with sub-15ms execution latency. ...

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

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

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

Building AI-Native Architecture: 4 Pillars Masterclass

Prerequisite: Familiarity with the concepts introduced in Part 8 — The Junior Paradox. Review it first if the terminology in this part is unfamiliar. Answer-first: Building an AI-Native Architecture requires refactoring traditional backend systems from static monolithic REST endpoints into modular Domain-Driven Design (DDD) bounded contexts exposed via standardized AI protocols (MCP / gRPC). This enables autonomous agents to inspect, reason over, and execute application capabilities dynamically under zero-trust security. ...

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

Zero-Trust Architecture for Microservices: mTLS & Production Go Guide

Prerequisite: Familiarity with the concepts introduced in Vector Database Rag Qdrant Milvus. Review it first if the terminology in this part is unfamiliar. Answer-first: Zero-Trust Architecture (ZTA) for microservices eliminates implicit internal network trust through continuous identity verification. By coupling Workload Identity (mTLS via SPIFFE/SPIRE short-lived X.509 certificates) with User Identity (OAuth 2.1 JWT token propagation), ZTA secures distributed systems against lateral attacker movement with under 2ms of cryptographic latency overhead. ...

May 10, 2026 · 9 min · Le Tuan Anh (Senior Go Engineer)

Shopee Microservices: Golang, gRPC & API Gateway

Answer-first: Shopee handles millions of concurrent users by migrating from monolithic systems to high-performance Go microservices. Inter-service gRPC Protobuf communication and Istio/Envoy service mesh sidecars enforce strict SLAs and sub-millisecond RPC latencies across thousands of internal microservice nodes. Chapter 1: Building a Massive Foundation with Microservices, Golang, and gRPC ← Series hub | Next → Prerequisite: This is the first chapter of the Shopee Architecture series. No prior reading is required to start here. You can view the full series roadmap at the Series Hub. ...

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