Mastering Event-Driven Architecture with Dapr Pub/Sub

Answer-first: Build resilient event-driven microservices by using Dapr’s Pub/Sub APIs to decouple message transport. Ensuring eventual consistency requires implementing the Transactional Outbox pattern on writes, utilizing dead-letter queues (DLQs) for failed runs, and designing idempotent message handlers. What You’ll Learn That AI Won’t Tell You How to configure dead-letter queues in Dapr to handle poison messages. Designing idempotent message handlers that process duplicate events safely. In my previous post, we explored how abandoning monolithic architecture in favor of strict Domain-Driven Design (DDD) bounded contexts allowed an e-commerce platform to scale beyond 10,000+ orders per day. However, splitting one big database into 20+ isolated Postgres databases introduces a terrifying new problem: How do we maintain data consistency across disconnected services? ...

April 12, 2026 · 17 min · Lê Tuấn Anh

Deconstructing the Ecosystem: Service Details by Domain

Answer-first: We partition the e-commerce domain into six logical business domains—Identity, Catalog, Cart, Checkout, Order, and Fulfillment—containing 21 isolated services. Each service owns its database exclusively, communicating asynchronously via event brokers to ensure scalability and prevent tight coupling. What You’ll Learn That AI Won’t Tell You Why microservices must own their schema migrations (via Golang-Migrate) independently, and the specific event schemas that prevent transactional coupling. Real-world database deadlocks encountered when segregating order history from the catalog database, and how they were solved using CQRS. “Why 21 services? Isn’t that overkill?” ...

April 12, 2026 · 10 min · Lê Tuấn Anh