Kafka Worker Pool in Go — Backpressure & Exactly-Once

Prerequisite: Part 5 of the System Design Masterclass. Read Part 4: Database Scaling first. Kafka Worker Pool in Go — Backpressure & Exactly-Once Executive Summary & Quick Answer: High-throughput event streaming in Go leverages Kafka zero-copy sendfile() kernel transfers combined with bounded goroutine worker pools. Natural backpressure is achieved using buffered Go channels, while partition-pinned workers preserve message ordering without distributed locks. Key Takeaways: Zero-Copy Performance: Kafka bypasses user-space buffer copies via sendfile(), routing data directly from Linux page cache to network socket buffers. Channel Backpressure: Bounded Go channels automatically throttle poll loops when downstream workers reach memory capacity limits. Partition-Aware Ordering: Pinning specific Kafka partition IDs to dedicated worker goroutines maintains strict message sequence guarantees. What You’ll Learn That AI Won’t Tell You Kernel-Level sendfile() Mechanics: How zero-copy I/O bypasses the context switches between user and kernel space, preventing CPU cache invalidation. Worker Pool Partition Pinning: Why mapping partitions to specific workers is the only way to maintain order processing sequences without locking. Offset Commit Transaction Math: Implementing transactional offset commits inside Go consumers to guarantee idempotency under broker rebalances. Kafka vs RabbitMQ — When to Use Each? Key Concept: Kafka is a distributed commit log — messages are retained indefinitely, consumers manage their own offsets, and replay is possible. RabbitMQ is a message broker — messages are deleted after acknowledgment, the broker handles routing complexity, push-based delivery. They solve different problems. ...

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

Database Sharding in Go: TiDB, Postgres & Pools | Go Product

Answer-First: Horizontal database sharding with Vitess and TiDB distributes high-volume write traffic across database clusters using consistent hashing and range partitioning. Prerequisite: Part 4 of the System Design Masterclass. Read Part 3: Caching Strategies first. Database Sharding in Go — TiDB, PostgreSQL & Connection Pools Executive Summary & Quick Answer: Horizontal database sharding partitions SQL tables across independent database nodes using hash or range shard keys. In Go services, combining application-level shard routing with tuned database/sql connection pools (SetMaxOpenConns, SetMaxIdleConns) prevents RAM exhaustion and write bottlenecks. ...

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

Caching Strategies in Go: Cache Stampede & Redis Guide

Implementing write-through and cache-aside patterns in Go using Redis Sentinel guarantees cache consistency and protects downstream SQL databases. Prerequisite: Part 3 of the System Design Masterclass. Read Part 2: Load Balancing L4/L7 first. What You’ll Learn That AI Won’t Tell You XFetch Mathematical Constants: How to configure the scaling factor ($\beta$) in XFetch to balance background refresh CPU usage against cache miss rates. Redis Memory Allocation Overhead: How Redis’s internal jemalloc allocator causes memory fragmentation, and why LRU evictions don’t immediately free up RAM. Singleflight Leakage: The danger of singleflight lockups when backend queries hang indefinitely, and how to guard it using Go context timeouts. How Does Cache Stampede Happen? Key Concept: Cache Stampede (thundering herd) occurs when a popular cached key expires and multiple concurrent goroutines simultaneously detect a cache miss — then all query the database simultaneously. The burst of duplicate DB queries can exceed connection pool capacity and cause cascading failure. ...

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

L4/L7 Load Balancing in Go: DSR & API Gateway Design

Answer-First: Building a Go API gateway with Envoy and NGINX enables L7 load balancing, JWT authentication, and token-bucket rate limiting at the ingress layer. Prerequisite: Part 2 of the System Design Masterclass. Read Part 1: System Design Thinking first. Load Balancing L4/L7 in Go — DSR, Rate Limiting & API Gateway Executive Summary & Quick Answer: L4 load balancing routes traffic at the transport layer using IP/TCP metadata with minimal CPU overhead, whereas L7 load balancing inspects HTTP headers, cookies, and URLs for intelligent content-based routing. Combining L4 Direct Server Return (DSR) with L7 Envoy API Gateways and Go token-bucket rate limiters handles peak traffic spikes smoothly. ...

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

