00 Preface Mastering Ddd What Can You Do

00 Preface - Mastering DDD What Can You Do #

Hello, I’m Ou Chuangxin, a senior architect at PICC (People’s Insurance Company of China), a technical professional who has been working in software architecture for over a decade.

Currently, I am passionate about using Domain-Driven Design (DDD) to implement middle-platform business modeling, focusing on DDD-based microservice design and development, among other things. In addition, I am also exploring the technology and method system for the digital transformation of traditional enterprise middle-platforms. I am very excited to meet you in this column!

My Experience with DDD #

When it comes to the practice of DDD, microservices cannot be ignored. In 2015, when I first started learning about microservices, the acceptance of its design concept was not high, as centralized architecture was still widely used.

However, even four years ago, it was foreseeable that business would become increasingly complex, and the value of microservices was evident. That’s when I started delving into it. As a senior architect in the company, I have always been at the forefront of the company’s transition to a central platform and the construction of microservices.

During this process, my technical team and I have encountered numerous challenges. The most pressing one was, “How should microservices be split and designed in a reasonable way? How small should microservices be split?” The boundaries of microservices have always been a contentious issue.

Shortly afterwards, Alibaba successfully completed its central platform strategy transformation. As a result, many large companies have embarked on their own digital transformation of the central platform, and medium-sized companies are eager to follow suit based on their own needs. However, many companies also face the problem of duplicating systems due to historical reasons.

As a central platform, it is necessary to consolidate the common and reusable business capabilities into the central platform business model to achieve enterprise-level capability reuse. Therefore, the key issue faced by the central platform is the reconstruction of the central platform domain model. When implementing the central platform, the design and separation of microservices are still challenges that need to be addressed. These two issues, one after the other, pose a significant challenge to any company.

This is also a problem that I have been exploring and solving. In the past two years, the concept of central platform has become increasingly popular, and microservices have gained more attention, with more and more people getting involved. Is there a good method to guide the design of the central platform and microservices?

By chance, I came across DDD. After an in-depth study, I discovered that using DDD’s design principles can indeed provide clearer microservice boundaries and more reasonable division of business domains. Later on, my colleagues and I have implemented numerous microservice practices using DDD.

About the Column #

With this foundation in place, I began to try to consolidate my understanding of DDD and some practical experience, and wrote several articles that were published on InfoQ. In the comments from the readers, I found that many people have a certain understanding of DDD, but due to the multitude of knowledge points in DDD and its abstract and vast system, as well as the lack of practical experience and case guidance, many people have various confusions about the application of DDD. Even if they know the benefits of DDD, they feel at a loss.

After receiving an invitation from Geek Time, I started to fully develop the course outline, striving to make it rich in practical content and place equal emphasis on theory and practice. However, this is not an easy task. From the determination of the theme to the time we meet, the column has already taken more than three months.

Although DDD has a long history, its combination with microservices and platform design is a very new field. How can DDD, which was born as early as 2003, guide the design of microservices that only became popular almost 20 years later?

In my opinion, to apply DDD, the first task is to thoroughly understand the core design principles of DDD and understand the relationship between DDD, microservices, and platform design. The platform design is essentially a business model, microservices are the implementation of the business model in a system, and DDD is a design philosophy that can guide both platform business modeling and microservice design. They form a triangular relationship. DDD emphasizes the consistency of domain models and microservice design. Microservices can only be derived from domain models, rather than designing microservices without considering domain models.

Next, through strategic design, we establish domain models and define the boundaries of microservices. This step is crucial, and you can draw on some of the experiences in the column.

Finally, through tactical design, we will transition from domain models to the design and implementation of microservices. At this stage, a clear boundary and sustainable and evolving microservice architecture framework will be presented to you.

By following the above process, the design concept of this course is also born.

About course design #

If you have not had a deep understanding of DDD in the past, or even if you are encountering it for the first time, you will definitely find that there are a lot of DDD terminology, which may seem very unfamiliar, and the relationships between these terms can be seen as “roadblocks”.

After understanding all these, the next question would be how to apply them and where to start in designing domain models, and so on.

If you have studied DDD before and learned how to use it, you may also think the other way around: “I worked so hard to understand it, but what will it actually do to my system? What specific problems can it solve? Is it really as good as people say?”

These will be the content that this column wants to deliver to you. In summary, I hope this column can provide you with several key takeaways:

  1. Use simple and understandable case studies to help you understand the 10 core concepts of DDD that you must know, delve into the design concepts, and clarify the relationships between various knowledge domains;
  2. Use DDD layered architecture to help you understand the relationships between layers in microservices architecture, and complete the design of microservice layers and code models;
  3. Use DDD strategic design and event storming to help you complete domain modeling and enterprise-level middle-tier business modeling;
  4. Use a typical case study to guide you through the entire process of DDD strategic design and tactical design, and learn the key technical points of DDD in the domain modeling and microservice design process;
  5. Help you deepen your understanding of microservices architecture design principles and considerations, and establish microservices that adapt to your company’s technical capabilities and culture, and build an evolving microservices architecture.

I hope that these takeaways can provide some substantive help to those who are engaged in or interested in a deeper understanding of microservice design and middle-tier.

In terms of the specific course design, I have divided the content into three parts: the foundation, advanced, and practical sections. Let me introduce them one by one.

Foundation #

The foundation section mainly explains the core knowledge system of DDD, including: domain, subdomain, core domain, generic domain, supporting domain, bounded context, entity, value object, aggregate, and aggregate root concepts. I will use simple and understandable case studies to help you understand these concepts and their cooperation and dependency relationships.

img

Advanced #

The advanced section mainly explains domain events, DDD layered architecture, several common microservices architecture patterns, and middle-tier design concepts. Specifically, it includes:

  • How to achieve decoupling of microservices through domain events?
  • How to design the layers of microservices?
  • How to achieve service collaboration between layers?
  • Through a comparison analysis of several microservices architecture patterns, you will understand the role and value of domain modeling and microservice layering.
  • In addition, I will introduce the core concepts of middle-tier design and discuss how to achieve synergy and integration between front-end, middle-tier, and back-end. How to use DDD for middle-tier design?

Practical #

The practical section is the focus of our column course, and I have prepared multiple practical projects.

  • Practical implementation of middle-tier and domain modeling: Help you understand how to use DDD design concepts to build enterprise-level reusable middle-tier business models, and understand the process of event storming and domain modeling.
  • Practical microservice design: Help you understand how to design microservice code models using DDD, how to complete microservice design from domain modeling, establish the mapping relationship between domain model and microservice code model, and how to achieve the architectural evolution of microservices.

Then I will use a typical case study to connect all the knowledge points of DDD together, and help you have a deep understanding of how to use the design concepts of DDD to complete the entire process of domain modeling and microservice design.

Finally, I will also share the latest design concepts in front-end development, and help you understand how to design front-end applications by borrowing the design concepts of microservices, achieving decoupling of front-end applications. At the same time, I have summarized the principles of microservice design and key considerations for distributed architecture design.

img

Lastly, I would like to say that although DDD seems complex, it is not difficult to learn. By participating in several DDD event storming workshops, you will quickly understand the core design concepts and process of DDD and make successful progress.

If your company cannot provide you with practical opportunities, you can try it out here.

I believe that this column will help you master a complete and systematic DDD-based microservice design and decomposition methods, clarify the standard design process of microservices from strategic design to tactical design, make your microservice design ideas more clear, and make the design process more standardized, so that your middle-tier and microservices can be enhanced.