Build microservices with spring cloud and Docker

Source: Internet
Author: User

What is Spring Cloud?
Spring Cloud is a toolset provided by pivotal to simplify the building of distributed systems. Spring Cloud introduces the concept of cloud Platform Connector (Connector) and service Connector. A cloud Platform connector is an interface that needs to be implemented by a cloud platform provider so that other modules in the library can work with the cloud platform. (For more information, you can read this article from Infoq: Http://www.infoq.com/cn/news/2014/06/spring-cloud-platform-abstract. )

In the solution provided by spring Cloud, you will find something like this:

Configuration Service (Http://12factor.net/config)

Discovery Service (Https://en.wikipedia.org/wiki/Service_discovery)

Circuit breakers (http://martinfowler.com/bliki/CircuitBreaker.html)

Distributed Sessions (Https://en.wikipedia.org/wiki/Distributed_cache)

Spring Boot
The most important thing about spring cloud is that it works with spring boot, and spring boot helps developers to create spring-based applications and services more easily.

As you can see from the boot in the Spring boot project name, spring boot works by creating and starting a new spring framework-based project (Getting Started tutorial qkxue.net). Spring boot selects the most appropriate spring sub-project and third-party open source libraries for consolidation. Most spring boot applications require very little configuration to run quickly. Spring boot contains the following features:

Create a spring app that can run independently.

Embed a tomcat or jetty server directly without the need to deploy a war file.

Provides a recommended base pom file to simplify the Apache MAVEN configuration.

Automatically configure the spring framework based on project dependencies as much as possible.

Provides features that can be used directly in a production environment, such as performance metrics, application information, and application health checks.

There is no code generation, and there is no XML configuration file.

Service discovery and Intelligent routing
Each of these services contains a specific micro-service architecture (Tengyun technology ty300.com). When you build a microservices architecture on spring Cloud, here are a few basic concepts that need to be clarified first. First, you need to create a configuration service and Discovery Service two basic services first. As shown in the following:

Build microservices with spring cloud and Docker

The above picture illustrates the dependencies between the four microservices and the various services.

The Configuration service is at the top, yellow, and is dependent on other microservices.

Discovery service is at the low end, blue logo, and is also dependent on other services.

The two microservices of the green logo are the two applications we have used in this series of blog post: Movies and video recommendations.

Configuration Service

The Configuration service is a very important component in the MicroServices architecture. As the 12 factor theory says, the configuration of the MicroServices application should be stored in the environment, not in the local project.

The configuration service is an essential component of the infrastructure because it provides service management for all base services through point-to-point and retrieval.

Suppose we have multiple deployment environments. For example, we have a staging environment and a production environment, and the configuration for each environment will be different. Each configuration service will be hosted by a separate git repository for the environment. No other environment has access to this configuration repository, it simply provides the configuration service running in that environment.

Manuscripts: Diligent Learning qkxue.net

Read the full version of the graphic using spring cloud and Docker to build microservices

Build microservices with spring cloud and Docker

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.