Discussion about this post

User's avatar
Denys's avatar

My experience with actors in embedded telecom contradicts several points of your article:

> Idempotent Design: Messages can be safely retried without unintended side effects.

- This is going to be very hard to achieve. You cannot synchronize states of actors. One actor cannot know the current state of another actor. And if it queries the state, it may change any moment. Thus, for something like money transfer, you cannot write transfer(42, source, destination). You cannot do destination.Set(destination.Get() + 42). You are left with destination.Add(42) which is not idempotent.

> Actors can host multiple interconnected state machines, creating complex yet manageable system behaviors. They are the protected enclave of order.

- It's just the opposite. Actors are chaos incarnate. There is no way to make them behave as you want like them to because unrelated events sneak in and change their states to nobody knows what while you were running your complex use case. And an average actor gets scores of event handlers, each of which implements pieces of logic from several unrelated use cases. The code is unintelligible because every use case is scattered all around the whole source file.

> Aggregation involves thinking of your actors as part of a graph, where smaller, downstream actors notify upstream actors about important events, metrics, or states.

- There was an old pattern Presentation-Abstraction-Control. It's long dead and buried, probably not for no reason. You have just outlined it.

Expand full comment
1 more comment...

No posts