This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

Spring Boot microservice

Standalone apps vs. microservice apps

  • Single application

  • Microservice applications

Single architecture Evolution

Project split Multiple projects are deployed independently

ESB Enterprise Service Bus

The difference between

  • SOA architecture is enterprise-level, uses ESB services (ESB Enterprise Service Bus), is very heavy, requires serialization and deserialization, and is delivered in XML format
  • Microservices architecture is mainly used for the Internet, lightweight, small, independent operation, based on HTTP + Rest + JSON format transmission.
  • An ESB can also be said to be a combination of traditional middleware with technologies such as XML and Web services

Disadvantages of single architecture

  • The complexity increases
  • Technical debt is rising
  • The deployment speed gradually slows down
  • Impeding technological innovation
  • Cannot scale on demand

Microservices Architecture

Definition of microservices

  • Martin Fowler: In a nutshell, the microservices architecture style is an approach to developing a single application as a set of small services. Each of these small services runs in its own process and often uses lightweight mechanisms such as HTTP resource apis to communicate with each other. These services are built around business functions and can be deployed independently through a fully automated deployment mechanism. These microservices can be written in different languages and can use different data storage technologies. We manage these microservices with minimal centralization.

  • Microservices Architect An architectural pattern that advocates the partitioning of a single application into small services that coordinate with each other to provide ultimate value to users. Each service runs in its own separate process and uses a lightweight communication mechanism (usually RESTful apis based on HTTPS) to communicate with each other. Each service is built around a specific business. And can be independently deployed to the production environment, production environment, etc. In addition, a unified and centralized service management mechanism should be avoided as far as possible. For a specific service, appropriate language and tools should be selected to build it according to the business context

  • Microservices is an architectural style in which a large complex software application consists of one or more microservices. The services in the system can be deployed independently and are loosely coupled. Each microservice focuses on only one task and does it well. In all cases, each task represents a small business capability.

Features of microservices

  • Service componentization
  • Service Around business
  • Product development model
  • Lightweight communication mechanism
  • Decentralized governance
  • Decentralized data design
  • Troubleshooting design
  • Evolutionary design
  • Infrastructure automation

Benefits and challenges of microservices

  • advantages
    • Development of simple
    • Flexible technology stack
    • Service bold
    • According to the need to expand
  • challenge
    • Complex operations
    • Data consistency issues
    • Integration test complexity
    • Duplicate code
    • Monitoring difficult

Characteristics of microservices

  • Each microservice can run independently in its own process
  • A series of independent microservices build the system together
  • Each service is independent of business development, and a microservice generally completes a specific function, such as order management and user management
  • Microservices communicate with each other through some lightweight communication mechanisms, such as Rest APIS or RPC

Advantages of microservices

  • Easy to develop and maintain
  • Start the faster
  • Local changes are easy to deploy
  • The technology stack is unrestricted
  • On-demand scaling
  • DevOps

Challenges posed by microservices

  • High operation and maintenance costs
  • Distributed complexity
  • Interface adjustment costs are high
  • Duplication of effort

Design principles for microservices

  • Single responsibility principle
  • Principle of service autonomy
  • Lightweight communication principles
  • Interface specification principle

The resources

  • martinfowler.com/

“Welcome to the discussion in the comments section. The nuggets will be giving away 100 nuggets in the comments section after the diggnation project. See the event article for details.”