Being a complete noob to the actor model way of doing things, I a struggling to understand how I would store transaction history in an Actor Model. In the example from ProtoActor Persistence (https://github.com/AsynkronIT/protoactor-dotnet/blob/dev/examples/Persistence/Persistence/Program.cs) the child actor produces a bunch of random names like this:

public Task ReceiveAsync(IContext context)
        case Started _:
            context.Self.Tell(new LoopParentMessage());
        case LoopParentMessage msg:
            Task.Run(async () => {
                context.Parent.Tell(new RenameCommand { Name = GeneratePronounceableName(5) });
                await Task.Delay(TimeSpan.FromSeconds(2));
                context.Self.Tell(new LoopParentMessage());

    return Actor.Done;

And the parent then updates it's state like this:

private async Task Handle(RenameCommand message)
    Console.WriteLine("MyPersistenceActor - RenameCommand");
    _state.Name = message.Name;
    await _persistence.PersistEventAsync(new RenameEvent { Name = message.Name });

The question is, in an actor model, how should I store and retrieve a list of the previously generated names to display to the user.

Do I just store them in a separate database table? That seems a bit wasteful because I have already stored the events in the Event Store. So then should I use the Event Store as the journal? That also feels like I am mixing concerns of the events.

Another way of asking this: If I have a bank account modeled as an actor, how should I store the transaction history so that I can show it in the UI and not just the current balance?

  • 3
    It's unclear to me what you think the problem is here. If you've already stored the information you need somewhere, why on earth would you not make use of it? Commented Aug 3, 2017 at 15:53
  • @RobertHarvey that is what is unclear to me too. I have looked at Akka.net, ProtoActor and Project Orleans and none of them have a clear way to query the events that have been stored. Nor can I find a single demo example on the web showing the transaction history being queried. I suspect I am just missing something obvious or thinking about this wrong
    – Geoff
    Commented Aug 3, 2017 at 20:06
  • 1
    In any other system not using the Actor model, yes, you would have to store this information in the database. Your question says you're storing this information in the Event Store. Why can't you retrieve it? Is the Event Store write-only? That doesn't seem very useful. Commented Aug 3, 2017 at 20:22
  • So in the all the actor systems that I have looked at, the interface for the event store is more about restoring state by replaying the events than being an actual data store. Sticking with Proto.Actor, it seems as though the event store is set up to discourage the use of it for querying with its callback for the events. (github.com/AsynkronIT/protoactor-dotnet/blob/…) It feels like I am going against the grain here and that I am missing a more idiomatic way to do this.
    – Geoff
    Commented Aug 3, 2017 at 20:31

1 Answer 1


Use a table for each relation:

Actor Relational Database

To simulate the workings of one store, we created eight Store Section actors. For each, we loaded the inventory relation with 10,000 items and the purchase history relation with 300 entries per item for a total of 3,000,000 entries, simulating a history of 120 days where 500 customers on average visit the store per day and buy 50 items each. We fix the number of Group Manager actors to 10 and vary the number of Cart actors depending on the experiment. The number of Customer actors is set to 30 times the number of carts.


Not the answer you're looking for? Browse other questions tagged or ask your own question.