Bharadwaj Bharadwaj - 1 month ago 12
Scala Question

Difference in message-passing model of Akka and Vert.x

Am a Scala programmer and understand Akka from a developer point of view. I have not looked into Akka library's code. Have read about the two types of actors in the Akka model - thread-based and event-based - but not having run Akka at large scale I dont have experience of configuring Akka for production. And am completely new to Vert.x. So, from the choices perspective to build a reactive application stack I want to know -


  1. Is the message-passing model of Akka and Vert.x very different? How?

  2. Are the data-structures behind Akka's actors and Vert.x's verticles to buffer messages very different?


Answer Source

In a superficial view they're really similar, although I personally consider more similar vert.x ideas to some MQ system than to akka... the vert.x topology is more flat: A verticle share a message with other verticle and receive a response... instead akka is more like a tree, where you've several actors, but you can supervise actors using other actor,..for simple projects maybe they're not so big deal, but for big projects you could appreciate a more "hierarchic system"...

vert.x in the other hand, offer a better Interoperability between very popular languages* , for me that is a big point, where you would need mix actors with a MQ system and dealing with more complexity, vert.x makes it simple and elegant..so the answer, which is better?...depend, if your system will be constructed only over scala, then akka could be the best way...if you need communication with javascript,ruby,python,java,etc...and don't need a complex hierarchy, then vert.x is the way to go..

*(using json, which could be an advantage or disadvantage compared to )

also you must consider than vert.x is a full solution, tcp,http server, routing,even websocket!!!, that is pretty amazing because they offer a full stack and the api is very clean...if you choose akka you would need use a framework like play, xitrum o spray..personally I don't like any o them

also remember than vertx is a not opinionated plataform, you can use akka or kafka with it, for example, without almost any overhead, the way how every part of the system is decouple inside a verticle makes it so simple...

Vert.x is a big project with an amazing perspective but really new, if you need a solution now maybe it would not be the better option, fortunately you can learn both and use both in the same project ...