• by jonathanpglick on 12/2/2024, 4:37:06 PM

    This is where erlang/elixir really shines! Using actor processes (aka genservers) to model business workflows and logic helps to align the programmer's and stakeholder's shared understanding and language of a feature, which leads to the implementation and expectations about it to be much more "correct".

    Too many of us jump straight to modeling the domain objects as database tables without formalizing the the data model of the actual business need. Explicit state changes and considering "time" are way more important than database layout at that point.

    And please either use operation explicit types and/or finite state machines when modeling the main domain objects.

    My last three jobs started with untangling a bunch of "status" fields into explicit and hierarchical structures so that the whole company could agree and define what each of them actually meant. Common language, yo! It's the secret sauce!

  • by karmakaze on 12/2/2024, 3:35:58 AM

    I suspect that a lot of what can be done with actors can be done in Go using the "Don't communicate by sharing memory, share memory by communicating". Basically a consumer of a channel can act like an actor. What we don't get for free is the activation and resiliency. A closer one would be Erlang/Elixir on the BEAM. On the more advanced end would be using F# or Pony.

    Curious to see what the follow-up parts will post. I am interested in actor model programming and want to see different ways of understanding and using them.

  • by phtrivier on 12/2/2024, 12:05:48 PM

    > State can be persisted (e.g., to storage, database or event log) between messages. If an actor crashes, it can recover its state on another node and resume processing.

    And that's the part I never managed to solve, personally. The state of actors tend to look "a lot like" your domain objects, but you don't want to store it until the very end.

    Do you have a data-model for each actor to store their own snapshots ? When do you snapshot ? When do you sync with the "ground truth" ? Do you have different tech for each kind of state (eg "term storage" for actors, then relational db for ground truth ?)

  • by LaserToy on 12/2/2024, 4:36:52 AM

    I love actors as a concept and I heard some large companies (Expedia) implemented large parts using them.

    But I also saw how hard it is to understand a large system that built using actors. It is just hard to comprehend all the communication pathways and what happens in the system.

  • by yodon on 12/2/2024, 1:12:57 AM

    Huge fan of building systems on top of Orleans Actors (one of the tools discussed in the article)

  • by dirtbag__dad on 12/2/2024, 1:20:49 AM

    Does anyone care to share an example of the OrderService that is not anemic?

  • by jatins on 12/2/2024, 10:22:16 AM

    is this AI generated? I flagged because seemed very low on substance and just generic bullet points

  • by ibgeek on 12/2/2024, 2:00:21 AM

    The article seems to be smashing together two (seemingly) unrelated topics and doesn't offer much in the way of a solution. What alternative design does the author propose? Is it possible to solve the problem with traditional object-oriented design techniques? It's not clear that the issues presented require or substantially benefit from the actor model without seeing a best in-class OO example.

  • by kiitos on 12/2/2024, 5:53:57 AM

        Isolation: Since actors process messages they receive sequentially, there are no concurrency issues within an actor. This simplifies reasoning about state mutation and transitions.
        ...
        Fault Tolerance: State can be persisted (e.g., to storage, database or event log) between messages. If an actor crashes, it can recover its state on another node and resume processing.
    
    The system model in which each actor instance is single-threaded, processes received requests individually and sequentially, and can "crash" in a way that affects only the in-flight request, is a total anachronism, irrelevant since more than a decade, at any meaningful scale.