Spring Cloud introduction and environment construction (1)

foreword

Using Spring Cloud requires the knowledge of Spring boot. If you have no relevant experience, please refer to the simple use of Spring Boot (2) for a simple introduction.

The Spring Cloud series of blogs is based on the MyEclipse development tool.

LAMP project

A traditional single project can be completed with a LAMP structure, L: Linux; A: Apache; M: MySQL; P: PHP. On one server, we can complete the construction of the entire project.

Because it is placed in an Apache server, our project structure generally looks like this:


The front-end uses JSP and other views, the back-end uses MVC frameworks such as servlet, the overall project uses the Spring container, and the persistence layer uses Hibernate or MyBatis for data connection. Finally, put our compiled project into a war package (or compiled bytecode file), put it in our Apache server, start the service, and users can access the Tomcat server to get the information they need.


However, in this single server, whenever we have new code to be released, our war will continue to grow and eventually become a bloated monster. Needless to say, it takes time to start, and all the codes are placed in a war. In the package, if there is a memory leak in a method of a certain class file, it will usher in the downtime of the entire project. If it is a traditional industry project, tell the customer, debugging and solving may solve the problem, but , if as a project in the Internet industry, it may be down for an hour, which means the bankruptcy of the company.

Optimization of a single project

The disadvantage of writing the codes of various functional modules together has given birth to the emergence of Service-Oriented Architecture (SOA), which splits the coupled functional codes, and each functional module is connected to the platform as a single capability or service. If one of the services goes down, it will not affect the operation of the entire project.


Enterprise Service Bus (ESB) developed from Service-Oriented Architecture (SOA) and is the product of the combination of traditional middleware technology and XML, Web services and other technologies. ESB provides the most basic connection center in the network and is a necessary element to build the nervous system of the enterprise. ESB adopts a "bus" model to manage and simplify the integration topology between applications, based on widely accepted open standards to support dynamic interconnection between applications at the level of messages, events and services, It is a standard way of integrating between loosely coupled services and applications.


Microservice Architecture

Microservice architecture and service-oriented architecture are the same in concept, but the microservice architecture is more delicate in the splitting of services. For example, the sales module can be further divided into "food sales" and "toy sales".


About Netflix

Netflix is ​​an Internet video provider and an American video giant. With the transformation of Netflix into a cloud computing company, Netflix established its own open source center named Netflix Open Source Software Center, or Netflix OSS for short.

This open source organization focuses on big data and cloud computing technologies, and provides multiple open source frameworks, including big data tools, construction tools, and cloud platform-based service tools.

About Spring Cloud

Spring Cloud is not essentially a specific framework, it is a toolbox to help us build a microservice cluster;

Spring Cloud is based on Spring Boot, which encapsulates the Netflix framework;

Spring Cloud integrates Netflix with the Spring container, making it easy to use Spring's IOC, AOP, and more.

What common Netflix frameworks does Spring Cloud integrate with?

Eureka: Distributed middleware based on REST services, mainly used for service management.

Hystrix: A fault-tolerant framework that helps us control the interaction of components between distributed systems by adding delay thresholds and fault-tolerant logic.

Feign: A REST client designed to simplify the development of Web Service clients

Ribbon: Load balancing framework.

Zuul: Provides functions such as proxying, filtering, and routing for microservice clusters.

Spring Cloud series:

Simple use of Spring Boot (2)

Simple example of Spring Cloud service management framework Eureka (3)

Spring Cloud service management framework Eureka project cluster (4)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325632281&siteId=291194637