Getting started with microservices springcloud and springboot

1. What are the service architectures?

Microservice architecture and traditional monolithic architecture


2. What is the three-tier model of the monolithic architecture?
Presentation layer, business logic layer, data access layer
Presentation layer Web UI
data access layer operating database
3. J2EE is a monolithic architecture, all codes are packaged into war packages and deployed in serlet containers such as tomcat jetty.
4.
J2ME , J2SE, J2EE J2ME is suitable for small equipment, smart card
J2SE is suitable for desktop applications
J2EE is suitable for server applications

5. Comparison of
microservice architecture and monolithic architecture Monolithic architecture is highly coupled and difficult to test.
After the business is complex, it is difficult to develop and it is difficult for newcomers to take over.
High concurrent processing capacity is limited

6. Monolithic Architecture Evolution-Application Server Cluster Load Balancing
Load Balancing: Single Application Cluster Distribution
Cache Server
File Server
Database Read and Write Separation

7. Features of
microservices Independent process services, the services communicate through Http protocol, RestFul API
service centralized management,
different development languages ​​can be used, database
data format: xml, json, protobuf serialization (binary data) microservices are
divided by business

8. What are the non-relational databases?
mongdb redis

9.
Microservices must be deployed automatically Distributed deployment git-maven-jenkins-docker-k8s

10. Microservice management The
number of services is large, and centralized management is required.
Spring Cloud uses Eureka to register and discover services.
Centralized management framework: Zookeeper/Consul

11. Difficulties in data consistency in distributed systems

12. The concept of fusing?
Because microservices may depend on each other, the entire system may be unavailable, which is the "avalanche effect."
In order to prevent such incidents, it is necessary to take corresponding measures, such as "fuse mechanism".

If the request fails for a certain number of times, the service will turn on the fuse without performing business operations and fail quickly. There will be no blockage of a large number of threads, which will
affect other services, but will only make the service and the services dependent on the service unavailable, and other services will be used normally.

13. CAP theory Microservices
cannot satisfy "consistency", "availability", and "partition fault tolerance" at the same time.

14. The monolithic architecture can be controlled by Transactional, the transaction of the database itself

15. Microservice framework transaction control mode
Two-phase commit, 1 service A and service B transaction coordinator, 2 are submitted only after success, and if one fails, all are rolled back.
Phase 2 may fail, so you need to log in Phase 1.


16.The microservice framework has Spring's SpringCloud
Google's Kubernetes

17.
Microservice container and monolithic framework container Monomer: tomcat, jettry and other serlet containers Microservice
: Docker container

18. DevOps is a deployment method or concept of microservices.

19. With the increase in business development, what are the measures?
Read and write separation, add cache, add load balancing server, application cluster deployment.
For further development, consider distributed systems and microservice architecture.

20. Three major problems of microservice architecture?
Propagation of faults: Fuse
service division: Divided by business is difficult, and it is difficult to split old systems. Domain-driven
distributed transactions: two-phase commit or three-phase commit. Either way, there is the possibility of transaction failure, resulting in data inconsistency, and manual recovery of data.

21. The main functions of microservices,
service registration and discovery,
load balancing,
service fault tolerance,
service gateway,
unified management of service configuration,
link tracking,
real-time log

2. Springcloud 1.
Introduction to
springcloud. Springcloud is
a web framework based on springboot , which simplifies the process of development and deployment.
Springcloud is implemented by packaging other technical frameworks, such as the open source Netflix OSS component
2. The core component of spring cloud
Service registration found Eureka
fuse component Hystrix
load balancing component Ribbon
routing gateway Zuul

3. Three major features of springboot,
automatic configuration, start-up dependency, and Actuator's monitoring of running status

4. What is springboot automatic configuration and initial dependency.
Automatic configuration is what the program needs, and springboot will assemble it. For example, if Feign dependencies are introduced in the pom, springboot will automatically introduce the beans required by the default Feign.
Start-up dependency: When adding project dependencies before, you need to select the version to resolve version conflicts. For example, springmvc needs to introduce spring-core, spring-web, spring-webmvc and other dependencies, and
springboot start-up dependencies only need to add spring-boot-starter-web, Will automatically introduce springmvc related dependencies.

Problems caused by automatic configuration and initial dependency: Developers don't know which beans are injected into the program.
Springboot provides Actuator components to monitor the running status of the program.

Guess you like

Origin blog.csdn.net/x18094/article/details/106534857