Akka! Redux

As predicted, I’ve come down off my Akka-is-the-solution-to-all-of-life’s-problems programmer’s high. Don’t get me wrong. It’s still very slick, and the benefits that you can get from it – fault tolerance, distributed deployment and clustering to name a few, are substantial and valuable. And they are definitely where the industry needs to go. You can do this all yourself of course, and you can use other tools, but Akka brings them all together. Having to learn how to use fewer tools for the same job(s) is a big deal.

My problem with Akka has nothing to do with what Akka is or how it works or what it claims to be. My problem is that in order to get all those amazing features, you have to pay for them. And the price is high. Akka’s learning curve is moderate, but the way that it makes you change how you work and how you think about solving problems is considerable. You have to re-learn how to do even simple things.

Akka is an actor-model system. The concept of an actor is very similar to a class, except they communicate by asynchronous message passing. If you have an actor reference in code, all you have is an object that you can send messages to, or request responses from. That’s pretty much it. You can’t add your own properties. (Well, you can, but it would be a horrible hack.) One of the suggested design patterns for Akka (according to Petabridge, a company that supports and trains Akka users) is that of the child-actor-per-entity-object. You *can* use Akka to model your data. But it’s bloody hard. You cannot write code like:


Instead, to access properties, you have to send a message to your employee actor reference telling it what to do. That is simple enough for console output, but it exponentially gets harder when you want to do something more complex… until you spend enough time that you start thinking the way Akka wants you to think. Is that worth your time? Is it worth the time of your coworkers and other people who will have to maintain the Akka code? Maybe. But you need a compelling argument in support of Akka if you want to go down that road.

Leave a Reply

Your email address will not be published. Required fields are marked *