Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat vs Vert.x

For the past few days I have been reading Vert.x documents. I know that Vert.x is polyglot, single threaded, non-blocking IO, modular architecture, high scalability.

Is there any other major differences between tomcat and Vert.x?

Also when we should use tomcat and when to use Vert.x?

like image 713
Ronald Randon Avatar asked May 29 '14 05:05

Ronald Randon


People also ask

What is Vert X used for?

x website (vertx.io) says, “Eclipse Vert. x is a toolkit for building reactive applications on the JVM.” It is event-driven, single-threaded, and non-blocking, which means you can handle many concurrent apps with a small number of threads. (If you know how the Node. js event loop works, Vert.

Is Tomcat and Apache Tomcat the same?

There are many ways to compare Tomcat vs. the Apache HTTP Server, but the fundamental difference is that Tomcat provides dynamic content by employing Java-based logic, while the Apache web server's primary purpose is to simply serve up static content such as HTML, images, audio and text.

Is Tomcat a good server?

Apache Tomcat is more than capable as a basic file server. While it isn't optimized to handle file formats such as HTML, PDF, mp3 or mp4, it's a strong file server that's very popular in enterprises. Tomcat is a product of the Apache Software Foundation (ASF), which also deploys Apache HTTP Server.

What is Tomcat used for in Devops?

Apache Tomcat is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet JavaServer Pages (JSP) Java EL and WebSocket and provides a "pure Java" HTTP web server environment for Java code to run in.


1 Answers

Tomcat is a servlet container, so it offers you a platform that helps you to develop and deploy HTTP based applications like web sites or web services.

Vert.x instead helps you to develop and deploy any kind of asynchronous applications. It's true that modern versions of Tomcat support asynchronous servlets, but Vert.x comes with a far larger amount of user friendly asynchronous APIs plus other goodness:

  • Complete Filesystem asynchronous API
  • TCP (server and client)
  • UDP (server and client)
  • HTTP(S) (server and client)
  • Shared data service (share objects between polyglot modules)
  • HA and Clustering
  • Cluster-wide messaging (event loop)
  • Event bus bridge (the extension of the event loop to browsers via SockJS)
  • A growing ecosystem of Vert.x modules
  • Possibility to embed Vert.x in legacy code
  • Leveraging the existing rich and solid ecosystem of Java libraries (Vert.x runs on the JVM, unlike Node.js)

Personally I think learning Vert.x is very useful. At work I reused the same knowledge with great success to realise three very different products: a zero-copy ultrafast Redis proxy, a JPA-backed REST API, and a reactive single-page web application.

Have a look at the example code, it's pretty straight forward and the boilerplate is close to zero.

One more thing: where did you read Vert.x is single threaded? It's not true! Vert.x has a very neat concurrency model that makes sure all the cores are equally used (again, unlike Node.js).

Enjoy!

like image 106
sscarduzio Avatar answered Sep 22 '22 02:09

sscarduzio