【Micro Server】Introduce of 'Micro Server'

Part1.What's 'Micro Server'?

       Microservices involve an architectural approach that emphasizes the decomposition of applications into singlepurpose, highly cohesive and loosely coupled services managed by cross-functional teams, for delivering and maintaining complex software systems with the velocity and quality required by today’s digital businesses.

       Microservices are language-, platform-, and operating system-agnostic. They can be used to break down a big monolithic application (typically packaged as a single archive that is vertically scaled up or horizontally scaled out) into smaller and simpler services. Each microservice does one thing, and does it well, so the “micro” in microservices refers to the scope of the services’ functionalities, not the number of Lines of Code (LOC).

        As you seen, above mesasge is the explain from the Authority, and for the itoo and other programmes in our TGB like ‘Integration System’ or other Systems are monolithic, So i will compare the difference between the 'monolithic system' and the 'Micro Server', and explain why we need to use the Micro Server in our programm, may one years later, our TGB must be good at this technology.


Part2.What's the  benefit of Micro Service?

      From the part 1,we know that what's the Micro Server, and i said that i will compare the difference between 'Monolithic System Design' and 'Micro Server System Design' , So next the benefit of Micro Service i will introduce, and the viewpoint comes from RedHat forum.

      1.Each microservice is generally built by a full-stack team,which reduces potential communication difficulties between disparate teams that could otherwise be
problematic. (For example our exam system, we have many dependency on the basic system, you know once the basic system occured problem, we can't set up our program).

      2.Microservices may not be suitable for simpler applications and are better suited for complex applications that have grown over a period of time, with large codebases and teams. Microservices are ideal in realizing multiple business functions, with each microservice focusing on realizing a single business function or sub-function. Teams are free to innovate at their own pace.

      3.The frequency with which an application needs to be updated, and the quick turnaround that is possible using a microservices design, are a few key factors driving this s yle of architecture.

      besides from the internet i find some tips share to you as follow:

      (1)INDEPENDENT SCALING
      Each microservice can scale independently via X-axis scaling (cloning with more CPU or memory) and Z-axis scaling (sharding), based on what is needed. This is very different from monolithic applications, which may have very diverse requirements but must still be deployed together as a single unit.

      (2)INDEPENDENT UPGRADES
       Each service can be deployed independently of other services. Any change local to a service can be easily made by a developer without requiring coordination with
other teams. For example, to meet ever changing business requirements, a service can be improved by replacing the underlying implementation. As a result this  improves the agility of the microservice. This is also a great enabler of CI/CD
       (3)EASY MAINTENANCE
       Code in a microservice is restricted to one capability and is thus easier to understand. IDEs can load the smaller amounts of code more easily, and smaller codebases increase velocity by enabling awareness of the side effects of the code developers are currently writing.

       So i list three tips of the benefit for micro service which is useful for our system and management in the TGB Programm which is not provided by the Monolithic System Design.


Part3.How to Refactoring a monolith to microservices

         For the part.1 and part.2 i list the meaning and benefit of the micro service, as you know for the big application micro service is better, so i will explain how to refactor a monolith to a microservice.

         firstly show the Design Picture fro the monolith frame:

                       

         such an application can be refactored into microservices, which would create an architecture that would look like the following:

         

         So this is the effect of the use of micro server. and i will write another bolg to introduce this progress on how to refactor it and the link("although for now it doesn't exist").

         

Part.4 Our Direction for microserver

       what we are doing is for the JAVAEE‘s direction, so WildFly is the necessary part of it, if you know what's Jboss that you will know what's WildFly, please refer to the websit of JBoss and Red Hat.

        So what's WildFly? WildFly Swarm turns the table where it creates a “fat jar” that has all the dependencies packaged in a JAR file. This includes a minimalist version of WildFly, any required dependencies, and of course, the application code itself. The application can simply be run using java -jar. OK, we need to understand that there's a conception about "Fat Jar".

        Besides we need to know how to deal with it?

        There's some demo for it:github.com/arun-gupta/wildfly-samples/tree/master/swarm.
        A Java EE application can be packaged as WildFly Swarm fat jar by adding a Maven dependency and a plugin in the pom.xml:

<dependency>
    <groupId>org.wildfly.swarm</groupId>
    <artifactId>wildfly-swarm-jaxrs</artifactId>
    <version>${version.wildfly-swarm}</version>
    <scope>provided</scope>
</dependency>
<plugin>
    <groupId>org.wildfly.swarm</groupId>
    <artifactId>wildfly-swarm-plugin</artifactId>
    <version>${version.wildfly-swarm}</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
</plugin>
       this is a necessary step to deal with it for micro service.Besides you can refter this link how to create fat jar: https://github.com/arun-gupta/wildfly-samples/tree/master/swarm  (this link is more focus on how to create it.)

       so this article i wrote is to introduce what is micro service what's the benefit of it and the frame Design pattern and so on , and use english language may i think is better to restore it's origin meaning. For the several days i study with my friends on it and i will share some materials for you.

         https://www.ibm.com/developerworks/cn/java/j-cn-java-and-microservice-1st/index.html (A serial article from IBM Chinese)

         http://blog.arungupta.me/wildfly-swarm-microservices-javaee/

         https://github.com/wildfly-swarm/wildfly-swarm-examples

         http://blog.arungupta.me/monolithic-microservices-refactoring-javaee-applications/
         https://www.slideshare.net/iwasakihirofumi/seven-points-for-applying-java-ee-7
         https://docs.jboss.org/author/display/WFLY10/All+WildFly+documentation
         https://github.com/smillidge/JDays2016MicroServices

         http://wildfly-swarm.io/         

         http://blog.eisele.net/2016/05/modern-architecture-with-containers-microservices-and-nosql.html

         http://www.javaadvent.com/2015/12/microservices-and-java-ee.html

         http://blog.eisele.net/2015/10/deploying-java-ee-microservices-on-openshift.html

         http://blog.eisele.net/2016/09/replacing-legacy-java-ee-application.html

         https://www.ibm.com/developerworks/cloud/library/cl-refactor-microservices-bluemix-trs-2/index.html

         https://www.openshift.com/

         https://github.com/arun-gupta/microservices (about how to refactor to a micro server)

         Finally tnx bill and my friends ,tnx u r 's help and share.


猜你喜欢

转载自blog.csdn.net/u013047584/article/details/70307825
今日推荐