Akka Essentials Review
I’m using Play 2.0 a lot these days, and to fully understand its asynchronous nature, you have to understand Akka.
The book is best read when with a a basic understanding of Akka, for example using simple actors in a Play app. The reader should either know Java or Scala.
When reading the book for the first time, the introductory chapter can safely be skipped as it mainly contains technical terms that will only be explained in later chapters. The second chapter explain how to set up Akka and contains a full working example which only makes sense when having some prior experience with Akka. When Akka is used in a pre-configured system such as Play’s, this chapter can be also be skipped.
Starting with the chapters 3-4, the book displays its hands-on approach in that it teaches the reader to write and combine Actors. Nicely, all code examples are both in Java and Scala and show full working systems rather than trivial hello world examples (as often seen in other books). These two chapters about Actors and Typed Actors give you a good head start on how to use actors effectively.
After that the book slowly introduces the reader to the more advanced concepts. Scaling Akka is achieved by adjusting how the toolkit assigns work to threads (dispatchers) and how it distributes work among many actors (routers). The reader learns exactly how to configure Akka to optimize throughput, although the interplay between dispatchers and routers remains unclear.
The author now introduces us to the concept of Let it crash, Akka’s motto for fault tolerance. He shows how to build a hierarchy of actors, what supervision strategy to employ and how lifecycle monitoring works. Again, this all shown in code which makes the sometimes abstract language concrete.
The code also uses the pattern of wrapping state (i.e. mutable variables) inside actors. In the following chapter the reader learns how to handle state change with ACID transactions through various methods which can be a requirement in certain systems.
Finally, the reader gets taught how to scale out using remote actors distributed on several machines. An overview of deployment and monitoring (using the Typesafe Console and JMX) round off this book.
The writing style is generally easy to understand, and thanks to a lot of illustration both textual and visual learners can follow along. The author could have reduced the amount of buzzwords though, even if asynchronous non-blocking is hot at the moment, I’d rather have these terms explained in detail instead of repeating them over and over again.
The author uses circular definitions too often, for example "Akka uses the concept of location transparency, which means […] the location of the actor is transparent". An while the book explains the details of Akka, it sometimes forgets to paint the big picture.
There are some confusing anomalies in the book, for example around page 90 an excerpt from a the configuration file, here called "application.conf class", gets thrown at the reader, without explaining what it is, or the underlying Typesafe HOCON syntax.
I also had some problems reading the Kindle version, it contains some errors which are not present in the PDF version.
All in all, this book is a good way to get familiar with Akka and use it in your Java or Scala applications. So check out Akka Essentials to learn how to scale and manage your apps with this excellent toolkit. A sample chapter can also be found here.