Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finagle and Akka, why not use them together?

I have not used Finagle nor Akka in practice, but I have been reading a lot of about them.

Finagle being a RPC system and Akka a toolkit for highly concurrent applications, why all the people compare them as two possible solutions which cannot be used together? All searches I've done propose to use one or the other, no one proposes to use them together.

Finagle, for example, has a very interesting way of defining endpoints via thrift and its IDL. With this IDL we could define a custom endpoint and through scooge or whatever code generation tool, it would be possible to have a service with no effort. Also a client to connect to this service is created with a lot of common client issues automatically resolved (reconnection, timeout, retries, load-balancing, connection-pooling, ...).

Akka instead, solves a lot of concurrency headaches and it scales extremely well without all the complexities of hand controlled threading.

As a summary, why not use them together?:

  • Finagle + Thrift (with its IDL): It facilitates service design and development as well as deployment (which includes ease of scaling-out).
  • Akka: It uses all the server power through its Actor system and it scales extremely well if I change server properties (for example if it's deployed on EC2 and I convert my node from m1.small to m1.large).

What do you think?

NOTE: Asume that the issue of mapping Futures and Promises is resolved, as well as a mismatch between FuturePools and ExecutionContexts. The pattern would be to convert Finagle to the scala way of using Futures.

like image 901
Gorka Lerchundi Osa Avatar asked Dec 01 '13 09:12

Gorka Lerchundi Osa


People also ask

Does Twitter still use finagle?

Finagle is actively maintained by Twitter's infrastructure team, but we have many external contributors as well.

What is Akka used for?

Akka is a toolkit for building highly concurrent, distributed, and resilient message-driven applications for Java and Scala. Akka Insights is intelligent monitoring and observability purpose built for Akka.


1 Answers

You are right in that service discovery and service implementation are orthogonal concerns, and I can follow your argument about using Finagle for the former and Akka for the latter. You could in principle use the two together without seeking a grand unification of futures, since you only need to send the service’s reply back to the requesting Actor in a message, i.e. you would need to add your own little “pipeTo” pattern on top of Twitter futures.

like image 128
Roland Kuhn Avatar answered Oct 11 '22 13:10

Roland Kuhn