Saga Pattern in Go — Temporal, Outbox Pattern & Debezium

Prerequisite: Part 8 of the System Design Masterclass. Read Part 7: Idempotent API Design first — compensating transactions in Saga must be idempotent. Answer-first: The Saga Pattern coordinates distributed transactions across microservices by decomposing a large transaction into a sequence of local transactions. If any step fails, the system automatically executes compensating transactions in reverse order to undo completed steps. Each local transaction must be idempotent. What Are the Problems with 2PC in Microservices? Answer-first: Two-Phase Commit (2PC) is a blocking protocol with a coordinator single point of failure. If the coordinator crashes between the Prepare and Commit phases, all participants are blocked indefinitely with locks held — a catastrophic failure mode in microservices. These are the same core banking distributed transaction challenges seen in legacy systems. ...

June 18, 2026 · 8 min · Tanh

Real-Time Inventory Synchronization: Kafka, CDC & Redis for E-commerce

What Is Real-Time Inventory Synchronization? Real-time inventory synchronization is the process of propagating stock count changes from the system of record (database) to all sales channels — web storefront, mobile app, WMS, ERP — in sub-second time. Instead of batch ETL jobs that run every hour, a CDC + Kafka pipeline streams every committed stock change as an event, eliminating overselling and stale stock displays. Handling this during a flash sale — where thousands of users attempt to purchase a highly contested SKU simultaneously — is a pinnacle architectural challenge. Traditional synchronous database updates collapse under lock contention. ...

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

Zero-Downtime: Moving from Magento to Microservices

Answer-first: Battlefield-tested guide on dismantling a monolithic Magento e-commerce platform and migrating to 10+ microservices without losing a single order. “Let’s rewrite everything to Microservices.” This sentence usually precedes multimillion-dollar engineering failures. When a legacy application like a massive Magento e-commerce store is holding up the financial weight of a company, executing a “Big Bang” cutover is practically suicidal. Instead of burning the old house down before the new one is built, we employed a meticulous 3-Phase Strangler Fig Pattern. We allowed our new distributed microservice ecosystem to gradually wrap around the old Magento monolith, intercepting its traffic piece by piece until the legacy server became a hollow shell. ...

April 14, 2026 · 7 min · Lê Tuấn Anh