In recent years, the Java technology stack has grown so fast that hundreds of technology tools are being created, which creates a problem:

What tools should we, as developers, choose to build the most appropriate technology stack?

Today I’m going to recommend a wave of tools and frameworks that I use and understand.

I. Project tools

1.1 the IDE

The mainstream Java development tool is now IntelliJ IDEA. A few years ago, Eclipse might have been able to compete with IDEA, but now it’s basically IDEA.

In my case, I used IDEA first, then Eclipse for a few years, and then I went back to IDEA.

Including the programmers around me, those who used Eclipse before, many of them have changed to IDEA in recent years.

If you ask me what is the most fun with IDEA, I think there are three points:

  1. Code intelligent tips, cool!
  2. Automatic code generation, cool!
  3. Code debugging, cool!

These three points are exactly the three points that can greatly improve the development efficiency of developers. Therefore, it is recommended that those who do Java back-end development should give priority to IDEA as a development tool.

Eclipse also has some advantages: it’s installation-free, it’s free, it’s easy to open multiple projects, and it’s light and simple to configure

1.2 Version Management Tool

Git already has a monopoly on code versioning tools in projects, so you don’t need to worry about SVN or CVS for new projects.

There are two reasons why Git is now a monopoly:

  1. Git is distributed and does not lose a full code history due to a version management server crash.

  2. Git branch creation is a very cheap operation and can be created at will, making parallel development easy to implement. Versioning tools such as SVN and CVS are awkward to branch and cumbersome to develop in parallel.

Point 1 above greatly improves the security and reliability of code assets; The second point is perfectly suited to contemporary agile development needs. Therefore, it is not surprising that Git is popular.

1.3 Building Tools

Build tools for Java projects are now in a race, and there are generally two choices in the industry: Maven and Gradle.

If it is a back-end Java project, you will most likely use Maven to build the project. If it’s a front-end Android project, choose Gradle.

Gradle itself is much more advanced than Maven: it has flexible configuration, excellent performance, and is a really good build tool.

So why are most back-end Java projects built using Maven?

Because Gradle is inherently too flexible, this flexibility brings with it two problems that don’t quite match the backend project build characteristics:

  1. Gradle is flexible, so its usage rules vary, which leads to a high learning threshold — the back-end project’s own build process is rigid and changes very little, so it doesn’t need many build features and build rules. That is, flexibility itself introduces multiple usages, rules, and features that don’t make much sense to back-end projects, and it’s not cost-effective to invest time in learning to build tools for their own use.

  2. As mentioned above, the construction process of back-end project itself is routine, and some strong constraints are needed to ensure the reliability and stability of this routine. Because of the flexible configuration rules, Gradle has lost the strong constraints of Maven. This is likely to cause conflicts and potential errors in the use of Gradle, causing instability in the construction of the project. This is not worth the loss for the backend project.

Second, the development framework

2.1 Web framework

The majority of Web project development is now moving to SpringBoot. There are three biggest benefits to using SpringBoot:

  1. There is very little configuration and it is plug and play
  2. Built on Spring, the barrier to entry is very low
  3. Run directly, no need to worry about the Web container

Most people are familiar with SpringBoot, so I won’t repeat it. Springboot SpringCloud project fhadmin.cn

2.2 Persistence layer framework

There are basically two types of persistence layer frameworks used in project development:

  1. Mybatis series derived framework
  2. JPA series of derivative frameworks

In China, most of the persistence layer framework is still the first choice Mybatis, it seems that most of the projects abroad are using JPA framework.

In my opinion, Internet project and toC project are more suitable for Mybatis, while toB project is more suitable for JPA.

The business requirements of toC projects are often flexible, so it often needs the technology of the project to be flexible, and Mybatis itself is a simple encapsulation of SQL, it is easy to add tables and fields, change SQL.

