One, monomer application

In the early stages of software development, everyone developed on an application system. The business modules are also tightly coupled. Software distribution can also be distributed as a whole, or packaged and deployed, as Java can be packaged as a WAR deployment. Testing is also easy because the code is all together and there is little need to reference external associated services.

In the early stage of software development, this software development mode can adapt to the development of business and software applications can run normally.

If your business is doing well, the customer needs will increase and the number of software features will increase as the customer needs increase. To implement these features, you have to add a lot of code. And as the business grows further, the amount of code is bound to increase. Maybe two or three years from now, the amount of software code will be huge. Software then becomes a very large and complex monolithic application.

Possible problems at this time:

  1. Packaging and compiling can take a long time, making publishing time-consuming.
  2. The code becomes less maintainable because it is so large and logically complex that only a few older employees can understand it all. Code corruption is serious.
  3. Fixing bugs and adding new features can be difficult and can affect everything.
  4. Because of the above, software extension becomes difficult
  5. Software availability risks increase. Maybe a bug causes the entire software to become unusable.

In order to solve the above problems, how to do?

Two, application split

The first step you might think of is splitting your application. Take a “big ball of mud” of monolithic applications and break them down by business. For example, e-commerce may be divided into commodity applications, order applications, user applications, shop applications and other relatively small applications.

As the business grows, you may be able to break up the above applications into smaller ones and offer them as services. Gradually, it becomes a smaller service – micro service.

With the adjustment of software architecture, can the above problems be solved? Most of them can be solved. The service is stable for a while, and you’re comfortable for a while. However, in the process of using micro-services, problems are gradually exposed. What problems will micro-services bring? Let’s think about microservices.

Third, micro-service thinking

What are microservices

Wikipedia definition:

Microservices is a style of software architecture that combines large, complex applications in a modular manner based on Small Building Blocks that focus on a single responsibility and function. Functional blocks communicate with each other using a language-independent /Language agnostic SET of apis.

AWS definition:

Microservices are an architectural and organizational approach to developing software that consists of small independent services that communicate through well-defined apis. These services are managed by small independent teams. Microservices architectures make applications easier to scale and faster to develop, accelerating innovation and shortening time-to-market for new features

What are the advantages and disadvantages of microservices (question)

  • Advantage:
  1. The application is small and can be quickly compiled and deployed
  2. Individual microservices become more maintainable and easier to modify because each team is independently responsible for a piece of functionality. New features are delivered faster and can be developed and delivered quickly
  3. Higher scalability
  4. Reliability increases and many independent services can be deployed

Micro service has so many advantages, that micro service is the “silver bullet”? Microservices are not a silver bullet, they bring a lot of advantages, but also a lot of disadvantages (problems).

  • Disadvantages (Problems) :
  1. As overall complexity increases, how can this complexity be managed?
  2. Operation and maintenance becomes complicated: as the number of micro-services increases, how to monitor all micro-services to ensure service stability? If something goes wrong, how do you locate the problem?
  3. Service management: As microservices become more numerous, management complexity becomes higher and governance becomes more complex
  4. Testing challenges: You need to integrate with other microservices to test your integration
  5. Distributed issues: distributed data consistency, distributed transactions
  6. Service assurance: How can a problem with one service not affect other services?

According to the above definition of microservices, these services are all managed by small independent teams. How are the teams divided? How can the organizational structure of the company be adjusted to adapt to the architectural development of microservices? This also presents organizational management challenges.

And the “micro” of micro service, how much “micro” is a good “micro”? So how do you define microservices, how do you define boundaries? All of these are the problems and challenges facing micro services.

An aside: Every question has two sides, just like a coin, so think about a variety of questions, not just one.

Four,

According to the above brief analysis, the implementation of micro-services is not an overnight thing, but develops with the development of business, is a gradual evolution of the model.

Microservices architecture is an architectural solution proposed to adapt to the rapid change of business, rapid iteration, delivery, feedback and modification of products, and expansion of team members.

It can be seen from the pros and cons analysis of micro services that micro services are not a “silver bullet”. While it brings benefits to development and products, it will also bring a series of problems. How to overcome these problems is the key to the implementation of micro services.

The disadvantages mentioned above also require the establishment of operation and maintenance development infrastructure to ensure the smooth operation of micro services. CI/CD, monitoring system, configuration center, etc., should DevOps be built at the same time?

So the successful implementation of microservices is not an isolated thing, it is related to many other things, architecture, tools and team coordination, need to be synchronized construction, it is a system engineering.

My another blog:www.cnblogs.com/jiujuan/p/1…