I'm in mess about the applicability of Akka Persistence, and the persistent actors, when I should use a persistent Actor?
Taking for example from a Cart module of a given Shopping Application, will be every user's Cart Session a persistent actor with respective unique persistenceId?
What's the usability in real applications? How the query side handles the state of the persistent actor? When the persistent actor is not useful in real applications?
Storing states or store messages, are the same thing? Aren't? What's the difference, when I should use each one?
Can someone give me some examples?
This is going to be highly opinionated question, and highly opinionated answer.
Imagine that you have a task management system, e.g. Jira or alike. Let's say you have a following layout of actors:
If projects and tickets are actually persistent actors, then you have, compared to the standard approach (query etc), the following benefits:
The usefulness comes from design of your application - some are well-suited (i.e. multiple separate or loosely coupled entities), some are not so well (i.e. you want to just store the single last set of data and generate a predefined report of it)