Synchronous CQRS and Eventsourcing

543 views
Skip to first unread message

Matthias Kampen

unread,
Feb 4, 2011, 8:04:55 AM2/4/11
to ddd...@googlegroups.com
Hi all,

does it make sense to use event sourcing and CQRS in an application
which uses synchronous communication (in an environment without
scalability requirements for example)?

Would it be wrong to return a state-object back to the client after a
command has been processed?

What do you think?

Matthias

√iktor Klang

unread,
Feb 4, 2011, 8:07:46 AM2/4/11
to ddd...@googlegroups.com

How would that be a segregation of commands and queries?
 

What do you think?

Matthias



--
Viktor Klang,
Code Connoisseur
Work:   Scalable Solutions
Code:   github.com/viktorklang
Follow: twitter.com/viktorklang
Read:   klangism.tumblr.com

Rinat Abdullin

unread,
Feb 4, 2011, 8:58:44 AM2/4/11
to ddd...@googlegroups.com
I've done that in one Windows.Forms application. 

Application of CQRS to the task resembled a lot composite UI architecture with generic event pub/sub. It simplified a lot interactions between the controllers and UI, clarifying the design.

Primary difference from distributed CQRS - in-memory ConcurrentQueue (in case of .NET) instead of the service bus. Everything else was similar, with the same commands/events and view-per-screen element. Async UI became a lot simpler.


Best regards,
Rinat

On Fri, Feb 4, 2011 at 2:04 PM, Matthias Kampen <mkmailingl...@googlemail.com> wrote:

Matthias Kampen

unread,
Feb 4, 2011, 10:08:20 AM2/4/11
to ddd...@googlegroups.com
√iktor Klang wrote:
>
>
> On Fri, Feb 4, 2011 at 2:04 PM, Matthias Kampen
> <mkmailingl...@googlemail.com
> <mailto:mkmailingl...@googlemail.com>> wrote:
>
> Hi all,
>
> does it make sense to use event sourcing and CQRS in an application
> which uses synchronous communication (in an environment without
> scalability requirements for example)?
>
> Would it be wrong to return a state-object back to the client after
> a command has been processed?
>
>
> How would that be a segregation of commands and queries?

In order to show a certain screen, the client would still query a
read-only-query-database. But if a command could not be processed
because a business rule was violated, the command handler would return
an error message to the client.

Regards

Matthias

Greg Young

unread,
Feb 4, 2011, 10:18:28 AM2/4/11
to ddd...@googlegroups.com

Its common to return an ack/nak from a command

Rinat Abdullin

unread,
Feb 4, 2011, 10:24:29 AM2/4/11
to ddd...@googlegroups.com
IMHO, ack/nac are returned by the queue endpoint.

command handler (located in the other time and space continuum) returns processing result.

√iktor Klang

unread,
Feb 4, 2011, 11:28:54 AM2/4/11
to ddd...@googlegroups.com

So you don't mean 'State' but 'Status', then yes thats perfectly normal in my world.

On Feb 4, 2011 4:08 PM, "Matthias Kampen" <mkmailingl...@googlemail.com> wrote:

√iktor Klang wrote:

>
>
>
> On Fri, Feb 4, 2011 at 2:04 PM, Matthias Kampen
> <mkmailingl...@googlemail.com

> <mailto:mkmailingl...@googlemail.com>> wrote:
>
>    Hi all,
>

>    does it make sense to u...

Reply all
Reply to author
Forward
0 new messages