Live data from Hacker News

Ask HN: Are you using actors in production? Why/Why not?

news.ycombinator.com

11–20 of 29 posts

Re: Ask HN: Are you using actors in production? Why/Why not?

#11
I agree with the niche use case.

Using them in production here for 4 years (Akka) with our own actors that dynamically spawn each other depending on the load (along with some messages sent with timers).

You usually have to think about how to correctly handle lost messages or full mailboxes, but once you do, it usually works reliably.

I think actors are more of a low level concurrency Lego block you can use to build higher level stuff with (just like akka streams, etc.)

If you want to use them, I strongly encourage types actors, so unlike Erlang or Elixir and more like Akka or in the Pony language: it really helps with not missing messages because the compiler can make sure you don’t forget anything.

Akka monitoring is not great without paying for the monitoring tool, though.

Re: Ask HN: Are you using actors in production? Why/Why not?

#12
post #11

I agree with the niche use case. Using them in production here for 4 years (Akka) with our own actors that dynamically spawn each other depending on the load (along with some messages sent with timers). You usually have to think about how to correctly handle lost messages or full mailboxes, but once you do, it usually works reliably. I think actors are more of a low level concurrency Lego block you can use to build h…

How much of the value in actors do you think is related to the awesomeness of the Akka framework specifically? I only ask since it seems like there’s a decent correlation between people using Akka, and those that identify as using “actors”.

In general, I’m curious whether there’s significant value in someone who is using Node or Python (for example), to look for a way to use the actor pattern. Or if actors are primarily great when used along with platforms that specifically “elevate” this concurrency model? (e.g. Erlang/Elixir, Java/Scala, .NET)

Re: Ask HN: Are you using actors in production? Why/Why not?

#14
post #9

We use them both implicitly (underlying Akka Streams) and explicitly (both classic untyped actors and typed actors). For the explicit actors, we use them to model state machines around I/O (e.g. stateful protocols). I've found that the application area is fairly niche, as many patterns of async work are clearer through queues, futures, or streams. The use of actors is insulated from the rest of the application code t…

Are you using Akka for your explicit actors as well? And could you share the distinction between typed and untyped actors? Is that related to how the caller addresses/accesses methods on that actor?

Yes, we use Akka for all the actors.

Akka has two types of actors: typed and untyped. Typed actors allow the compiler to type check messages, while untyped (or classic actors) perform runtime checking. This also means references to actors can be typed, so if you have multiple implementations of actors that implement the same protocol, you can substitute between the different actors and verify the protocol at compile time.

https://doc.akka.io/docs/akka/current/typed/from-classic.htm...

I had played with Erlang before using Scala/Akka, so untyped actors were a familiar experience. My team decided to use typed actors going forward after an Akka version update since that seems to be the strategic direction of Akka (and it does help to have the compiler complain if we try sending a message that the actor doesn't understand).

Re: Ask HN: Are you using actors in production? Why/Why not?

#15

I'm using both Scala/Akka and Elixir in production. Once you get to better know the paradigm, you'll never ever want anyrhing else. And if by niche you understand resilient backends, yes, it's pretty niche then :)

Any insights that you’d want to share with someone not using Java/Scala or Erlang/Elixir? I’d love to get the benefits of actors in Node, Python or Go, but I’m not entirely sure what I’m missing yet.

Re: Ask HN: Are you using actors in production? Why/Why not?

#17
post #4

I have been using Akka in production for several years now and it's one of the best things I ever did. The actor model itself is really good, it makes you think about problems differently, and in my opinion it's better than traditional OOP. The only issue I have had with Akka is with the tooling around metrics/logging of async calls. The rest, what can I say, it's in production and I am barely on call because of issu…

Yeah the debugging story around async stuff is not ideal, but I don’t what part of the stack is really at fault there. I want what Tokio recently got.

Re: Ask HN: Are you using actors in production? Why/Why not?

#18

Life is but a stage, and we are all actors upon it. It's impossible to make many useful statements regarding architecture unless there is proper context. Goals, resources, constraints, expectations. Use the right tool for the job.

Then how do any of these distributed systems tools/frameworks write a meaningful or concise landing page? Making informed trade-offs are obviously important. But in a world of saturated information, it seems like there’s even more value in being hyper clear about what the purpose of a thing is? And even better, what it’s _not_. Unfortunately, many of these tools claim to be broadly applicable, in a way that makes it hard to understand their true purpose, without also investing significant time into them. That seems kind of unfortunate.

Re: Ask HN: Are you using actors in production? Why/Why not?

#19
post #14

Earlier quoted context omitted.

Are you using Akka for your explicit actors as well? And could you share the distinction between typed and untyped actors? Is that related to how the caller addresses/accesses methods on that actor?

Yes, we use Akka for all the actors. Akka has two types of actors: typed and untyped. Typed actors allow the compiler to type check messages, while untyped (or classic actors) perform runtime checking. This also means references to actors can be typed, so if you have multiple implementations of actors that implement the same protocol, you can substitute between the different actors and verify the protocol at compile…

Ah! That makes total sense. Thanks so much for that additional context.

Re: Ask HN: Are you using actors in production? Why/Why not?

#20

Earlier quoted context omitted.

Very dumb question: when you say backed by Akka, what exactly do you mean? That you’ve configured a “binding” between Flint/Spark and Akka, which spins up actor instances (Java/Scala classes?) whenever some events occur? Or that Flint/Spark use Akka behind the scenes?

They both use Akka behind the scenes. I don’t know the internal details exactly, but they’re both capable of showing you the processing pipeline you’ve asked for as a DAG visualization. I think what’s happening is something like each node on that DAG is an actor, receiving data from the previous node and sending it along to the next. You don’t write that though, you just write map/filter/etc.

flink uses akka for control plane kind of stuff. data plane stuff, like piping data between tasks, doesn't. check out https://flink.apache.org/2019/06/05/flink-network-stack.html for some (maybe outdated) details.
Post reply on HN