After some consideration I ended up seeing that Service Fabric Actors is probably the best way to start. Now, I'm wondering if I'm approaching this the right way.
Below, is the structure i came up with.
I have a Stateless Service (DeviceCalculatorManager) which is responsible for mapping the received events to the correct Actor Service (DeviceCalculatorActor). Then, the write operations are taken care of by a different actor, the DeviceWriterActor which takes care of the write operations in either SQL Database, Queues or any other more intensive write operation.
Assuming each actor is independent from other Actors, Is it required to perform transactions over StateManager? I don't think so because its always guaranteed 1 Actor has only 1 Thread running or am I missing something here? The Async methods don't release the lock of the Thread, is this correct?
I wanted to use some sort of ordered queue to store pending events to process for each stateful service. Like the DeviceCalculatorActor would receive events from DeviceCalculatorManager and store them in a queue before it begins processing it. Whats the best way to implement this? I think this is important in cases when Services want to shutdown and process the events in a later date.
Note: The DeviceCalculatorManager is a stateless service because I'm not storing any information that is relevant about the used Actors. Since Service Fabric maintains its own Actor's table for management. If you see I should approach this service differently I guess this counts as the 3rd question.
Thank you in advance.