Netty vs Mina

Source: Internet
Author: User

1, codec comparison

The Mina codec (codec) creates an instance with the following choices:

1 each received data to create a codec instance

2 Create a codec instance for all client links

Netty codecs to create an instance can have the following choices:

1 every time the link to create a codec instance

2 Create a codec instance for all client links

2, handler comparison

Mina's handler. Creating an instance can have the following choices:

1 Create a codec instance for all client links

Netty codecs to create an instance can have the following choices:

1 every time the link to create a handler instance

2 Create a handler instance for all client links

Third, document comparison

1, Netty and Mina documents are more, but the Mina document is not complete, Netty document is more clear

Four, UDP protocol transmission

1, Netty The UDP has no connection to the characteristics of the exposure, and Mina to UDP advanced level of abstraction, you can use UDP as a "connection-oriented" protocol, Netty need manual processing order, packet detection, and so on.


On-line evaluation:

1. Mina's connection to the kernel and some features is too tight, making it impossible for users to detach when they do not need these features, and the performance will be reduced compared to the Netty, which solves the design problem.

2. The basic architecture of Netty is almost exactly the same as that of Mina, but there are a lot of details to be improved (for example, Mina iosession to call Flip () every time she reads and writes, Netty Channel does not, and supports zero copy).

3. Netty is simpler to use than Mina.

4. About UDP Links: Mina with TCP and UDP as "connected" processing, a UDP request will be based on the address to generate a new iosession, the expiration time is 1 minutes, the benefit is obvious, but for the performance requirements of the project is not good, For a disconnected thing cache 1 minutes, most of the time may be white cache, do not work hard. Mina may have an original intention to do this is a continuous decoding, such as a packet is too large, divided two times transmission; but such a design should be a UDP taboo.


Related Blogs: http://my.oschina.net/leoson/blog?catalog=292948

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.