Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Webflux vs Vert.x

We need to start working on a microservice with an initial plan to use Vert.x for the same. With the recent Milestone releases of Springboot 2.0 including the Reactive support, we are now also considering Springboot 2.0 as an option, but since this is a very new release I have some concerns on the stability of this release. Has someone already used Spring Webflux / Reactive support, how was the experience, any known issues / trouble while implementing this. Any specific suggestions/recommendations are welcome.

like image 793
piyugupt Avatar asked Dec 08 '17 09:12

piyugupt


People also ask

Is Vert X better than spring?

After all, Spring is still the most popular JVM framework by far, so lots of companies use it. But Spring Framework isn't known for its performance. Vert. x, on the other hand, is considered as one of the top-performing JVM frameworks.

Should I use spring WebFlux?

Spring WebFlux is a good fit for highly concurrent applications, applications that need to be able to process a large number of requests with as few resources as possible, for applications that need scalability or for applications that need to stream request data in a live manner.

Is Vert X dead?

rest assured the project is not dead (we're releasing 4.0 in the coming months and Vert. x has become the network engine for Quarkus) the community is still very strong and vibrant (users helping each other on the forum and significant features are actually contributions)

Is Vertx faster than spring boot?

Again as expected, Vert. x is significantly faster. Due to the use of fewer threads, Vert. x non-blocking approach performs a lot faster than Spring Boot that needs to create at least 100 parallel threads in this example.


1 Answers

when you said microservice that means it will be microservices, in that case, you can mix things(polyglot) and if anything goes wrong rewrite that particular service and swap-out the existing one (here).

Now coming back to your original question Vert.x and Spring 5 both have their own Pros and cons (no silver bullet). Personally, I prefer Vert.x for its simplicity and on-demand dependency. I have seen few benchmarks where Vert.x was faster (a little) than Reactive spring and the reason is obvious. But Spring has Huge community support and tons of out of the box configuration, (you just annotate your class and make some changes in configuration and that's all to spawn a service !!!).

You can mix things like use spring to Write Authentication and Authorization services (for example Implementing OAuth 2 in spring is insanely easy.) And then write your other services in Vert.x. Again these are architectural decision that a third person(me) can't decide remotely without having any idea of your requirements.

It is quite hard to choose among them, its best to go with the right tool for the right job that's the reason behind microservices over growing popularity.

ps: What I wrote was from my personal experience and realization. Opinions may vary person to person and I don't claim to be one-hundred percent right.

like image 85
Arko Avatar answered Sep 21 '22 05:09

Arko