This article details ten core microservices design patterns — including Database per Service, Event Sourcing, CQRS, Saga, BFF, API Gateway, Strangler, Circuit Breaker, Externalized Configuration, and Consumer-Driven Contract Testing — with pros, cons, use cases, and technology examples for each.
The article explains CQRS as domain model separation rather than database read/write splitting, detailing command/query model boundaries, event-driven synchronization challenges, consistency trade-offs, engineering pitfalls like event reliability and view explosion, when to avoid CQRS, and a reference e-commerce order implementation with consistency-based query routing.
This article explains why financial systems adopt Event Sourcing over traditional CRUD, detailing commands, events, state, FIFO queues, deterministic automata, snapshots, and CQRS to achieve fully auditable, replayable state at any point in time.
This article explores architectural decomposition for a cement industrial platform, distinguishing business, code, and deployment boundaries, advocating modular monoliths over premature microservices, and detailing domain-driven design, bounded contexts, transaction boundaries, CQRS, and a practical migration strategy with evaluation criteria.
Bounded Contextarchitecture decision recordcement industry
This article explains how event sourcing replaces the traditional current‑state table with an immutable event log, allowing systems to reconstruct any state, handle concurrency, support auditing, and power flexible read models through projections, while outlining the necessary architectural components such as aggregates, event stores, snapshots, outbox, idempotency, and the natural transition to CQRS.
The article explains how sharing the full User model inside the Order aggregate creates hidden coupling that blows up microservice performance, and shows a step‑by‑step DDD bounded‑context refactor with event‑storming, outbox, saga, idempotency and CQRS using Java 21, Spring Boot 3.x, MySQL and Kafka.
This article breaks down seven practical software‑architecture patterns—Bounded Context, Sidecar, Publisher‑Subscriber, Application Gateway, Microservices, Micro‑frontends, and CQRS/Event Sourcing—showing how they can be combined in a real e‑commerce system and guiding architects on when each pattern best solves complexity, performance, or team‑collaboration challenges.
The article explains why solid architecture matters for Java projects, outlines seven mainstream architectural patterns—including layered, DDD, hexagonal, clean, CQRS, event‑driven, and microkernel—and provides a decision guide to help teams choose the most suitable approach based on complexity, experience, performance, and evolution needs.
This article explains how CQRS splits write operations that enforce business rules using domain models from read operations optimized for page performance, illustrates common pitfalls of mixing the two, and provides concrete Java code, SQL examples, migration steps, validation checklists, and best‑practice guidelines for implementing lightweight CQRS in a DDD‑based backend.
This guide details implementing CQRS and Event Sourcing in Spring Boot, covering command/query separation, event bus choices (Outbox pattern, Kafka), projection idempotency, state snapshots for performance, Saga-based compensation for distributed transactions, and practical tuning tips for production workloads.
The article walks through a real‑world payroll system, showing how to evolve from simple interface separation to full event‑driven read‑model synchronization using CQRS, explaining when to adopt each stage, the trade‑offs, code examples, and common anti‑patterns.
The article explains how a Repository differs from a DAO by focusing on aggregates instead of tables, shows proper interface design, PO‑to‑aggregate mapping, read/write separation, CQRS basics, and JPA pitfalls, providing concrete Java code examples for Spring Boot projects.
The article examines how software architecture has progressed from the traditional DDD four‑layer structure through Hexagonal, Onion, and Clean architectures, explaining essential versus accidental complexity, layering principles, dependency inversion, and how each pattern refines modularity, testability, and dependency direction.
The article analyzes whether endorsement (policy changes) and policy management should reside in a single microservice or be split into two, weighing data consistency, cohesion, operational simplicity, scaling, deployment independence, fault isolation, team size, and compliance, and provides a concrete decision framework and split strategy.
The article explains how Event Sourcing stores immutable, ordered events instead of the current state, details aggregate rehydration, snapshots, and projections, clarifies its orthogonal relationship with CQRS and DDD, and debunks four common misconceptions about the pattern.
The article explains that CQRS originates from CQS, separates command and query responsibilities, clarifies its relationship with Event Sourcing and DDD, debunks four common misconceptions, and shows how it trades complexity for freedom when write and read optimizations conflict.
The article compares the classic Event Sourcing + CQRS architecture with the more engineering‑focused read‑write separation CQRS, outlining their workflows, advantages, drawbacks, and guiding criteria for selecting the appropriate design in real‑world projects.
This article explores microservices architecture beyond basic decomposition, covering decoupling principles, service boundary identification, governance pillars (observability, traffic control), distributed transaction patterns, data management strategies, API design best practices, infrastructure choices (Kubernetes, Service Mesh), organizational alignment via Conway's Law, and when to avoid microservices.
The article explains how traditional synchronous microservice calls create tight coupling, cascading failures, scaling bottlenecks, and high latency, and demonstrates that adopting an event‑driven architecture with producers, consumers, and a message broker such as Kafka can fully decouple services, improve scalability, and enable patterns like event sourcing and CQRS.
Alibaba’s Java Development Manual mandates that any SQL involving more than three tables must be avoided, a rule that stems from the exponential cost of multi‑table joins in a single‑instance database, prompting engineers to rethink data modeling, adopt denormalization, wide tables, materialized views, CQRS or application‑level assembly instead of relying on complex joins.
The author recounts three years of applying Domain‑Driven Design to a microservice ecosystem, sharing concrete pitfalls, code‑first modeling from database tables, and a structured 24‑article series that guides developers to refactor existing Spring Boot + MyBatis Plus projects without rewriting the framework.
Learn how to break the cycle of unreadable, tangled code by applying Domain-Driven Design and Command-Query Responsibility Segregation, with concrete examples, step-by-step refactoring, architecture diagrams, code snippets, and practical tips for gradually adopting these patterns in real-world backend projects.
This guide shows how to break down tangled Java services using Domain‑Driven Design and Command‑Query Responsibility Segregation, providing concrete terminology, layered diagrams, code examples, and step‑by‑step migration strategies to improve maintainability, performance, and team communication.
The article shares the author's practical frustrations with Domain‑Driven Design—covering confusing CQRS classifications, ambiguous aggregate‑root boundaries, performance conflicts, and the high time cost—while offering concrete examples, code snippets, and a candid conclusion that DDD should be applied judiciously rather than dogmatically.
This article explains why overly fine‑grained service splitting hurts performance and debugging, shows best‑practice granularity aligned with team size, introduces evolutionary splitting based on model responsibilities, and walks through real‑world case studies, domain‑driven design concepts, architectural patterns such as hexagonal, CQRS, and event‑driven designs, and practical steps for building a robust service‑oriented system.
This article explains the CQRS architectural pattern, its benefits and pitfalls, and provides a step‑by‑step guide to implementing CQRS with Spring Boot, Axon, and Kafka, including command and query handling, event sourcing, and practical considerations for microservice architectures.
This article explains the CQRS pattern, its origins, benefits, and challenges, and provides a step‑by‑step guide with Java code examples on how to implement CQRS, event sourcing, and asynchronous communication using Spring Boot, Axon, and Kafka in microservice architectures.
The article explains how Domain‑Driven Design combined with microservice architecture can restructure a monolithic transaction system by defining bounded contexts, applying patterns such as layered architecture, CQRS and event‑driven communication, and refactoring domains to improve maintainability, scalability, and business clarity.
This article compares API composition and CQRS patterns for handling distributed queries in evolving monolithic systems, illustrating their workflows with e‑commerce and online‑education examples, discussing performance trade‑offs, implementation details using Canal and ElasticSearch, and offering practical guidance on when to adopt each approach.
This article explains the fundamentals of Event‑Driven Architecture, covering its core components, design principles such as event granularity and immutability, practical implementation steps, common use cases, and the challenges developers face when building loosely coupled, high‑response distributed systems.
This article explains how to choose between fine‑grained and coarse‑grained resource designs in REST APIs, illustrating trade‑offs with blog‑post examples, showing how to model business processes as intent resources, and discussing the impact of avoiding PUT in favor of CQRS.
This article explains the essential conditions, metrics, and scenario classifications for building high‑concurrency systems, then details common solutions such as database read/write separation, local and distributed caching, cache‑eviction policies, handling master‑slave lag, preventing cache penetration and avalanche, and applying CQRS to achieve scalable, high‑performance back‑end services.
This article explains the essential elements of high‑concurrency system design—performance, availability, scalability—introduces quantitative metrics, classifies read‑heavy and write‑heavy scenarios, and details practical solutions such as database read/write separation, local and distributed caching, cache‑penetration and avalanche mitigation, and CQRS implementation for billion‑user applications.
This article explains how to lower the learning curve of DDD and CQRS by using structured, standardized, and templated approaches, introduces a Maven archetype for rapid project scaffolding, and demonstrates an IntelliJ IDEA plugin that auto‑generates boilerplate code for aggregate roots, commands, queries, and related components.
This article explains how applying CQRS and layered splitting—separating commands and queries across service, model, repository, and data layers—can dramatically lower system complexity, improve performance, and resolve common conflicts in high‑traffic backend applications.
This article outlines why databases become slow, introduces a four‑layer optimization framework, and presents eight practical solutions—including data reduction, archiving, sharding, caching, and read‑replica strategies—to help engineers systematically diagnose and resolve the majority of performance bottlenecks.
Understanding an application's architecture—defining clear module and package hierarchies, adopting layered patterns like Hexagonal or Clean Architecture, and applying principles such as Dependency Inversion and CQRS—transforms chaotic codebases into maintainable, testable systems that reduce onboarding time and simplify future development.
This article outlines eight comprehensive database optimization approaches—reducing data volume, using space for performance, selecting appropriate storage systems, and related techniques such as data archiving, intermediate tables, serialization, sharding, distributed caching, read‑write splitting, and CQRS—to help backend engineers systematically address common performance bottlenecks.
This article explains the CQRS pattern, its origins, benefits, and pitfalls, then details how to implement CQRS and event sourcing in Spring‑based microservices using Axon and Kafka, while discussing architectural considerations, scalability, consistency, and tooling.
This article explains the CQRS architectural pattern, its benefits and challenges, and provides a step‑by‑step guide to implementing CQRS, event sourcing, and asynchronous communication with Spring Boot, Axon, and Apache Kafka in microservice environments.
This article walks through the evolution of a video‑like service from a simple database‑centric design to a robust, CQRS‑based, Kafka‑driven asynchronous architecture that tackles CPU bottlenecks, connection limits, duplicate consumption, scaling, flow‑control, hotspot isolation, error retry, and MQ failure while providing a unified messaging platform.
The live‑streaming room service was re‑architected using CQRS, dividing read‑heavy viewer functions from write‑intensive broadcaster operations, splitting the monolith into focused Go micro‑services, adding multi‑level caching, event‑driven sync, extensive observability, and automated incident‑response to achieve massive scalability and rapid fault recovery.
This article explains the CQRS and Mediator patterns, compares CQRS to CRUD, discusses trade‑offs, and provides a step‑by‑step guide to configuring MediatR in an ASP.NET Core Web API, creating commands, queries, handlers, and testing the setup with Postman.
Bilibili’s railgun platform transforms its high‑traffic like service into a scalable, fault‑tolerant system by moving writes to an asynchronous, Kafka‑driven pipeline, applying CQRS, partitioned processing, idempotency, hot‑key isolation, rate‑limiting, and unified SDKs, dramatically reducing database load and achieving ten‑fold throughput gains.
This article provides a comprehensive overview of microservice architecture, detailing its core concepts, key characteristics, benefits and drawbacks, and presents ten essential design patterns—including database per service, event sourcing, CQRS, Saga, BFF, API gateway, Strangler, circuit breaker, externalized configuration, and consumer‑driven contract testing—along with their pros, cons, usage scenarios, and technology examples.
This article explains the core concepts of Domain‑Driven Design, distinguishes its strategic and tactical patterns, and shows how Redux implements similar ideas such as queries, commands, domain events, and aggregates, while also discussing event sourcing, CQRS, and code examples for decoupling.
This article guides readers through the evolution from monolithic to event‑driven microservice architectures, covering design patterns, scalability, reliability, communication strategies such as API gateways, BFF, service aggregation, asynchronous messaging, CQRS, event sourcing, and technology choices like Kafka and RabbitMQ to build highly available, scalable, and maintainable systems.
This article walks through the essential concepts of Domain‑Driven Design, detailing a layered architecture, practical code organization, integration techniques such as Open Host Service and Anticorruption Layers, and a concise introduction to CQRS for handling complex queries efficiently.
This article explains how the author applied Domain‑Driven Design to build a microservice for an internal trading center, reviewing DDD strategic and tactical design, various architecture layer theories, a customized layered architecture, Maven module structure, and detailed responsibilities of each layer while sharing practical tips and challenges.
Event sourcing models state changes as immutable logs, and when combined with CQRS and Kafka Streams, it enables scalable, fault‑tolerant architectures where write and read paths are decoupled, supporting local or external state stores, interactive queries, and zero‑downtime upgrades.
This article explains that an engineer's primary responsibility is to solve business problems, explores the challenges across a product's lifecycle, outlines software complexity dimensions, and demonstrates how Domain‑Driven Design, strategic and tactical patterns, and modern architectural styles like Hexagonal and CQRS can effectively manage that complexity.
This article explains how event sourcing models state changes as immutable logs, discusses the trade‑offs of the pattern, and shows how Apache Kafka and Kafka Streams enable CQRS and interactive queries for building scalable, resilient backend applications.
This article walks through the author’s two‑year experience applying Domain‑Driven Design to payment, settlement and fund services, explains strategic vs tactical design, compares classic DDD layers, Clean, Hexagonal and Diamond architectures, details module organization, CQRS, and shares practical pros, cons and implementation tips.
This article provides an in-depth analysis of Remesh, a frontend framework implementing Domain-Driven Design (DDD) principles, exploring its core concepts, advantages, and practical implementation.
This article explains the concept of software architecture, compares monolithic and distributed styles, and walks through a real‑world inventory system migration—including design principles, pros and cons, code refactoring, CQRS adoption, and distributed transaction handling.
This article outlines eight comprehensive database optimization techniques—including reducing data volume, using space‑for‑performance methods, and selecting appropriate storage systems—explaining their underlying principles, trade‑offs, and practical implementation steps for backend engineers facing slow queries and high load.
This article explains how a WeChat team used Domain‑Driven Design to improve the maintainability, scalability, and stability of a fast‑paced, multi‑team e‑commerce project, covering strategic and tactical modeling, layered architecture, subdomains, bounded contexts, anti‑corruption layers, domain events, aggregates, repositories, and a practical code scaffold with C++ examples.
The article explains how a WeChat e‑commerce team adopted Domain‑Driven Design, reorganizing a fast‑paced, multi‑team project into a four‑layer onion architecture with strategic sub‑domains, bounded contexts, anti‑corruption layers, domain events, aggregates, repositories and services, to achieve maintainability, extensibility, cohesion and loose coupling.
This article explains the concepts of software architecture, compares monolithic and distributed styles, and walks through a real‑world inventory system migration—including functional and business splitting, CQRS adoption, and distributed transaction challenges—illustrated with Java code examples.
This article explains what software architecture is, why choosing an architectural style matters, compares monolithic and distributed approaches using a real‑world inventory system case study, and details the step‑by‑step functional and business splitting, CQRS implementation, code refactoring, and handling of distributed transactions.
This article explains the concept of software architecture, why it is essential, the responsibilities of architects, various architectural classifications, and introduces classic patterns such as layered, CQRS, hexagonal, onion, and the open‑source COLA framework with its design, extension, and specification guidelines.
This article walks you through the complete journey from a simple monolithic e‑commerce application to a highly scalable, low‑latency, event‑driven microservices system, covering design patterns, principles, communication strategies, data management techniques, and technology choices.
Facing rapid growth and stability issues, the team transformed a monolithic inventory platform into a distributed microservice architecture, employing functional and business decomposition, CQRS principles, and careful code refactoring to improve availability, scalability, and maintainability while addressing challenges like distributed transactions and data consistency.
This article explains microservice architecture, outlines its key characteristics, advantages and disadvantages, and presents ten essential design patterns—including database per service, event sourcing, CQRS, saga, BFF, API gateway, strangler, circuit breaker, externalized configuration, and consumer‑driven contract testing—along with their pros, cons, appropriate scenarios, and technology examples.
This article walks through the progressive evolution of a software system—from a traditional monolithic architecture to a task‑oriented monolith, then to Command‑Query Separation (CQS) and finally to a full CQRS solution—explaining the motivations, trade‑offs, and techniques such as eventual consistency, event sourcing, and read‑model generation.
This article walks through the evolution from a traditional monolithic architecture to a CQRS‑based design, explaining the motivations, trade‑offs, and concrete techniques such as read‑write separation, message‑driven commands, eventual consistency, and event sourcing for building more scalable and maintainable systems.
This article walks through the evolution of software design from a traditional monolithic API server to a CQRS-based architecture, highlighting the drawbacks of the anemic CRUD model, the benefits of read/write separation, domain messaging, eventual consistency, and practical implementation considerations.
This article presents a systematic guide for backend engineers on diagnosing why databases become slow and offers eight practical optimization solutions—including data reduction, space‑for‑performance techniques, and appropriate storage system choices—organized by the layer of the stack they target.
This article provides a comprehensive overview of common microservice patterns and design principles, covering goals such as cost reduction, faster releases, resilience, visibility, and detailing decomposition, integration, database, CQRS, observability, health‑check, and deployment strategies for building robust backend systems.
This comprehensive guide explains how to transform a small e‑commerce monolith into a highly scalable, low‑latency, fault‑tolerant event‑driven microservice system by applying layered architecture, SOA, design patterns, API‑gateway strategies, CQRS, event sourcing, and appropriate cloud‑native technologies.
This article presents a systematic overview of eight practical database optimization techniques—including data reduction, serialization, archiving, intermediate tables, sharding, distributed caching, master‑slave replication, and appropriate storage selection—to help backend engineers diagnose and resolve the majority of performance bottlenecks caused by data volume, high load, and search complexity.
This article explains why databases become slow, introduces a four‑layer thinking model, and presents eight practical solutions—including reducing data volume, leveraging space for performance, and selecting the right storage system—to help backend engineers resolve 80‑90% of common performance problems.
This article outlines a systematic approach for backend engineers to identify root causes of database slowness and presents eight concrete optimization techniques—ranging from data reduction and space‑for‑performance trade‑offs to appropriate storage system selection—while explaining when each method is most effective and what trade‑offs to consider.
This article explains why databases become slow, introduces a four‑layer thinking model, and presents eight practical optimization techniques—including data reduction, caching, sharding, master‑slave replication, and CQRS—along with their benefits, drawbacks, and suitable scenarios.
This article guides readers through the evolution from a monolithic e‑commerce application to a highly available, scalable, low‑latency event‑driven microservices architecture, covering design patterns, principles, API gateway, BFF, service aggregation, CQRS, event sourcing, and technology stack choices such as Kafka and Cassandra.
This comprehensive guide teaches how to design scalable, highly available microservice architectures by applying design patterns, principles, and best practices, covering the evolution from monolithic to event‑driven systems, communication strategies, data management techniques, and technology choices such as API gateways, BFF, CQRS, and Kafka.
This article details Qunar's high‑concurrency flight pricing architecture, covering the origin of pricing data, two‑level caching design, a cache‑management system, CQRS‑based policy storage, data compression techniques, and performance improvements achieved through these optimizations.
This article explains Clean Architecture, shows how Domain‑Driven Design fits into its concentric‑layer model, and demonstrates how adding Command‑Query Responsibility Segregation (CQRS) enhances scalability, testability, and maintainability while outlining practical implementation steps, benefits, and trade‑offs.
This article explains the fundamentals of event‑driven architecture, outlines when it should be used, describes common patterns such as event notification, state transfer, event sourcing, and CQRS, and provides a detailed example of applying these concepts in a content‑platform microservice system with code snippets and deployment considerations.
Event‑driven architecture (EDA) coordinates micro‑services through immutable events and a reliable broker, enabling decoupling, asynchronous processing, and state‑change tracking via patterns such as event notification, state transfer, event sourcing, and CQRS, while offering scalability and robustness but demanding careful design to avoid complexity and consistency issues.
This article explains the fundamentals of software architecture, why it is needed, the responsibilities of architects, various architectural classifications, and introduces classic and modern application architectures such as layered, CQRS, hexagonal, onion, and the open‑source COLA framework with its design and extension principles.
This article explains the fundamentals of software architecture, why architecture is needed, the responsibilities of architects, various architecture categories, common styles such as layered, CQRS, hexagonal and onion architectures, and introduces the open‑source COLA framework with its layered design, extension points and standards.
This article explains the definition and purpose of software architecture, outlines various architectural classifications such as business, application, distributed, data, physical, and operational architectures, and introduces typical patterns like layered, CQRS, hexagonal, and onion architectures, culminating in a detailed overview of Alibaba's COLA application architecture and its design principles.
This article explains the concept of software architecture, its necessity, the role of architects, various architectural categories, typical patterns such as layered, CQRS, hexagonal and onion architectures, and introduces the COLA open‑source application architecture with its layered design, extension mechanisms, and specification guidelines.
This article explains how Redis can be used to implement and simplify a wide range of microservice design patterns—including bounded contexts, asynchronous messaging, orchestrated sagas, transaction inboxes, telemetry, event sourcing, CQRS, and shared data—while improving performance, scalability, and observability in cloud‑native architectures.
This article examines the challenges of evolving data models in large applications, explains the Command Query Responsibility Segregation (CQRS) pattern, and outlines when to adopt or avoid it to balance read/write performance, scalability, and system complexity.
This article explains the definition and necessity of software architecture, outlines various architectural categories such as business, application, distributed, data, physical, and operations architectures, describes layered, CQRS, hexagonal and onion models, and introduces the COLA framework with its design principles and extension mechanisms.
This article explains the meaning of architecture, why it is essential for any system, the responsibilities of architects, various software architecture classifications, common patterns such as layered, CQRS, hexagonal and onion architectures, and introduces the open‑source COLA framework with its layered, extension, and standard design principles.
This article explains the concept of software architecture, why it is needed, the responsibilities of architects, various architectural styles such as layered, hexagonal, onion, and introduces the COLA application architecture with its design principles, extension points, and CQRS separation.
This article explains the definition of architecture, why it matters, the role of architects, various software architecture classifications, layered designs, and key patterns such as CQRS, hexagonal, onion, and the COLA framework, providing a comprehensive guide for building maintainable systems.
This article explains the definition of software architecture, why it is needed, the responsibilities of architects, various architectural styles such as layered, CQRS, hexagonal, onion, and the COLA framework, providing a comprehensive overview for developers and system designers.
This article explains what software architecture is, why it is needed, the responsibilities of architects, various classification types such as business, application, distributed, data, physical and operations, and introduces typical architectural styles like layered, CQRS, hexagonal, onion, and the open‑source COLA framework.
The article explains how Domain‑Driven Design (DDD) helps tackle the growing complexity of business logic and technical requirements by separating concerns, using bounded contexts, layered and hexagonal architectures, and integrating with microservices, CQRS, and clean architecture to achieve scalable, maintainable, and adaptable systems.
This article explains how Domain‑Driven Design (DDD) helps teams manage rising business and technical complexity by promoting a ubiquitous language, strategic and tactical design, layered and hexagonal architectures, and seamless integration with microservices, enabling rapid adaptation and robust, maintainable systems.
This article reviews essential microservice design patterns—including Database per Service, Event Sourcing, CQRS, Saga, Backend‑for‑Frontend, API Gateway, Strangler, Circuit Breaker, Externalized Configuration, and Consumer‑Driven Contract Testing—explaining their advantages, drawbacks, when to apply them, and common technology implementations.
This comprehensive guide explores microservice architecture—from its historical roots and core characteristics to ten vital design patterns such as database per service, event sourcing, CQRS, Saga, BFF, API gateway, Strangler, circuit breaker, externalized configuration, and consumer‑driven contract testing—detailing their advantages, drawbacks, and practical usage scenarios.
This article explains the principles and benefits of Domain-Driven Design (DDD), describing how strategic and tactical design, layered and hexagonal architectures, CQRS, and bounded contexts help manage complex business logic, improve scalability, and align software development with evolving business requirements.