Building a microservices set with the Springboot split service

Source: Internet
Author: User

Last month (16/07) split a chatty application into small applications.

Application Background :

1. Based on spring boot development

2. Rely on open source software such as Activemq,kafka,redis,mongodb,mysql

3. Internal service image server, distributed computing platform service, retrieval service, message push service, etc.

Split Reason:

1. (original) High coupling between application modules, each module acts as a reaching "role"

2. The configuration information of the application is distributed to the configuration which relies on several services, the configuration information redundancy, the change of configuration is too much

3. When applied to the underlying service, it fails to follow the "dependency reversal principle", which leads to the upgrade of the basic service, the problem fix, the application in the face of change when the function increases, not flexible enough

4. The application of customized development branch and the main line break, can not meet the flexible development of custom

Split Process:


The entire unpacking process to maintain the original business unchanged, progressive.


1. First, the part that relies on the basic service is extracted, and the application to the service-dependent operation all through the abstraction interface. It then accomplishes the operation of the underlying service through the implementation. For example: Operation Picture Server operation through Imageserverclient, Operation distributed computing platform service through Pccserverclient.

2. Comb application configuration information, patch server configuration, database configuration, etc., build Spring Cloud Config Service (support git,svn,local file read profile) using Local file to manage configuration file; application integration Spring Cloud config Client, configuration information is unified before the configuration service reads.


3. To apply the split, will provide the HTTP request interface split into WebApp, will provide the RPC interface split into the app. These two classes are then split by installing the implemented business functions separately.

The split Webapp,app still uses the Spring boot framework.


Split Result:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/86/C8/wKioL1fKcWfD7ejDAAKk83Sa8cQ221.png "title=" Spring Boot "width=" 680 "height=" 382 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:680px;height:382px; "alt=" Wkiol1fkcwfd7ejdaakk83sa8cq221.png "/>

1.WEBAPP session sharing via spring session + Redis

2.webapp,app the configuration file through the Request Configuration service (Spring Cloud Config Server), resolving the issue of unpacking reason 2

3. Split Step 1 To resolve the issue in Split cause 3

4. Separate applications in addition to the WebApp to the session sharing, the other communication, the data flow is through the middleware to complete

5. It is easier to solve the problem of split cause 4, and custom development only needs to add custom applications.


To access the app:

1. Application is the front-end separation, through the reverse proxy to complete the HTTP request to multiple WebApp forwarding

2. External systems can access webapp and apps via HTTP request, TCP/IP, respectively


Splitting difficulties:

1. Application of the module division, this need for the application of business processes, data flow, dependent on the call relationship between services and communication protocols are clear

2. Avoid splitting for splitting

3. Team members are able to understand the reasons for the split, clear the process of operation, can imagine the desired results


a story:

One day the girlfriend has two kinds of dumplings: pork, leek and eggs.

Me: Cook together

Girlfriend: Say Cook separately

Me: Not too much trouble

Girlfriend: I don't eat meat

Me: It's good to cook, no meat for you.

Girlfriend: That meat and onions boiled rotten, how to do! The pot is full of meat.


Chatty application is like a pot of cooking all kinds of dumplings, small application (micro-service) is like a one pot type of dumplings.


This article is from the "Red Horse Red" blog, please be sure to keep this source http://aiilive.blog.51cto.com/1925756/1845951

Building a microservices set with the Springboot split service

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.