Hi,

On 21 August 2014 at 20:28:35, Prakhyat Mallikarjun ([email protected]) 
wrote:

Patrik,

Thanks. 

You have given good directions to me.

Most of the apps will do queries or searches specific to domain or business. If 
business specific complex queries/searches are better solved in the backend 
data store, why akka persistence "PersistenceView" is required and should be 
still part of akka persistence?I am not doubting "PersistenceView" but want to 
understand why one would choose "PersistenceView" in design over simpler data 
store?


The PersistentView is not a data store in any sense of the word. It is a way to 
replay events from the journal in a simple way. Even if it is enhanced to 
support streaming of multiple id's or topics it is still can not be a 
specialized query model. PersistentView can be used to feed your data into a 
query model (maybe a normal SQL database or what fits your queries the best).

B/

Akka persistence is making write side of my application very simple to 
configure and implement. But when it comes to complex querying/searching I find 
myself lost. I find no simple solution. Thanks to Greg I have one solution 
"Projection" but still I am evaluating whether it will fit our app. I have 
questions to answer myself whether to use cassandra event store or gregs event 
store. If I use cassandra event store I wont be able to use Projections.....its 
getting complex for me.....

I am looking for most simple solution for 'Q' in CQRS from akka persistence 
with DDD approach.

If team is working on solutions, when can we expect?

-Prakhyat M M

On Thursday, 21 August 2014 22:14:03 UTC+5:30, Patrik Nordwall wrote:



On Wed, Aug 20, 2014 at 9:33 AM, Prakhyat Mallikarjun <[email protected]> 
wrote:
Team,

Consider I have domain model 
Bank
Customer's
Account's

Bank object will have many customers.
Every customer will have multiple accounts.

Consider I implement the above model using akka persistence. For the sake of 
discussion consider I make each as different Aggregate Roots using 
PersistentActor's.

I want to implement a query : Give my all customers whose balance is less then 
100$.

Do you mean,
1. Create one PersistentView XYZ.
2. This XYZ will listen from all 3 AR's.
3. PersistentView XYZ will replicate these events as state to some DB consider 
cassandra.
4. Client will query directly cassandra to find "all customers whose balance is 
less then 100$". 

Is my understanding correct?

Yes, maybe.
If you model each customer as a PersistentActor you have to setup one 
PersistentView for each customer, since currently a PersistentView instance can 
only consume events from one PersistentActor instance. Same thing with accounts.

We are currently discussing (in several threads) how we can improve 
PersistentView. Perhaps it should be able to consume events from several 
PersistentActors. Perhaps we should add another thing called topic, which 
PersistentActor can publish events to, and a PersistentView can consume events 
from. We don't know yet. We are collecting input.

Martin has also suggested that this type of scenario is better solved in the 
backend data store. In this case a program would transform the events in 
Cassandra by using Cassandra API:s and save another representation in Cassandra 
(or somewhere else). Clients can then query directly. No PersistentView 
involved.

/Patrik
 

If not, can you let me know how to achieve this using PersistentView?

-Prakhyat M M

On Tuesday, 19 August 2014 22:49:14 UTC+5:30, Martin Krasser wrote:

On 19.08.14 18:48, delasoul wrote:
As I am no Spark expert - will it be used only as kind of messaging(streaming) 
middleware to sync write and read store or also to somehow change/merge/
filter the events it gets/pulls from the write store

usually, to process (transform/aggregate/filter/...) these events.

or is this all done via the plugin for PersistentViews?
(I guess it has to be like this, otherwise using only one backend store cannot 
be supported?)

thanks,

michael

On Tuesday, 19 August 2014 17:48:16 UTC+2, Martin Krasser wrote:

On 19.08.14 17:41, Ashley Aitken wrote:


On Tuesday, 19 August 2014 19:33:55 UTC+8, Martin Krasser wrote:
If so, it sounds like a great solution but why would that require an extension 
to the Akka Persistence design/API?

Because transformed/joined/... event streams in backend store on the read side 
must be consumable by PersistentViews (for creating read models). I still see 
this backend store to maintain changes (= transformed/joined/... events) 
instead of current state.

I am sorry I still don't see this.

This suggests to me that spark is talking directly to the read model datastore 
(e.g. graph database, MongoDB, SQL database).

So are you suggesting: 

1. journal -> spark -> Akka actors (like PersistentView) -> read model data 
store 

or

2. journal -> spark -> read model data store (like graph database, MongoDb, SQL 
database) -> Akka actors <- Queries

I was suggesting 2.


I see PersistentView(for generalised topics) as the glue between the Akka 
journal (write store) and read stores (1.).

Thanks for your patience.

Cheers,
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].
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.

--  
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.

--  
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.



--
Patrik Nordwall
Typesafe -  Reactive apps on the JVM
Twitter: @patriknw

--
>>>>>>>>>> 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.
-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
>>>>>>>>>>      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.

Reply via email to