Go System Design: CAP, PACELC & Clean Architecture Primer

Prerequisite: This is Part 1 of the System Design Masterclass series. Familiarity with basic distributed systems concepts and Go syntax is assumed. Go System Design: CAP, PACELC & Clean Architecture Primer Executive Summary & Quick Answer: System design in Go balances CAP/PACELC trade-offs across consistency, availability, and latency. Clean Architecture isolates business logic behind Go interfaces while dependency injection decouples domain layers from database and transport protocols. Key Takeaways: CAP Theorem: Network partitions force an absolute choice between Consistency (CP) and Availability (AP). PACELC Matrix: When normal operation occurs (else), systems trade off Latency (L) versus Consistency (C). Clean Architecture: Domain interfaces isolate business logic from SQL/gRPC infrastructure, enabling unit testing without mocks. What You’ll Learn That AI Won’t Tell You CAP Theorem Realities: A rigorous look at Gilbert and Lynch’s proof showing why network partitions force an absolute choice between availability and consistency. PACELC in Practice: Why latency-consistency trade-offs are the real bottleneck in healthy networks, and how Go services suffer under Spanner’s commit wait times. Clean Architecture Cost: The compilation and memory allocation overhead of interface-driven design in Go. How Do You Build System Design Thinking? Answer-first: System design thinking relies on evaluating 3D performance-reliability-cost trade-offs, calculating composite availability math ($A_{\text{composite}} = A_A \times A_B \times A_C$), and establishing strict SLI metrics, SLO targets, and SLA contracts. ...

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

Zero DevOps E-commerce with Cloudflare Workers & Turborepo

Zero DevOps E-commerce with Cloudflare Workers & Turborepo Answer-First: Building a zero-DevOps e-commerce backend combines Cloudflare Workers (serverless V8 isolates at 300+ edge locations) with Cloudflare D1 (edge SQLite) inside a Turborepo monorepo. This architecture eliminates server provisioning, Docker image maintenance, and CI/CD pipeline complexity, while automatically generating type-safe mobile SDKs (Flutter/Swift) directly from shared OpenAPI contracts on every API build. For a stateful edge checkout pattern, pair it with Cloudflare D1 and Durable Objects for real-time carts. ...

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

Kubernetes In-Place Pod Resizing: No-Restart Scaling

Kubernetes In-Place Pod Resizing: No-Restart Scaling Answer-First: Kubernetes In-Place Pod Resizing allows dynamically mutating container CPU and memory requests and limits without deleting, rescheduling, or restarting pods. Configured via resizePolicy in container specs and automated through Vertical Pod Autoscaler (VPA), it prevents connection drops and state loss in latency-critical microservices and AI workloads. In-place pod resizing edge cases where CPU updates cause container restarts. Configuring kubelet parameters to support resizing without disrupting running JVM tasks. Before this feature, changing a container’s resource allocation required deleting and recreating the pod. For a stateful database holding connections, an AI model with 30GB of weights loaded in memory, or a long-running batch job — that restart is catastrophic. In-Place Pod Resize finally decouples resource management from pod lifecycle. ...

June 12, 2026 · 13 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 · 24 min · Lê Tuấn Anh

Magento Development in Vietnam: Cost, Hiring & Upgrade

Vietnam’s Magento talent pool runs deep — but finding engineers who can handle production architecture is harder. Cost tiers, vetting signals, hiring models, and when to migrate.

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

Golang gRPC Microservices: Protobuf, TLS & Middleware

