The event bus allows the HTTP verticle to send a request to the database verticle that performs a SQL query, and responds back to the HTTP verticle - http://vertx.io/docs/guide-for-java-devs/
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/03be43a4-1946-4421-bf7a-4afd3388241f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
both are acceptable solution.For simplicity you can use a single verticle doing all operations.If you want to encapsulate database operations and make them reusable from somewhere else or test them then you can make two verticles and go EventBus.For performance, it is hard to speculate about the actual result as it depends on the application.Collocating on same event loop reduce latency but increase IO operations on the same event loop, so your server might have some of its requests that don't need database calls to be delayed more because the database access would use some of its IO.Also the database interactions latency will be impacted, so if you have a connection pool, then the connections will tend to stay out of the pool a little longer because it is sharing IO with the server and a connection pool can be a bottleneck in your application.So well, very hard to speculate about performance without having a real test / benchmark and measure :-)HTH
Julien
On 16 Jul 2019, at 17:43, Jonathan Willis <quicksi...@gmail.com> wrote:
I've seen a few examples of creating applications in vertx where there is an http verticle and a database verticle:The event bus allows the HTTP verticle to send a request to the database verticle that performs a SQL query, and responds back to the HTTP verticle - http://vertx.io/docs/guide-for-java-devs/https://www.youtube.com/watch?v=3_CRKfs4Zzo&t=1174s also does the same thing where a database verticle is setup.Why use a database verticle? Why not just have the http verticle receive the request and then whenever you need to go to the database switch schedulers (e.g. in rxjava switch to the io scheduler)?Is there a performance benefit? Testability benefit?--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ve...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/5b6651cc-4aca-47ca-bdc8-bfdd3092b740%40googlegroups.com.
Julien
To unsubscribe from this group and stop receiving emails from it, send an email to ve...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/082d358d-c83f-4c20-8046-3523722b51fd%40googlegroups.com.