As you say, "it depends". In particular, it depends on *how* massive "massive" is.
As an example: my application's central Actors *can* get fairly large -- they're anywhere from a few K to several Megabytes in size. Akka handles that level of scale with reasonable aplomb -- I haven't hit any issues to date. In general, Akka doesn't care too much about how much data any given Actor is carrying; that sort of thing mostly shows up as a tuning parameter for your cluster. That said, yes, you should spend some attention on potential snapshot size. I vaguely recall that Cassandra can get a bit iffy somewhere around 10 Meg/record, so I am careful to compress my snapshots when I serialize them. I would certainly be concerned if snapshots were getting into the 100 Meg range, and it's worth thinking about your requirements and maybe doing some research into the DB and plugin you're planning on using. (I don't think Akka Persistence itself has any particular limits, but it has to operate within the limits of the underlying DB.) And yes, you *can* do without snapshots, but that comes at a cost when it comes to recovery speed. I would personally be cautious about a no-snapshot approach unless I was confident that the Actor isn't going to have than, say, 10k events over its lifetime. On Thu, Feb 16, 2017 at 5:30 AM, Matteo <[email protected]> wrote: > Hi, > > I read the Akka documentation about actors and streams abstraction and I > found it very enlightening and fascinating. The only aspect that I did not > completely understood is what is the best approach to deal with massive > states within actors. > > > Let’s say I have a client application that shows all visible assets of a > given type (e.g. connected products or sensors of some kind) for the > currently logged-in user. The list of visible assets could be seen as the > state of a persistent actor that manages the lifecycle of the assets for > specific user / tenant. Now, this state is potentially very big and it > could contains tens of thousands entries (i.e. tens of thousands of > assets). If I got it right, this actor could be seen as a projection of a > underlying event store that shows the list of user accessible machines. My > doubts are: > > > 1. Is this a suitable use case for Akka? Or Akka assumes that the state > associated with an actor is small in size and lightweight? > > 2. The snapshots generated by the actor could be quite big: is this a > concern in terms of serialisation to and from the underlying snapshot > storage? > > 3. To solve snapshots ser/deser overhead one could avoid them all > together. But in this case the portion of the journal that is used by the > actor increases indefinitely. In this case I wonder what is the cost of > recovering. > > > I understand that there are a lot of "it depends" answers for these > questions, but I would like to get the right principles to apply when > dealing with these scenarios in Akka and the potential pitfalls. > > > Thank you! > > matteo > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/ > current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