Golang gRPC Microservices: Protobuf, TLS & Middleware Answer-First: Production Golang gRPC microservices achieve high throughput and security by using Protocol Buffers binary serialization, mutual TLS (mTLS) for zero-trust service authentication, interceptor middleware for cross-cutting concerns, and connection keep-alive tuning to eliminate idle TCP teardowns. Optimizing Protobuf serialization overhead in Go-based gRPC microservices. How to set up connection keep-alive parameters to prevent TCP connection drops during peak load. Why gRPC for Go Microservices? Selecting gRPC for inter-service communication in Go microservices offers significant performance benefits over traditional REST over HTTP/1.1 interfaces. Operating on HTTP/2 multiplexed streams with binary Protocol Buffer serialization reduces network payload sizes and lowers serialization overhead across high-throughput distributed microservice architectures. The comparison table below highlights these key protocol differences: ...

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

GraphHopper Distance Matrix: Self-Host, API & Alternatives

GraphHopper Distance Matrix: Production Self-Hosting & API Guide Answer-First: Self-hosting GraphHopper distance matrix via Docker and the /matrix API provides a cost-effective, high-throughput alternative to Google Maps for logistics routing. By caching OpenStreetMap (OSM) road networks in memory with H3 spatial indexing and Redis, engineering teams can compute 1,000x1,000 distance-time matrices in milliseconds to power last-mile Vehicle Routing Problem (VRP) algorithms. Setting up GraphHopper self-hosting routing engine with custom profile caches. Configuring RAM allocations to hold entire continental OpenStreetMap networks. How to Call the GraphHopper Matrix API (/matrix Endpoint) Running GraphHopper distance matrix in production requires configuring Docker deployment, the /matrix API endpoint, Custom Models for vehicle-specific routing (truck/motorcycle), H3-based Redis caching, and evaluating performance tradeoffs against OSRM, Valhalla, and Google Maps (for an in-depth analysis of routing engine selection, see our OSRM vs GraphHopper Architecture Comparison). ...

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

Composable Banking Architecture: Monolith to Modular

Composable Banking Architecture: Monolith to Modular Answer-First: Composable banking replaces monolithic core banking systems with independent, swappable Packaged Business Capabilities (PBCs) based on MACH principles. Using Go microservices, event-driven Saga orchestration, and Strangler Fig patterns, banks can update specific capabilities like payments without risking core ledger stability or total outages. Strangler fig patterns for core banking systems that prevent data corruption. How to bridge legacy COBOL records into dynamic JSON streams using Go middleware. 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

MySQL Scalability: Read Replicas, Sharding & TiDB

MySQL Scalability Guide: Read Replicas, Sharding, and Distributed SQL Answer-First: Scaling MySQL requires matching the solution to the bottleneck: tune InnoDB buffer pool (70–80% RAM) and ProxySQL pooling for initial gains; add async read replicas for read-heavy workloads; apply Vitess or GORM application-level sharding for write-heavy data (>1TB); or migrate to distributed NewSQL (TiDB) when cross-shard queries and manual re-sharding become unsustainable. Tuning InnoDB buffer pool size for high read/write ratio workloads. Why standard read replication fails to solve write bottlenecks and when toshard. MySQL scalability is the ability to increase database throughput — reads per second, writes per second, or data volume — without rewriting your application. The critical distinction: read scaling (adding replicas) and write scaling (sharding or distributed SQL) require completely different architectural approaches. Choosing the wrong path creates technical debt that takes months to unwind. ...

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

Real-Time Inventory: Kafka, CDC & Redis for E-Commerce

Real-Time Inventory Topology: CDC, Kafka, and Redis Answer-First: Building high-throughput real-time inventory systems requires a hybrid Speed & Truth architecture. Change Data Capture (Debezium) streams database stock updates into Apache Kafka, while atomic Redis Lua scripts handle instant sub-millisecond stock reservations with zero overselling during high-concurrency flash sales. Write-through caches configuration in Redis to prevent inventory drift. Lua scripting implementations in Redis that prevent double-reservations under peak load. Real-time inventory synchronization is the process of propagating stock count changes from the system of record (database) to all sales channels — web storefront, mobile app, WMS, ERP — in sub-second time. Instead of batch ETL jobs that run every hour, a CDC + Kafka pipeline streams every committed stock change as an event, eliminating overselling and stale stock displays. ...

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