However, toB project is different. The demand is basically stable, and the designed data model will not change frequently, so it does not need the flexibility of Mybatis, but needs a series of strong constraints to modify the model at will. This is also the nature of JPA itself: it is very prescriptive and has many constraints, and it is expensive to change the data model of JPA.

Therefore, when you choose the persistence layer framework, you should see the characteristics of the project, according to the actual situation to choose Mybatis or JPA.

2.3 RPC framework

The architecture of Java projects today is basically shifting to distributed architecture. The core of distributed system integration is RPC, so many projects have introduced RPC framework.

RPC framework, now used more is Dubbo framework.

Dubbo performs very well:

  1. While many RPC frameworks use HTTP as the underlying communication protocol, Dubbo chose TCP as the communication protocol. In terms of performance alone, TCP is certainly much better than HTTP.

  2. Dubbo itself makes extensive use of NIO asynchronous programming to further optimize performance.

So, if you need RPC in your project, consider the Dubbo framework first.

3. Middleware

3.1 Web Server

Java development now, because most of the use of SpringBoot, so before we commonly used what Tomcat, Jetty, Resin and other Web containers are not how to deploy the use of independent.

One Web container, however, is gaining ground: Nginx.

Nginx has a very special place in Java project development. It serves two functions within the Java project architecture:

  1. Web container for handling static resource requests – Nginx in Java projects is responsible for handling Http requests for static resources such as images, HTML, JS, CSS, and so on.

  2. Reverse proxy distribution – In addition to being a Web container that handles static resource requests, Nginx also forwards requests for dynamic resources, such as servlets and controllers, to the Built-in Tomcat container in SpringBoot.

In addition, because of the reverse proxy feature, Nginx will be deployed on the cluster. Nginx will also act as a reverse proxy for load balancing requests when forwarding requests.

3.2 Message Queue

Today, architecture is more and more distributed. In distributed architectures, the most common means of communication, besides network requests, is message queues.

The main message queue frameworks include RabbitMQ, RocketMQ, Kafka and so on.

I wrote about RabbitMQ versus Kafka earlier,

RabbitMQ is less powerful, but easier to use and more suitable for small and medium projects.

In addition, for financial related projects, RabbitMQ is preferred for message queues for two reasons:

  1. RabbitMQ is an implementation of the AMQP protocol, which itself was developed by software experts from the financial industry and is so mature and comprehensive that it has become an industry standard.

  2. RabbitMQ is written by Erlang, whose virtual machines are very well protected against memory and CPU overloads, which makes the Erlang application itself reliable and robust.

Big projects, non-financial projects, you can choose between RocketMQ and Kafka.

RocketMQ and Kafka share almost 90 percent of the same functionality and concepts, although RocketMQ has improved on The Kafka concept and is more applicable to a wider range of business scenarios.

Kafka should be a priority for streaming data processing because Kafka’s streaming data processing ecosystem is more complete.

3.3 database

In the field of Internet, the mainstream database is MySQL. In some traditional industries, such as banking, Oracle is used a lot.

Oracle is expensive, one of the characteristics of the Internet project is the number of database server thieves, if the Oracle, the cost is too high.

And we are more and more copyright awareness, the country is also more and more tightly grasp this aspect, so, in the field of the Internet almost all use MySQL.

Using MySQL, there is a common MHA scheme — the high availability scheme of MySQL, the basic architecture is one master and two slave. When the master fails, the slave is promoted to the master.

3.4 External cache

For highly concurrent architectures, external caches are indispensable, and the most common one is Redis.

There are three reasons why everyone uses Redis for external caching:

  1. Redis itself performs very well.

  2. Redis has many data structures to suit different business caching needs.

  3. Redis cluster high availability scheme and shard storage high performance scheme are relatively mature.

These are the mainstream technical tools often encountered in Java development.

Due to space constraints, I’ve only listed some of the most core tools and middleware that everyone will use.

There are some important middleware that I don’t think everyone will use, so I haven’t mentioned them: ElasticSearch, MongoDB, Zookeeper, etc