Microservice architecture (1) - a brief introduction

Software Architecture

1. Brief introduction

concept

Software architecture is a general description of the overall structure and components of a software system, which is used to guide the design of each module of a large software system. In the process of software development, after various factors are considered and weighed, a specific technology is selected, the system is divided into different functional modules, and these modules are divided and cooperated with each other to better provide value to users.

relevant factor

  • Business requirements, technology stack, cost, organizational structure, scalability, maintainability, high availability, etc. of the software system.

The Road to Architecture Evolution (javaweb)

One-tier architecture——"MVC (ssh, ssm)—"cloud&dubbo (representative microservice framework)

2. Single structure

brief description

  • The functions and business are concentrated in the same project project, the same release package, and the deployment runs on the same machine and in the same process.
  • Advantages: easy to develop, easy to test, easy to deploy, easy to scale horizontally
  • Disadvantages: code bloat, difficult to maintain, high construction cost, long continuous delivery cycle, long start-up cycle for newcomers, difficult innovation, poor scalability

architecture diagram

insert image description here

3. Microservices

concept

The background of the birth of microservices: the rapid development of the Internet, the "three highs" have become increasingly prominent, the development of development models, the maturity of container technology, etc.

  • Some modules with more complex functions and certain independence in the project are formed into a set of small services to develop a single application. Each application runs in an independent process, and is generally interconnected by a lightweight communication mechanism, and they can Deploy through automation.
  • Split the module into a suitable service unit (not a fixed quantitative division, it is a design idea)
  • Features: single responsibility, lightweight communication between services, isolation, data independence, technical diversity
  • Advantages: independence, agility, flexible technology stack, and efficient team.
  • Disadvantages: extra work, data consistency, communication costs.

architecture diagram

insert image description here

Microservices Newsletter

communication mode

type one to one one-to-many
Synchronize http request mode (common) ——
asynchronous Notification/Request Asynchronous Response Publish Subscribe/Publish Asynchronous Response

Protocol

  • REST API
  • RPC (IO/thread call model, serialization method, multi-language support, service governance (dubbo, dubbox, thrift, motan, grpc)), MQ

Microservice Discovery

Traditional Service Discovery
insert image description here
Client-side Service Discovery Server
insert image description here
-side Service Discovery
insert image description here

Guess you like

Origin blog.csdn.net/qq_42133100/article/details/102903525