J
J
javax2018-09-23 12:06:03
Java
javax, 2018-09-23 12:06:03

What architecture and framework to choose for a reactive java application?

Help me choose an asynchronous web framework for Java and understand the right architecture.
1. When choosing a framework, is it important that our application is completely stateless? Those. we do not need to monitor the security of access to the state of services, everything is thread safe.
2. If the services are synchronous and I call them asynchronously (like executeBlocking in Vertx), is it worse for performance (or something else) than asynchronous services (using reactive HTTP clients and JDBC drivers)?
Is there a difference between Vertx and WebFlux in this respect?
If there is no difference, then why not write synchronous services (they are easier to write and test this way) and then call them asynchronously from the controller layer?
3. I like it better when the controller layer in the framework returns a result (like Mono/Flux in WebFlux or Future in akka-http), compared to writing onHandle() in Vertx.
So, it seems to me, more readable and less code. Am I right or am I missing something?
If I'm right on 2 and 3 - what framework would you recommend?
If not right - why? Again, what framework would you recommend?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
�
âš¡ Kotobotov âš¡, 2018-09-24
@javax

1. For a reactive approach, yes is important.
You do not have a dependent state in case of a separate failure in a separate node, you can easily restore the operation of the node, without much trouble, this is part of the approach.
2. For performance per request - asynchronous calls are always worse. We don't make requests asynchronous to get the most out of a single request. Asynchrony opens the way to parallelization (since there is no dependency, requests can be executed in any order, including in parallel), such requests increase the responsiveness of the system (interface), better distribute the load.
3. Working with callbacks has always been a pleasure, function composition is of course more preferable.
----------
to create a reactive architecture traditionally - akka, play, kafka (all this works with java as well)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question