25

What is the difference between Vert.x and Netty? Why should one ever prefer Netty over Vert.x?

Both of them are event-driven, non-blocking and asynchronous frameworks designed for high-load I/O.

Vert.x is based on Multi-Reactor pattern (Node's style event loop on multithreaded JVM) but Netty use Interceptor Chain Pattern. When Interceptor Chain Pattern has any benefits over Multi-Reactor pattern ?

I just have a quick look at Netty's documentation, but it seems Vert.x has some extra funcitonality over Netty. I.e. Vertx is a standalone server, it's a polyglot, provide HA and clustering out-of-the-box.

Also Vert.x has little bit better benchmarks than Netty.

P.S. Disclaimer - I appreciate Vert.x very much, and not familiar with Netty. So by asking Why should one ever prefer Netty over Vert.x? I just trying to compare both of them.

Arnold Schrijver
  • 3,588
  • 3
  • 36
  • 65
VB_
  • 45,112
  • 42
  • 145
  • 293
  • 3
    On a related question there is a link to an interesting read on some finer details on netty and vertx at tech.kinja.com/ http://tech.kinja.com/interview-with-norman-maurer-netty-vert-x-1119968136 ref https://stackoverflow.com/questions/23780059/how-does-vert-x-achieve-superior-performance-compared-to-netty – MikeRoger Aug 02 '17 at 08:26

1 Answers1

46

The difference is Vert.x is based on Netty. If you take a peek at the pom.xml in vertx-core you'll find:

<!-- We depend on the specific Netty dependencies not netty-all to reduce the size of fatjars -->
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-common</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-buffer</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-transport</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-handler</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-handler-proxy</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-codec-http</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-codec-http2</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-resolver</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-resolver-dns</artifactId>
  <version>${netty.version}</version>
</dependency>
<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-core</artifactId>
  <version>${jackson.version}</version>
</dependency>

And the Netty version for Vert.x 3.5.0-SNAPSHOT is: 4.1.8.Final

Vert.x is an entire toolkit and ecosystem of pluggable modules on top of Netty for building reactive applications on top of the JVM.

Arnold Schrijver
  • 3,588
  • 3
  • 36
  • 65