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 dive into how database constraints drove the evolution of PHP, Node.js, Rust, and Go. Database constraints—such as connection limits, memory models, and transaction safety—have fundamentally shaped modern backend languages. Share-nothing models (PHP) require external poolers, single-threaded event loops (Node.js) rely on async/await, while languages with intrinsic thread pools and strict memory safety (Go, Rust) leverage code-generated static ORMs to achieve horizontal scalability and memory efficiency. ...

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

Part 6: Migration Playbook – Consolidating Microservices

Answer-first: Decommissioning microservices and returning to a Modular Monolith requires a structured Reverse Strangler Fig migration playbook. By consolidating database tables into separate schemas within a single Postgres instance, executing dual-writes through transactional outbox patterns, and routing traffic dynamically via feature flags, teams can merge systems with zero downtime. Prerequisite: Before reading this part, please ensure you have read the previous article in this series: Part 5: Observability in Memory – When Everything Shares a Single Call Stack. ...

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

Database Sharding in Go — TiDB, PostgreSQL & Connection Pools

Answer-first: Database sharding distributes data horizontally across independent partitions (shards) based on a shard key, reducing write contention and enabling linear storage growth. Choosing the wrong shard key leads to hot spots that can be worse than no sharding at all. Prerequisite: Part 4 of the System Design Masterclass. Read Part 3: Caching Strategies to understand the cache layer before examining storage. What You’ll Learn That AI Won’t Tell You PostgreSQL Connection Memory Math: Why each PostgreSQL connection eats 5–10MB of server RAM, and why a naive database/sql pool configuration crashes databases. TiDB Percolator Failures: The exact edge cases where primary lock failures leave secondary locks orphaned, and how TiDB’s async lock resolver cleans them up. LSM-Tree Write Amplification: The performance penalty of Cassandra/TiKV compaction cycles on SSD disk lifespan. Vertical vs Horizontal Scaling — When to Switch? Key Concept: Vertical scaling (scale-up) increases resources on a single server — simple but has a hard physical ceiling and non-linear cost growth. Horizontal scaling (scale-out) adds more servers — no theoretical ceiling, linear cost, but significantly higher operational complexity. ...

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

Chapter 9: Database Sharding & Read/Write Splitting

Prerequisite: Before reading this chapter, please ensure you have read the previous article in this series: 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 Because 80% of traffic is Read-only, separate your DB into a Write Master and Read Slaves. Use GORM’s dbresolver plugin to route queries automatically without altering business logic. ...

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

Chapter 5: Optimizing Golang Database Connection Pools

Prerequisite: Before reading this chapter, please ensure you have read the previous article in this series: 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 In Golang, sql.Open() does NOT create a direct database connection. It instantiates a thread-safe Connection Pool manager. You must initialize the db variable only once during app startup. ...

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