Akka anti-patterns: logging (the wrong way)

Update: removed rogue toString call in the second code example, since it was unnecessary (and harmful). Debugging actor systems is no small feat, even when there is IDE support for it. In fact, debugging any asynchronous system for that matter is a rather complicated task. Which is why, especially during development, it is not entirely uncommon to rely on DEBUG … Read More

Akka anti-patterns: too many actor systems

Admittedly I’ve seen this one in use only one time, but it was one time too many. For some reason I keep seeing clients come up with this during design discussions and reviews though, therefore it makes it into the list of Akka anti-patterns. What I am talking about is this: Reasons I hear for this design: isolation of concerns: … Read More

Akka anti-patterns: race conditions

The actor model makes it possible to build highly-concurrent applications through the notion that actors obey the actor send rule and the actor subsequent processing rule, hence creating a single-threaded environment inside of an actor. That being said, it’s all an illusion: as we have briefly talked about previously, Akka’s dispatchers make sure that messages are being processed by actors … Read More

Akka anti-patterns: shared mutable state

When I work with clients on designing actor systems there are a few anti-patterns that seem to make it into initial, non-reviewed designs no matter what. In this series of short articles I would like to cover a few of those. Anti-pattern #1: sharing mutable state accross actors Even though the Akka documentation points this out in various places, one … Read More

A quick tour of JSON libraries in Scala

Update (18.11.2015): added spray-json-shapeless library Update (06.11.15): added circe library Some time ago I wrote a post on relational database access in Scala since I was looking for a library and there were many of them available, making it hard to make a choice. It turns out that the situation is similar if not worse when it comes to JSON … Read More

A handful Akka techniques

I’ve been using Akka for 3 years in a variety of projects and by now, I have a hard time imagining to deal with some of the parts of my work without it. Sure, Scala provides other powerful paradigms for dealing with concurrency, but I find Actors to be one of the most elegant concept when it comes to reasoning … Read More

A quick tour of relational database access with Scala

Update: Added Squeryl, thanks to @JoeZulli for the heads-up Update 2: Added link to latest Squeryl release for Scala 2.10 and 2.9.2 I recently started working with relational databases again from within Scala, after a while in JSON-land (mostly MongoDB and elasticsearch). During that time, I’d been happily working with lightweight libraries / DSLs that take care of case class … Read More