Go Microservices Distributed Tracing Architecture (2026)

Go Microservices Distributed Tracing Architecture (2026) Answer-First: Distributed tracing in Go microservices relies on OpenTelemetry (OTel) SDKs to propagate W3C Trace Context across HTTP APIs, gRPC calls, and Kafka event streams. By implementing an OTel Collector Gateway with tail-based sampling, engineering teams maintain end-to-end transaction visibility and rapidly pinpoint latency bottlenecks without incurring prohibitive telemetry storage costs. OpenTelemetry collector tuning for low-overhead distributed tracing. Propagating span contexts over asynchronous Kafka messaging systems without breaking tracing chains. 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. ...

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

MCP Gateway Architecture: Intelligent Dynamic Routing

Part 4 — MCP Gateway Architecture & Routing Executive Summary & Quick Answer: Operating multiple independent MCP servers across an enterprise creates point-to-point management sprawl and security leaks. An MCP Gateway acts as a centralized reverse proxy control plane, handling dynamic tool routing, rate limiting, authentication enforcement, and circuit breaking for all downstream MCP server microservices. Key Takeaways: Centralized Control Plane: Eliminates point-to-point connections by proxying all AI agent tool requests through a single gateway. Dynamic Tool Aggregation: Aggregates disparate backend tools/list responses into a unified tool directory for client hosts. Resilient Circuit Breaking: Protects downstream database and microservice MCP servers from agent traffic spikes. In early enterprise AI deployments, every development team built their own standalone MCP server. Soon, an organization operating 30 engineering teams found itself managing 30 distinct MCP server URLs, each requiring separate authentication configs, firewall rules, and observability integrations. ...

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

Building Production-Grade MCP Servers in Go & Python

Part 2 — Building Production-Grade MCP Servers in Go/Python Executive Summary & Quick Answer: 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. Key Takeaways: DDD Bounded Context Isolation: Microservice MCP servers isolate domain tools (Billing, K8s, Database) to restrict security blast radius. Graceful Tool Error Handling: Setting isError: true in tool result payloads allows AI agents to self-correct invalid arguments without crashing. 100% Stateless Horizontal Scaling: Externalizes all session state to Redis, enabling Kubernetes Horizontal Pod Autoscaling (HPA). Building a quick MCP server prototype for local testing is simple. However, deploying an Enterprise Production MCP Server serving thousands of concurrent AI agent queries across a Kubernetes cluster demands rigorous engineering discipline. ...

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

MCP Protocol Engineering: Transport Evolution & Specs

Part 1 — MCP Core Protocol Architecture & Transport Evolution Executive Summary & Quick Answer: Model Context Protocol (MCP) relies on dual-transport abstractions (stdio for zero-overhead local process IPC and SSE for remote network RPCs) transmitting JSON-RPC 2.0 messages. Understanding the protocol state machine ensures sub-20ms message framing across distributed AI agent tool servers. Key Takeaways: Dual Transport Abstraction: stdio provides local desktop IPC with zero network overhead; SSE provides HTTP network streaming. Bi-Directional JSON-RPC 2.0: Enables servers to initiate notification requests back to client hosts during long-running tool execution. Strict Capabilities Negotiation: Ensures clients and servers negotiate supported features (resources, tools, prompts) during initialization. The Model Context Protocol (MCP) is built upon a layered architecture designed to isolate application business logic from underlying transport communication channels. ...

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

MCP Architecture: Model Context Protocol Production Guide

