TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Thinking in Actors – Challenging your software modelling to be simpler

135 点作者 jeremycarter6 个月前

10 条评论

jonathanpglick6 个月前
This is where erlang&#x2F;elixir really shines! Using actor processes (aka genservers) to model business workflows and logic helps to align the programmer&#x27;s and stakeholder&#x27;s shared understanding and language of a feature, which leads to the implementation and expectations about it to be much more &quot;correct&quot;.<p>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 &quot;time&quot; are way more important than database layout at that point.<p>And please either use operation explicit types and&#x2F;or finite state machines when modeling the main domain objects.<p>My last three jobs started with untangling a bunch of &quot;status&quot; 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&#x27;s the secret sauce!
评论 #42373802 未加载
karmakaze6 个月前
I suspect that a lot of what can be done with actors can be done in Go using the &quot;Don&#x27;t communicate by sharing memory, share memory by communicating&quot;. Basically a consumer of a channel can act like an actor. What we don&#x27;t get for free is the activation and resiliency. A closer one would be Erlang&#x2F;Elixir on the BEAM. On the more advanced end would be using F# or Pony.<p>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.
评论 #42296335 未加载
评论 #42293982 未加载
评论 #42294447 未加载
phtrivier6 个月前
&gt; 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.<p>And that&#x27;s the part I never managed to solve, personally. The state of actors tend to look &quot;a lot like&quot; your domain objects, but you don&#x27;t want to store it until the very end.<p>Do you have a data-model for each actor to store their own snapshots ? When do you snapshot ? When do you sync with the &quot;ground truth&quot; ? Do you have different tech for each kind of state (eg &quot;term storage&quot; for actors, then relational db for ground truth ?)
评论 #42296759 未加载
评论 #42296375 未加载
LaserToy6 个月前
I love actors as a concept and I heard some large companies (Expedia) implemented large parts using them.<p>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.
评论 #42295199 未加载
评论 #42296928 未加载
评论 #42297935 未加载
yodon6 个月前
Huge fan of building systems on top of Orleans Actors (one of the tools discussed in the article)
dboreham6 个月前
Some background: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Communicating_sequential_processes" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Communicating_sequential_pro...</a>
评论 #42294722 未加载
dirtbag__dad6 个月前
Does anyone care to share an example of the OrderService that is not anemic?
评论 #42292358 未加载
评论 #42293622 未加载
jatins6 个月前
is this AI generated? I flagged because seemed very low on substance and just generic bullet points
评论 #42302623 未加载
评论 #42294790 未加载
评论 #42295034 未加载
ibgeek6 个月前
The article seems to be smashing together two (seemingly) unrelated topics and doesn&#x27;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&#x27;s not clear that the issues presented require or substantially benefit from the actor model without seeing a best in-class OO example.
评论 #42292433 未加载
kiitos6 个月前
<p><pre><code> 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. </code></pre> The system model in which each actor instance is single-threaded, processes received requests individually and sequentially, and can &quot;crash&quot; in a way that affects only the in-flight request, is a total anachronism, irrelevant since more than a decade, at any meaningful scale.
评论 #42293604 未加载
评论 #42293580 未加载