However, because all functions are packaged together, when such problems occur, we can only load them separately by adding application instances, and there is no way to expand the service capacity of individual functional modules, thus bringing resources The cost of additional configuration is high.
![domain driven design vs microservices domain driven design vs microservices](https://files.speakerdeck.com/presentations/97e211ca45ed40deb380a00c7f115bd2/slide_26.jpg)
With the development of business, when the bottleneck of business processing appears in the system, it is often caused by the high load of one or several functional modules.
DOMAIN DRIVEN DESIGN VS MICROSERVICES CODE
The conflict of iterative joint debugging and code merging branches will affect the whole development progress, which makes the business response speed slower and slower. Moreover, when the project is large enough, different modules may be maintained by different teams. Moreover, sometimes they need to interact with each other, and the cost of getting through the interaction integration and cooperation between individual systems also needs to pay extra. If the single mode is adopted, it will bring repeated function construction and maintenance. There are bound to be similar functional modules among multiple similar business projects. The cost of collaboration among project teams is high, and the business response is getting slower and slower The fundamental reason is that the code of core and non core functions run in the same environment. It is difficult to isolate errorsīecause all functional modules of a business project are undertaken on an application, including core and non core modules, any module or small detail, due to unreasonable design, poor code quality and other reasons, may cause the collapse of the application instance, thus affecting the business. Sometimes when you want to introduce some new tools, you need to maintain multiple sets of technical frameworks at the same time, such as hibernate and mybatis, which makes the cost higher.
![domain driven design vs microservices domain driven design vs microservices](https://dz2cdn1.dzone.com/storage/temp/10752077-drax1.png)
For example, the team must use the same technology stack for a long time, and it is difficult to adopt new frameworks and programming languages. More technical debtĪs time goes on, requirements change, and personnel change, the technical debt of the application will gradually form and accumulate. What’s worse, this extreme complexity creates a vicious circle, and every change makes the system more complex and difficult to understand. This will make the new business needs assessment or abnormal problem location will take more time, but also contains unknown risks. With the increase of business requirements, all kinds of business processes are intricately kneaded together, and the whole system becomes huge and complex, so that few developers know the details of each function and business process. High complexityĪt the beginning of the project, someone should be able to know all the functions and implementation of the application like the palm of his hand. The following is an analysis of the disadvantages of single architecture application: 1. Gradually, the single application becomes more and more bloated, the maintainability and flexibility are gradually reduced, and the maintenance cost is higher and higher.
![domain driven design vs microservices domain driven design vs microservices](https://www.altoros.com/blog/wp-content/uploads/2017/04/Different-Ways-of-Application-Decomposition.png)
However, with the increasing demand, more and more people join the development team, and the code base is also expanding rapidly. The application of single architecture is relatively easy to deploy, test, and achieve horizontal expansion. Generally, in the early stage of business development, the whole application involves less functional requirements, which is relatively simple. 1、 Disadvantages of single architectureĮxample of monomer structure (quoted from Internet) Combined with the idea of hierarchical architecture, hexagon architecture and clean architecture, this paper shows the program structure design of a micro service under the background of actual use scenarios.
DOMAIN DRIVEN DESIGN VS MICROSERVICES HOW TO
Combined with the concept of domain driven, it introduces how to divide microservices, design domain model, and shows the overall microservice system architecture design.
![domain driven design vs microservices domain driven design vs microservices](https://www.microservicesvn.com/assets/images/docs/ddd/layers.png)
It introduces microservices from the disadvantages of single architecture. This is the fourth article in the “domain driven design practice road” series.