Magento EAV Schema Migration & UUID Identity Mapping

Prerequisite: Familiarity with the concepts introduced in Part 4 — Grpc Rest Gateway. Review it first if the terminology in this part is unfamiliar. 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 · 12 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

Part 4: MariaDB vs. MySQL: Storage Engines & Thread Pool Showdown

← Previous Chapter: Part 3 — Primary Key Showdown: UUIDv7 vs. Snowflake | Series Hub | Next Chapter: Part 5 — Sharded MySQL vs. TiDB NewSQL → Part 4: MariaDB vs. MySQL: Storage Engines & Thread Pool Showdown Answer-first: MariaDB is no longer a drop-in replacement for MySQL. MySQL 8.4/9.0 dominates Cloud-Native ecosystems (AWS Aurora) with InnoDB tuning, binary JSONB O(1) updates, and Vector AI. Conversely, MariaDB 11.x excels on Bare-Metal/Kubernetes via native ThreadPool (50k+ conns), Galera 4 zero-lag multi-master, and MyRocks LSM storage compressing disk by 70%. ...

August 18, 2026 · 8 min · Lê Tuấn Anh

Shopee DB: MySQL Sharding to TiDB NewSQL Migration

Answer-first: Shopee scales its relational database layer past single-node MySQL limits by migrating to TiDB Distributed SQL. By separating stateless SQL compute (TiDB) from stateful key-value storage (TiKV) and columnar analytics (TiFlash), TiDB delivers transparent horizontal auto-sharding and ACID transactions without application-level sharding logic. Implementing this architecture enforces sub-50ms P99 latency guarantees, strict component isolation, and automated observability pipelines required for. Chapter 4: Database Scale - The Rise of TiDB and NewSQL ← Series hub | ← Prev | Next → ...

May 5, 2026 · 8 min · Lê Tuấn Anh

Part 5: Sharded MySQL (Vitess) vs. TiDB NewSQL Showdown

← Previous Chapter: Part 4 — MariaDB vs. MySQL | Series Hub Part 5: Sharded MySQL (Vitess) vs. TiDB NewSQL: Distributed ACID, Scale-Out Limits & Latency Penalties Answer-first: Sharded MySQL (Vitess) delivers unmatched sub-2ms write latency and isolated failure blast radius for clean single-shard workloads (tenant_id/user_id). Conversely, TiDB NewSQL is the definitive architecture for unpartitionable relational schemas and cross-shard queries via zero-touch 96MB Region auto-splits, trading off an 8–15ms write latency floor due to Google Percolator 2PC and Raft consensus hops. ...

August 21, 2026 · 8 min · Lê Tuấn Anh

Upgrading Magento 2.4.5 to 2.4.8: Defusing the Tech Debt Time Bomb Before AWS MySQL 8.0 EOL

Upgrading Magento 2.4.5 to 2.4.8: Defusing the Tech Debt Time Bomb Before AWS MySQL 8.0 EOL Answer-first: Do not treat the jump from Magento 2.4.5 to 2.4.8 as a routine software patch. In reality, it is a comprehensive infrastructure migration (a Leapfrog strategy) that must be executed before July 31, 2026—the exact date AWS RDS drops standard support for MySQL 8.0. This article breaks down the 6 fatal architectural breaking changes (PHP 8.4, OpenSearch 2.19, Uppy) and outlines a Zero-Downtime Blue/Green Deployment strategy. ...

August 12, 2026 · 7 min · Lê Tuấn Anh

MySQL Scalability & Sharding: Vitess vs TiDB (10k+ TPS)

MySQL Scalability & Sharding: Vitess vs TiDB (10k+ TPS) Answer-first: Scaling MySQL for high-traffic applications involves a phased progression: tuning InnoDB buffer pools and slow queries (0–500 TPS), offloading reads via ProxySQL and read replicas (500–3,000 TPS), and adopting horizontal write scaling (3,000+ TPS) via Vitess sharding or TiDB Distributed SQL to maintain sub-50ms P99 query latencies. 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 · 16 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: Horizontal MySQL write scaling uses Vitess proxy sharding or application-level GORM shard key routing to distribute table data across independent database master instances. While Vitess provides transparent VTGate query routing and zero-downtime resharding for large teams, GORM Sharding offers a lightweight Go-native AST-parsing solution for single-service architectures. 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

Flash Sale Architecture: Rate Limiting & Redis

Flash Sale Architecture: Rate Limiting & Redis Answer-first: Shopee flash sale architecture handles millions of concurrent requests using Redis Lua token buckets, local memory caches, queue-based order throttling, and optimistic DB updates. 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. [!NOTE] On sourcing: This article describes flash-sale architecture patterns for C10M-scale events; it is not a disclosure of Shopee’s internal systems, and the figures here are engineering targets rather than published Shopee metrics. Shopee has not publicly documented its flash-sale internals in detail. What is public is its database platform choice — Shopee’s adoption of TiDB is documented in PingCAP’s case studies (How Shopee Chose the Right Database, Shopping on Shopee, the TiDB Way). Treat everything else as a reference pattern to validate against your own workload. ...

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

MySQL Sharding Alternatives: Vitess vs TiDB Guide

MySQL Sharding Alternatives: Vitess vs TiDB Guide Answer-first: TiDB is the leading open-source MySQL sharding alternative, replacing fragile application-level sharding logic (Vitess, GORM Sharding) with an auto-partitioned Distributed SQL architecture. By distributing 96MB Raft Regions across TiKV storage nodes and utilizing the Percolator distributed transaction protocol, TiDB delivers horizontal write scaling, cross-node ACID transactions, and zero-downtime online DDL while maintaining 100% MySQL wire compatibility. 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 · 16 min · Lê Tuấn Anh