Executive Summary — Model Context Protocol in Production: The Control Plane of AI Executive Summary & Quick Answer: Model Context Protocol (MCP) establishes an open, vendor-agnostic JSON-RPC 2.0 standard for connecting AI agents to enterprise data sources, tools, and prompts. Replacing ad-hoc custom integrations with production MCP Gateways enforces 100% data isolation, mTLS identity verification, and central telemetry auditing across enterprise microservices. Key Takeaways: Unified JSON-RPC Standard: Eliminates custom API integration glue code across LLM frameworks (Claude, Cursor, LangChain). Zero Trust Identity Enforcement: Uses OAuth 2.1 PKCE and SPIFFE/SPIRE mTLS certificates to authenticate AI agent tool calls. Sub-20ms Transport Overhead: High-performance SSE and stdio transport layers minimize communication latency. Before the introduction of the Model Context Protocol (MCP), connecting AI agents to enterprise data stores was fragmentation chaos. Every developer built custom glue code to connect LLMs to PostgreSQL databases, JIRA APIs, internal GitHub repos, and Kubernetes clusters. ...

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

Banking Microservices in Go: Saga & Event Sourcing

Banking Microservices in Go: Saga & Event Sourcing Answer-First: Building resilient banking microservices in Go requires replacing monolithic core systems with double-entry ledger immutability, Transactional Outbox patterns via Kafka, and Temporal Saga orchestration. This architectural combination guarantees strict financial consistency, prevents double-spending, and handles transient payment gateway failures gracefully. How to implement transactional outbox pattern to guarantee eventual consistency. Saga Orchestration patterns that handle transient payment gateway timeouts gracefully. 1. Introduction: Deconstructing the Legacy Core For decades, legacy banking platforms like Temenos T24 and Oracle FLEXCUBE served as rigid transactional monoliths designed for batch processing. Modern digital banking architectures in 2026 require decomposing these monolithic bottlenecks into event-driven Go microservices capable of processing real-time payments with sub-10ms latency and high throughput. ...

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

Vitess vs GORM Sharding: MySQL Write Scaling in Go

Vitess vs GORM Sharding: MySQL Write Scaling in Go Answer-First: Scaling MySQL write capacity in Go requires choosing between Vitess middleware proxy routing (VTGate) for transparent, zero-downtime cluster-wide resharding, or GORM application-level sharding for low-overhead Go-native table partitioning that requires explicit sharding keys in every query. Designing database sharding keys that prevent cross-shard joins. Configuring proxy routing layers like Vitess to scale MySQL queries horizontally. When your application reaches millions of users, a single database instance will inevitably become the biggest bottleneck in your entire architecture. To solve this, MySQL database scaling becomes mandatory. You must Scale DB for Microservices using Horizontal Scaling techniques. ...

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

Alipay Double 11: 544,000 TPS Architecture Explained

Alipay Double 11: 544,000 TPS Architecture Explained Answer-First: Alipay reached a reported peak of 544,000 payment transactions per second (TPS) during Double 11 by migrating from a monolithic architecture to Local Deployment Center (LDC) cell-based unitization, OceanBase distributed Paxos database clusters, and RocketMQ 2-phase transactional messaging. Executive Summary & Research Baseline Two different Double 11 peak figures circulate widely, and they measure different layers of the stack — conflating them is the most common error in write-ups on this topic: ...

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

Flash Sale Architecture: Rate Limiting & Redis

Flash Sale Architecture: Rate Limiting & Redis Answer-First: High-concurrency flash sale architectures handle millions of concurrent requests (C10M scale) by using kernel bypass networking (DPDK/eBPF), edge rate limiting via atomic Redis Lua token buckets, pre-warmed in-memory inventory decrementing, and asynchronous Kafka queue leveling before persisting to distributed TiDB/MySQL database clusters. Executive Summary & System Design Foundations High-concurrency systems handling millions of concurrent requests (C10M scale) must push load shedding and admission control as close to the network edge as possible. Four design baselines drive the rest of this architecture: ...

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

Generative UI with MCP: Architecting AI-Native Frontends

Generative UI with MCP: Architecting AI-Native Frontends Answer-First: Generative UI with Model Context Protocol (MCP) transitions frontends from text-only chat interfaces to dynamic, interactive UI components. By leveraging React Server Components, Zod runtime schema validation, dynamic component registries, and iframe sandboxing, AI agents safely trigger rich native UI components directly from structured tool call outputs. Executive Summary & Generative UI Architecture Generative UI replaces static text-only chat responses with dynamic, interactive UI components. The core architectural pillars required for production implementation include: ...

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

