EventStore in RavenDB - dealing with query-only data?

133 views
Skip to first unread message

James Crowley

unread,
Jan 21, 2012, 5:08:57 AM1/21/12
to ddd...@googlegroups.com
Hi everyone,

I'm evaluating using an EventStore+CQRS model using RavenDB as the persistence mechanism for a project I'm working on - would appreciate your advice!

Given that our aggregates only store state from the events that are actually required for decision making - am I correct in thinking you that you'd then create separate documents in RavenDB (as opposed to some other data store) to represent the query side? Given RavenDBs eventual consistency here, is there much benefit in even using a message bus when processing events raised from modifying an aggregate root to update our query side? I'm basically trying to keep the complexity down for our initial build whilst keeping the flexibility there when we need the scalability. Would appreciate any thoughts - especially "don't even think about it!!" if that's appropriate!

If there are examples somewhere of this in action (I'm looking at the EventStore+Common Domain combo as a basis for now) then that would be brilliant.

Many thanks

James

Henrik Feldt

unread,
Jan 21, 2012, 6:34:47 AM1/21/12
to ddd...@googlegroups.com

Here’s an example of that: https://github.com/haf/Documently

 

RavenDB would be eventually consistent from two views:

1.       From the view of events being received by the read model after the domain service persisted them

2.       From the view of RavenDBs indexes being asynchronously updated in the background.

 

Cheers

James Crowley

unread,
Jan 24, 2012, 6:07:31 AM1/24/12
to ddd...@googlegroups.com
thanks Henrik, that's very helpful. Though as far as I can see, both your "App" and "WpfClient" processes are consuming the domain events and trying to write them to the same read/query store? Presumably you'd just have one "client" process per read store responsible for taking these and creating whichever denormalized views are required?

J
--

---
James Crowley
CTO, FundApps - a new generation in financial services software - http://www.fundapps.co/ 
Founder, developerFusion - the global developer community - http://www.developerfusion.com/

linkedin: http://linkedin.com/in/jamescrowley
twitter: http://twitter.com/jamescrowley

Jonathan Oliver

unread,
Jan 31, 2012, 2:45:29 PM1/31/12
to ddd...@googlegroups.com
James,

You would definitely want to have separate read/write stores.  On a minimum you can separate your code so that it talks to separate logical stores.  Then, at deployment, you can make a decision about whether or not to store the event streams and denormalized views int the same physical instance of Raven, much the same way you can have sets of unrelated tables in different SQL DBs or the same SQL DB.
Reply all
Reply to author
Forward
0 new messages