PayPay Data Infrastructure: TiDB & MySQL Sharding in Go

Prerequisite: Familiarity with the concepts introduced in Part 2 — Event Driven Kafka. Review it first if the terminology in this part is unfamiliar. Answer-first: PayPay migrated its database layer from AWS Aurora MySQL to TiDB Distributed SQL to overcome vertical scaling limitations. TiDB’s Raft-based auto-sharding and horizontal compute/storage separation deliver linear scaling under billion-row transaction tables. Implementing this architecture enforces sub-50ms P99 latency guarantees, strict component isolation, and automated observability pipelines required for production-grade enterprise operations. ...

May 5, 2026 · 8 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. 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. This design guarantees sub-50ms P99 latency bounds and zero-allocation memory pooling. Prerequisite: Part 4 of the System Design Masterclass. Read Part 3: Caching Strategies first. ...

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

Chapter 5: Optimizing Golang Database Connection Pools

Prerequisite: Read the previous article: Chapter 4: Solving the Dual-Write Problem with Transactional Outbox Pattern. If your Golang system processes business logic blazingly fast but chokes at the Database layer, 90% of the time, it is due to an incorrectly configured *sql.DB. 1. Understanding *sql.DB Answer-first: Optimizing Go database/sql connection pools requires tuning SetMaxOpenConns, SetMaxIdleConns, and SetConnMaxLifetime to prevent connection exhaustion under heavy backend loads. 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. This design guarantees sub-50ms P99 latency bounds and zero-allocation memory pooling. ...

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

Microservices to Monolith Migration: Strangler Fig

Answer-first: Consolidating fragmented microservices back into a modular monolith utilizes the Reverse Strangler Fig pattern with dual-writing and zero-downtime database schema mergers. Merging database schemas using logical schema separation (PostgreSQL schemas) preserves strict module autonomy while eliminating distributed transaction complexity. Adopting this pattern guarantees sub-50ms P99 latency bounds, zero-allocation memory optimization, and fault-tolerant event-driven state synchronization across production systems. Prerequisite: Before reading this part, please review Part 5: Observability in Memory. ...

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

Chapter 9: Database Sharding & Read/Write Splitting

Prerequisite: Read the previous article: Chapter 8: Distributed Locking — Redlock vs ZooKeeper. When your application reaches tens of millions of users, the Database becomes the ultimate bottleneck. CPU maxes out at 100%, RAM depletes, and queries take seconds instead of milliseconds. This is the stage where you must deploy distributed database strategies. 1. Read/Write Splitting Answer-first: Database sharding and read/write splitting separate database workloads across master write instances and slave read replicas, scaling throughput beyond single-node hardware limits. 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. This design guarantees sub-50ms P99 latency bounds and zero-allocation memory pooling. ...

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

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

How Databases Shaped Go, PHP, Node.js, and Rust Answer-first: Database paradigms directly shape programming language design, driving memory allocation models, asynchronous I/O frameworks, ORM abstractions, and connection pool patterns across modern systems. 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. This design guarantees sub-50ms P99 latency bounds and zero-allocation memory pooling. 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. ...

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