Hi Ashley,
On 05.05.14 17:44, Ashley Aitken wrote:
Howdy All,
This is my first post and I am new to Akka and Scala but very excited
about using Akka Persistence and CQRS / ES for a new Web application I
am developing.
Welcome!
I have been reading a lot about CQRS / ES and playing around with Akka
Persistence and have a few questions I hope you can help me with.
I am warming to the idea of Views being able to track the journal of a
Processor (sort of a compromise pub-sub that will work with replicated
journals). I assume Views are meant to build the read model.
However, I wonder how I am meant to maintain a View(s) for each
EventsourcedProcessor when there may be many Processors?
Take the classic example of aggregate root Order, with an EP
representing it. How does the View get constructed for each Order,
particularly if there are a very large number of Orders? Do I just
create one (or more) Views each time an Order is created and let them
sit around (and go inactive / idle)?
I know Actors don't take up much memory when inactive / idle but if I
have a whole lot of Orders do I really need a separate View(s) for
each. Wouldn't it be better to have some sort of generic OrderView
that can handle event from any Order's journal?
This has already been discussed in several times in other threads on
akka-user. There is also a ticket https://github.com/akka/akka/issues/15004
It could singularly then manage a denormalised Order store.
Similarly, I guess for the domain model. Will my EPs for particular
aggregate roots be created each time I need to access them or do they
live forever as Actor in the name space / paths? It seems like I have
two stores representing the entities (journal for data and Actor name
space / path for identity) .
It is the processorId that identifies the persistent actor (in the
journal). A persistent actor can have many incarnations (with the same
processorId) though.
Finally, I believe I would like to track all the events that get added
to the entire journal (treating it like a combined log). Is that
possible? Is it one big log-like thing or are there really separate
journals for each Processor?
Each processor has its own logical journal, although journal plugins
maintain them in a single physical backend store (replicated or not).
This is not a requirement but all plugins follow this pattern so far.
So, from a physical viewpoint there's a single big message store but
this doesn't mean that there is a global ordering of messages. An
ordering of messages is only defined within a processor (i.e. logical
journal). Messages from different processors are seen as unrelated by
akka-persistence.
Similarly, what about a View that tracked changes to all Orders and
all Receipts?
My understanding is that the Views will be used to update the read
model (e.g. some denormalised store, like MongoDB optimised for client
querying).
Yes, views are there to maintain read models. They may also keep state
in memory (and take snapshots) since it can be recovered by replaying
messages (optionally starting from a snapshot).
It seems to me that the handling of such updates would be better done
by a few Views rather than one for every aggregate root.
Views that track updates from many processors make absolutely sense and
have already been requested several times (see ticket).
Please explain what I am missing.
I hope those questions make sense and many thanks in advance for any
comments or suggestions.
Thanks,
Ashley.
--
>>>>>>>>>> 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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
--
Martin Krasser
blog: http://krasserm.blogspot.com
code: http://github.com/krasserm
twitter: http://twitter.com/mrt1nz
--
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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.