Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple actor systems for an application

Tags:

scala

akka

This article talks about how we should not create 'too' many actor systems. But the docs say:

An ActorSystem is a heavyweight structure that will allocate 1…N Threads, so create one per logical application.

I am unable to understand what is the real issue here with using multiple actor systems in an application. Also, is it possible for actors from different actor system to message each other?

like image 775
codingsplash Avatar asked Dec 21 '16 03:12

codingsplash


People also ask

What is akka actor system?

Companion object ActorSystem An actor system is a hierarchical group of actors which share common configuration, e.g. dispatchers, deployments, remote capabilities and addresses. It is also the entry point for creating or looking up actors. There are several possibilities for creating actors (see akka.

Who is responsible for handling a request of actors?

There will be one actor. Which we call receptionist. And this one, is responsible. For accepting incoming requests.

What is akka architecture?

Akka is a toolkit and runtime for building highly concurrent, distributed, and fault tolerant applications on the JVM. Akka is written in Scala, with language bindings provided for both Scala and Java. Akka's approach to handling concurrency is based on the Actor Model.


1 Answers

There is no issue with using multiple systems. There is a potential issue with creating too many of them. The reason is that with an ActorSystem comes some non-negligible overhead - mainly because each one would allocate its own fork-join pool.

I recommend you read this blogpost for more info.

Actors from different ActorSystems can message each other, but AFAIK this needs to happen through remoting. This counts as yet another reason why system segregation doesn't really make sense as a local pattern.

like image 52
Stefano Bonetti Avatar answered Sep 28 '22 17:09

Stefano Bonetti