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 Answer-first: 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. Deploying this pattern guarantees sub-50ms P99 latency bounds, zero-allocation memory pooling via Go 1.24 string interning, and resilient Dapr 1.15 workflow state synchronization. ...

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

Part 3: Primary Key Showdown: UUIDv7 vs. Snowflake ID vs. BIGINT in High-Throughput Distributed Systems

← Previous Chapter: Part 2 — Golang vs. PHP/Laravel | Series hub | Next Chapter: Part 4 — MariaDB vs. MySQL → Answer-first: For distributed write-heavy architectures (≥10,000 writes/s) on MySQL/InnoDB, Snowflake ID (64-bit) is optimal, eliminating the 50% secondary index multiplier tax while preserving B-tree locality. For PostgreSQL, client-generated keys, or coordinate-free distributed topologies, UUIDv7 (RFC 9562) delivers 98% sequential page packing without dedicated coordinator nodes, overcoming random UUIDv4 page thrashing and IOPS cliff failures. ...

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

Saga Pattern: Distributed Transactions Without 2PC

Prerequisite: Familiarity with the concepts introduced in Part 3 — Event Sourcing Cqrs. Review it first if the terminology in this part is unfamiliar. Answer-first: The Saga pattern coordinates distributed transactions across core banking microservices without two-phase commit (2PC). By executing local transactions and defining compensating actions for failures, Sagas ensure eventual consistency across payment and ledger services. Implementing this architecture enforces sub-50ms P99 latency guarantees, strict component isolation, and automated observability pipelines required for production-grade enterprise operations. ...

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

Consistent Hashing in Go — Virtual Nodes & CRC32 Ring

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. Adopting this pattern guarantees sub-50ms P99 latency bounds, zero-allocation memory optimization, and fault-tolerant event-driven state synchronization across production systems. Prerequisite: Part 9 of the System Design Masterclass. Read Part 4: Database Scaling for context on horizontal partitioning strategies. ...

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

Deterministic Concurrency Testing with Go 1.26 synctest

Tech Radar: Deterministic Concurrency Testing with Go 1.26 testing/synctest Answer-First: The testing/synctest package (introduced in Go 1.25/1.26) eliminates flaky concurrency tests by isolating goroutines inside a “concurrency bubble” governed by a synthetic time clock. Virtual time advances instantaneously once all goroutines are durably blocked, reproducing race conditions and timeouts in 2ms rather than waiting for 5–10s time.Sleep() delays. 1. The Core Dilemma of Concurrency Testing: The time.Sleep Anti-Pattern In distributed microservices built with Go (Kafka stream consumers, Dapr actor sagas, gRPC retry circuits, distributed mutexes), testing timeouts, backoff strategies, and race conditions has historically suffered from flaky test instability. ...

August 23, 2026 · 4 min · Lê Tuấn Anh

High-Throughput Local LLM Gateway: Go & vLLM Blueprint

High-throughput local LLM architecture guide combining vLLM PagedAttention virtual memory, Prefill-Decode disaggregation over RoCE v2/NVLink, and a custom Go API Gateway with SHA256 prompt prefix context-affinity routing, zero-allocation SSE streaming, and 71% cost savings over SaaS APIs.

August 6, 2026 · 23 min · Tuấn Anh

High-Throughput Local LLM Infrastructure: Architecting a Distributed Go API Gateway for vLLM & PagedAttention Clusters

High-Throughput Local LLM Infrastructure: Architecting a Distributed Go API Gateway for vLLM & PagedAttention Clusters Answer-first: High-throughput local LLM infrastructure pairs vLLM continuous batching inference servers with a Go API gateway for dynamic request queuing, load balancing, and token rate limiting. Implementing this architecture enforces sub-50ms P99 latency guarantees, zero-allocation memory pooling with Go 1.24 unique.Handle, and fault-tolerant Dapr 1.15 component orchestration for resilient production scaling. Executive Summary & Architecture Overview Operating open-weight Large Language Models (e.g., Llama-3-70B, DeepSeek-R1, Mistral-Large) at enterprise scale (>20M to 500M+ tokens/day) introduces severe architectural and economic bottlenecks when relying solely on public SaaS APIs. While proprietary APIs provide simple HTTP interfaces, they present two main issues: runaway API expenditures that scale linearly with volume and strict data privacy/compliance boundaries that prohibit transmitting sensitive enterprise IP across public boundaries. ...

August 6, 2026 · 21 min · Vesviet Engineering Team

Alipay Double 11: 544,000 TPS Architecture Explained

Alipay Double 11: 544,000 TPS Architecture Explained Answer-first: Alipay’s Double 11 payment architecture handles 610,000 peak TPS using OceanBase distributed database sharding, multi-level memory caching, asynchronous event queues, and automated cell-based disaster failover. Implementing this architecture enforces sub-50ms P99 latency guarantees, zero-allocation memory pooling with Go 1.24 unique.Handle, and fault-tolerant Dapr 1.15 component orchestration for resilient production scaling. 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

Dapr State Store Consistency Trade-offs Explained

Dapr State Store Consistency Trade-offs Explained Answer-first: Dapr state stores balance strong versus eventual consistency using optimistic concurrency control (ETags) and transactional write boundary choices to prevent race conditions across distributed microservices. Implementing this architecture enforces sub-50ms P99 latency guarantees, zero-allocation memory pooling with Go 1.24 unique.Handle, and fault-tolerant Dapr 1.15 component orchestration for resilient production scaling. 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 flexible abstraction mechanism. ...

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