Netty is an asynchronous, event-driven network application framework for rapid development of maintainable, high-performance network servers and clients. The status of Netty in the Java network application framework is like: the status of the Spring framework in JavaEE development. The following frameworks all use Netty because they have network communication requirements!
▪ Cassandra - nosql database
▪ Spark - big data distributed computing framework
▪ Hadoop - big data distributed storage framework
▪ RocketMQ - ali open source message queue
▪ ElasticSearch - search engine
▪ gRPC - rpc framework
▪ Dubbo - rpc framework
Spring 5.x - flux api completely abandons tomcat and uses netty as the server
Zookeeper - Distributed coordination framework
Netty vs NIO has a lot of work and many bugs. It needs to build its own protocol to solve TCP transmission problems, such as sticky packets and half-packets. epoll empty polling leads to 100% CPU, and the API is enhanced to make it easier to use, such as FastThreadLocal => ThreadLocal, ByteBuf => ByteBuffer
Netty vs other web application frameworks
Mina is maintained by apache. In the future, the 3.x version may have a major refactoring, breaking the backward compatibility of the API. The development iteration of Netty is faster, the API is more concise, and the documentation is better.
Tried and tested, 16 years, Netty version
▪ 2.x 2004
▪ 3.x 2008
▪ 4.x 2013
▪ 5.x is deprecated (no obvious performance improvement, high maintenance cost)