1

The Akka.Net cluster requires a single ActorSystem but if what if I have several ActorSystems (Distributed Apps) that need to coordinate synchronously or asynchronously?

How to handle shared message libraries? Perhaps it would be best not to share anything (other than a generic message library) and use a dynamic message, such as: DynamicJsonMessageBase.

How to handle service discovery?

Background: I am designing a microservices architecture using Akka.Net that will probably employ Lighthouse for discovery, REST HTTP API for backend agents/portals, and incorporate a transport mechanism for sending/receiving messages to non-Actor services.

alturium
  • 548
  • 5
  • 15

1 Answers1

1

Usually your cluster consists of multiple actor systems. However in Akka.NET clusters can be heterogeneous, which means that nodes (actor systems) may differ from each other in terms of performed operations and loaded assemblies. To differentiate them in this regard, you can configure each actor system with different set of roles.

Cluster roles can also be used to limit the communication between nodes when updating the code inside the cluster - so that nodes with the older code won't try to talk with the updated ones. This allows to perform incremental update of the cluster without shutting it down.

Service discovery is the best achieved using third-party provider, which already enables such thing i.e. Consul, Azure Service Fabric, etcd or Zookeeper.

Bartosz Sypytkowski
  • 7,463
  • 19
  • 36
  • My understanding is that there can only be on ActorSystem per cluster. – alturium Oct 23 '16 at 21:30
  • All actor systems must share the same name within a cluster. But cluster itself should be able to span across multiple machines (what cluster would it be otherwise?). That's something rather hard to achieve having only one `ActorSystem` in a single process. – Bartosz Sypytkowski Oct 24 '16 at 07:02
  • The question is about communication or transport between clusters not within a cluster, which would follow your points. But I think you are missing the point of the question. – alturium Oct 24 '16 at 08:15
  • You can use [cluster client](http://getakka.net/docs/clustering/cluster-client) from Akka.Cluster.Tools package, which allows you to communicate between actor systems living in different clusters. But for most of the time heterogeneous clusters remove the need for using cluster capabilities from the outside of it. – Bartosz Sypytkowski Oct 24 '16 at 08:34
  • That looks like a good possibility. The cluster client relies on akka.remoting but I'm concerned about performance. The docs state it can take several minutes to send a message. Also, since I am building a microservice architecture I am also concerned about independence and isolation of each cluster. That is, I would like to ensure that I can update one (new image, different akka libraries, etc) without updating other clusters. ~ I like your point above it using roles for versioning within a cluster! – alturium Oct 24 '16 at 16:18
  • This article is an excellent description of what I would like to build (just found it): https://tech.iheart.com/why-we-picked-akka-cluster-as-our-microservice-framework-bbf3019a3217#.6en7aosqa. Nodes are microservices and the cluster has actor agents to handle external communication but ezequiel didn't answer the comment requesting communication details. And that is where I am at. – alturium Oct 24 '16 at 16:37
  • Oops the articles author is Kailuo Wang. – alturium Oct 24 '16 at 16:40