GraphRAG vs Naive RAG: Enterprise Architecture Guide

GraphRAG vs Naive RAG: Enterprise Architecture Guide Answer-First: Enterprise GraphRAG extends Naive RAG by extracting entities and relationships into a knowledge graph layer alongside vector embeddings. This multi-hop topology retrieval resolves complex domain queries across interconnected documents where isolated vector similarity searches fail, with PostgreSQL WAL streaming CDC maintaining real-time graph synchronization. Schema design for knowledge graphs that speed up global enterprise RAG. Syncing GraphRAG knowledge bases in real-time using PostgreSQL WAL events. 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 · 15 min · Lê Tuấn Anh

Order Fulfillment Algorithm: Warehouse to Last-Mile

Order Fulfillment Algorithm: Warehouse to Last-Mile Answer-First: An e-commerce order fulfillment algorithm selects warehouses and routes last-mile delivery using a 5-step pipeline: Available-to-Promise (ATP) stock checks, cost/proximity scoring, split vs. consolidation trade-offs, anticipatory inventory positioning (e.g. Amazon CONDOR), and Vehicle Routing Problem (VRP) solving with tools like OR-Tools or GraphHopper. Executive Summary & Fulfillment Fundamentals When an order is confirmed, the fulfillment system executes a multi-step decision pipeline to optimize inventory allocation and transit SLA: ...

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 Answer-First: PayPay scales payment infrastructure to 70M+ users and 100k+ peak TPS using a Kubernetes microservices stack backed by TiDB for ACID-compliant ledger storage and Kafka for event sourcing. Reliability is enforced through GitOps workflows, automated chaos engineering fault injection, and asynchronous event decoupling to isolate checkout processes from banking outages. Running chaos engineering scripts in TiDB payment systems. How event sourcing with Kafka isolates PayPay checkout routes from legacy bank outages. 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 · 14 min · Lê Tuấn Anh

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

Real-Time Ride-Hailing Architecture: Matching, Spatial Indexing & Websockets Answer-First: Real-time ride-hailing platforms like Uber and Grab process millions of GPS updates per second using hexagonal spatial partitioning (Uber H3), Kafka stream ingestion, in-memory matching engines (DISCO), dynamic surge pricing algorithms, and persistent push gateways (RAMEN/WebSockets) to complete driver-passenger matching under 3 seconds. Scaling matching engines to millions of geographic updates using H3 indexing. Designing low-latency push notification gateways to dispatch driver routes. 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. ...

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

Microfinance Core Banking: Architecture & Engineering Guide

Microfinance Core Banking: Architecture & Engineering Guide Answer-First: Microfinance core banking requires specialized Joint Liability Group (JLG) group guarantee logic, compulsory savings collateral enforcement, declining-balance EMI calculations, and atomic double-entry ledger transactions written in Go and PostgreSQL to ensure financial audit compliance. Executive Summary & Quick Answer Microfinance core banking platforms demand specialized architectural patterns to manage Joint Liability Group co-guarantees, compulsory savings collateral, and declining-balance interest calculations. Engineering high-concurrency ledger systems in Go and PostgreSQL ensures strict financial audit compliance while maintaining transactional consistency across millions of micro-loans. ...

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

Replace MySQL Sharding with TiDB: Architecture Guide

Replace MySQL Sharding with TiDB: Distributed SQL Architecture Answer-First: Replacing manual MySQL database sharding with TiDB eliminates application-layer query routing and cross-shard JOIN limitations by using an auto-partitioning distributed SQL engine with Raft consensus storage (TiKV), stateless compute nodes, and native Percolator distributed ACID transactions. Migrating schemas to TiDB with zero downtime using DM-portal. How TiKV nodes scale independently of TiDB SQL computation nodes. 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 · 17 min · Lê Tuấn Anh