Designing Akka.NET Applications from Scratch Part 2: Hierarchies and SOLID Principles

Decomposing Complex Domains into Understandable Actor Hierarchies

In the first post in this series, we discussed how the correct place to begin thinking about an Akka.NET application is actually with your data flows and organizing those into reusable “protocols”. Once that’s done, then it’s time to start slotting actors into some of the interaction points inside the protocol.

But what happens when certain types of interactions are complicated and can’t easily be expressed inside one actor? Or what happens if you need to accumulate state for each individual instance of the protocol?

Think of a protocol like a class. A protocol is a logical unit of encapsulation that expresses some defined behaviors, inputs, and outputs. And just like classes, protocols can be composed - one class can have members that are of another type of class. Small protocols can be combined with other protocols to build large, system-defining behaviors. This is generally how stream processing architectures are actually designed at scale.

An instance of a class is called an object in OOP. In protocol-driven design a “protocol instance” is an instance of a protocol, just like how a class is instance of an object.

Actor Hierarchies and Protocols

A protocol consists of multiple different interactions and can have totally different flows depending on the state of each particular protocol instance. Your Akka.NET actor system can theoretically run hundreds of thousands of concurrent protocol instances at the same time. It’s the goal of a well-designed actor hierarchy to make it performant and easy to manage.

So the first rule of thumb when it comes to designing an actor hierarchy is once again: separate your concerns.

Brute actor hierarchy

It’s pointless to attempt to design an entire end-to-end actor system before you’ve written any code, because you don’t know what you don’t know yet....

Free Webinar on September 26th: Introduction to Akka.NET and Akka.Cluster

The Business Case and Power Behind Akka.NET and Akka.Cluster

On Monday, September 26th at 8:00am PDT Petabridge will be hosting a free webinar entitled Introduction to Distributed Systems with Akka.NET with Akka.Cluster - the goal of which is to help educate developers, architects, and technology executives on how these technologies can be used to build highly available, distributed systems.

Introduction to Akka.NET and Akka.Cluster

We’ve never hosted a live webinar on the subject before and it’s a regularly requested topic - and if this one is popular we’ll definitely do another in the future on Akka.Cluster and other areas such as Akka.Persistence, Akka.NET DevOps, and so forth.

What We’ll Cover

This presentation is 90 minutes long and will be focused on the architectural concepts and possibilities that Akka.Cluster creates. Specifically:

  • Why businesses are adopting Akka.Cluster and why this technology is desperately needed;
  • How distributed systems are designed using Akka.NET actors and message-based systems;
  • What Akka.Cluster does to make this easy; and
  • How Akka.Cluster synergizes with modern deployment environments, such as Windows Azure Resource Manager, Azure Service Fabric, * Kubernetes, Apache Mesos, and so forth.

Seating is limited. We still have some room available, so please register now: click here to register.

We’ll be taking questions from the audience at the end of the presentation too!

N.B. the material we’re presenting in this webinar does have some overlap with our Akka.Cluster training, but is mostly new material. If you’ve attended our Akka.Cluster training in the past you will still get value out of this talk.

In Case You Can’t Attend

If you aren’t able to attend due to timezones or conflicts, go ahead and register anyway - we’ll send you a recording later the same day.

If you have any questions or comments, please leave them...

Case Study: DigiOutsource Uses Akka.NET to Grow Revenue by 35%

Large-Scale, Real-time Complex Event Processing with Akka.NET

Our last customer case study “Akka.NET Goes to Wall Street” remains as one of the most popular articles on Petabridge, and today I’m pleased to share with you a new case study written by Kim-Lisa Gad and the DigiOutsource team from sunny Cape Town, South Africa.

The DigiOutsource team, lead by Jean-Pierré Vermeulen, developed an extremely high-speed complex event processing system real-time customer analysis system on top of Akka.NET from conception to production within 5 months, and that system has gone on to increase overall revenue by 35%.

What follows is their story!