Generally speaking, it is relatively easy to build Spring Boot, especially Spring Cloud family bucket, referred to as user-friendly micro service. However, in the development trend, container technology has been mature, facing the huge memory consumption of Spring Boot, small companies said that they can not afford to use it. Many of today’s emerging JAVA microservices frameworks are “lightweight,” largely because Spring Boot is so heavy.

JAVA is a microservices framework

No1-Spring Cloud

introduce

With Spring’s big backer, the issues of update, stability and maturity do not need to be considered at all. Technical people in the JAVA family have probably heard of Spring, so there is no shortage of programmers… , and it’s so easy to get started that you can eliminate the need for an architect.

However, you must pay on the server:

  • At least one “service discovery” server;
  • There may be a unified Gateway Gateway;
  • A configuration center for distributed configuration management may be required;
  • Possible “service tracking” to know where my requests are coming from and where they are going;
  • Cluster Monitoring may be required;
  • After the project was launched, we found that we needed a lot of servers. Every time we added servers to the cluster, we felt distressed.

Pressure test for 30 seconds

Memory usage before crimping

As shown in figure, the memory occupation is 304M.

Memory usage during pressure measurement

As shown in the figure, the memory usage is 1520M (1.5G), and the CPU usage rises to 321%

An overview of

conclusion

A simple application of Spring Boot, at least 1G memory, a microservice with few business points compiled JAR will be about 50M; Spring Cloud introduces more components and consumes more resources.

Started Application in 10.153 seconds (JVM running for 10.915)

Vert.x JAVA is a toolkit for responsive programming

introduce

Eclipse backed Eclipse vert. x is a toolkit for building responsive applications on the JVM. Vert.x can even be used in conjunction with Spring Boot. Vert.x modules provide a large number of microservice components and are seen by many as a microservice architecture of choice.

Vert.x is the underlying framework of Apache ServiceComb. Vert.x also performs well in TechEmpower, a benchmark testing site.

Pressure test for 30 seconds

Memory usage before crimping

As shown in the figure, the memory usage is 65M.

Memory usage during pressure measurement

As shown in the figure, 139M of RAM and 2.1% of CPU are used, which gives the impression that there is no pressure measurement.

An overview of

conclusion

Vert.x provides about 7M jars for a single service, running directly on the JVM, independent of Tomcat, Jetty and other containers.

Vert.x consumes very little resources, and it feels like a 1 core 2 GB server can already deploy many vert. x services. Apart from coding issues, it really fits into small projects and small modules. An open source gateway-vx-api-gateway help document based on vert. x implementation is already available in the Git market

https://duhua.gitee.io/vx-api-gateway-doc/

Multi-language support, very suitable for small projects quickly online.

Started vert. x in 0.274 seconds (JVM running for 0.274)

JAVA is other microservices framework

SparkJava

  • The JAR is small, about 10 meters
  • Small memory, about 30~60MB;
  • Performance is ok, similar to Spring Boot;

Micronaut

  • New favorite for Grails team;
  • Microservice-based applications that can be written in Java, Groovy, and Kotlin;
  • Compared with Spring Boot, it is more comprehensive;
  • The coding method is similar to Spring Boot.
  • More efficient than other frameworks in terms of startup time and memory consumption;
  • Multiple languages;
  • Dependency injection;
  • A variety of built-in cloud local functions;
  • Very new, just released 1.0.0

Javalin

  • Extremely easy to get started;
  • Flexible, compatible with synchronous and asynchronous programming ideas;
  • JAR small, 4 ~ 5M;
  • Multiple languages;
  • There is a shadow of KOA;
  • With only about 2,000 lines of source code, the source code is simple enough to understand and fix;
  • In line with current trends;
  • Multiple languages;
  • Embedded server Jetty;

Quarkus

  • Start the fast;
  • The JAR is small, about 10M;
  • Documentation is sparse;