Part 5: EAV Schema Migration — Magento's Biggest Trap

The EAV schema is why most Magento migrations fail. It looks manageable from the outside: products stored across catalog_product_entity, catalog_product_entity_varchar, catalog_product_entity_int, catalog_product_entity_decimal, catalog_product_entity_datetime, and catalog_product_entity_text. Six tables, straightforward ETL job, done in a weekend. Then you discover that attribute_id = 75 means “product name” in your Magento instance and “color” in your staging instance. Every attribute ID is generated at install time and differs between environments. Any ETL script that hardcodes attribute IDs will produce corrupted data in production. ...

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

MySQL Scalability: Read Replicas, Sharding & TiDB

Answer-first: MySQL scalability is the practical throughput ceiling of your database at each resource level. A single tuned InnoDB instance delivers 100–500 TPS at baseline, scaling to 6,000–10,000+ TPS with connection pooling, read replicas, and optimal hardware. Beyond that, write-scaling requires sharding or a distributed SQL layer. What You’ll Learn That AI Won’t Tell You 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 · 15 min · Lê Tuấn Anh

Vitess vs GORM Sharding: MySQL Write Scaling in Go

Answer-first: Vitess vs GORM Sharding for MySQL write scaling: VReplication zero-downtime vs. application-level sharding — ErrMissingShardingKey tradeoffs in Go. What You’ll Learn That AI Won’t Tell You 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 · 7 min · Lê Tuấn Anh

Shopee Flash Sale Architecture: Rate Limiting & Redis

Answer-first: Architecting flash sale systems requires preventing database overload using multi-stage rate limiting and Redis-based inventory pre-decisions. Traffic shields block duplicate requests, and asynchronous checkout queues decouple order submission from payment processing. What You’ll Learn That AI Won’t Tell You Multi-stage cache invalidation strategies that keep checkout fast. Handling concurrent Redis connections during million-user flash sales. At exactly midnight on 11.11, Shopee users across Southeast Asia and Taiwan simultaneously tap the same button. In the first 10 seconds of a flash sale, a single product page can receive requests from millions of concurrent sessions — all competing to purchase the same 1,000 units of inventory. One oversell, one server crash, or one database deadlock during that window results in a cascade of chargebacks, angry users, and front-page news headlines. ...

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

MySQL Sharding to TiDB: Distributed SQL Migration Guide

Answer-first: Migrate from manual MySQL sharding to TiDB to eliminate application-level routing complexity. TiDB handles distributed SQL queries natively using TiKV storage nodes and Raft consensus. Use the TiDB Data Migration (DM) tool to merge source shards online with minimal downtime. What You’ll Learn That AI Won’t Tell You 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. ...

May 26, 2026 · 15 min · Lê Tuấn Anh