I have a typical web application using Entity framework to interact with the database. Here is the break down of the app.
- Demo.Core [contains logging (nlog stuff), helper classes, system wide constants etc]
- Demo.Entities [contains the Entity framework entities or edmx files only- no contexts]
- Demo.Business [ contains the data manager, the EF context, business rules using NRules, validation and stuff]
- Demo.Web [contains the MVC app that is the front end]
Now I want to use Akka.NET in this app. I created an Engine class that encapsulates the Akka System actor and created a logging actor (Demo.Core). Iām thinking of engine as a class that has a send function which can be used system wide and the function than decides which actor is the most suitable to handle the message.
However, I'm unable to decide how to manage the Data context and entity classes in terms of akka.
- Should I have separate Actor for retrieving each type of entity? or one Actor for retrieving all entities?
- Should I have multiple actors with different contexts for different roles, for instance DBReaderActor & DBWriterActor or a single actor that has the contextto the database?
- Is it okay to have an engine that has a single send function as mentioned above or each class should call the appropriate actor itself?
- Can actors of a system be in multiple assemblies? like Demo.Core & Demo.Business?
If I run two instances of Demo.Web one on IIS and one on WebDev would they have 2 separate actor systems or a single actor system (they both use the identical code base)?
I'm a newbie in Akka.NET so please don't assume things when answering