You might also check this article on the timing and race conditions:
http://www.udidahan.com/2010/08/31/race-conditions-dont-exist/
Best regards,
Rinat Abdullin
Technology Leader at Lokad.com | Writer at Abdullin.com | Contacts
You don't need an,immediate record really do you. Can't you just fake the record client side....... once the command succeeds.
In other words, it just takes a bit longer for the command to be successful.
Cheers,
-- Udi Dahan
In my case, at the moment, the submitting of a command is syncronous into the event store so its guaranteed to have worked. If you go asynchronous then there's some other considerations but my feeling is commands need a success / failure results soon as possible after submission but my systems apply a lot of workflow / state related business rules and commands can be sent in via web services. I have to plan for command failure for business reasons.
Cheers,
-- Udi Dahan
-----Original Message-----
From: ddd...@googlegroups.com [mailto:ddd...@googlegroups.com] On Behalf
Of SteveG
Sent: Monday, September 06, 2010 9:58 PM
To: DDD/CQRS
Subject: [DDD/CQRS] Re: Using the read model as a means for providing
instant updates to the user
> If a command fails downstream, it is usually for "environmental" reasons (DB
> or some web service was down) and not due to a logical failure.
I'm a but confused. If all you do is basic command validation, how can the system downstream only occasionally fails?
I mean I understand that trivial rule checks that can be made by a four year old, like checking the account balance before submitting but most of the systems I work with is not the case. Well maybe picking one rule as an example would work, but what makes it complex is not one or two rules, but the number of them.
For instance, take a game of chess. I could validate if the move is valid in the UI, after all considering one kind of piece the rule is quite simple. But considering the multiple types of pieces on the board, implementing them on the UI wouldn't just defat the purpose of having a domain model bellow?
Nuno
We're not talking about "implementing them on the UI", but rather deploying
them in a way that is accessible client-side.
Cheers,
-- Udi Dahan
-----Original Message-----
From: ddd...@googlegroups.com [mailto:ddd...@googlegroups.com] On Behalf
Of Nuno Lopes
Sent: Monday, September 06, 2010 10:49 PM
To: ddd...@googlegroups.com
Subject: Re: [DDD/CQRS] Re: Using the read model as a means for providing
instant updates to the user
Can you give is an example about how that is done beyond the trivial.
I mean against what data would that logic be used? If it is against the read part, considering that is de-normalized how is it served to these Procs/Specs?
Considering that such Procs/Specs are reused on the server side, how are aggregates turned into something for consumption by these Procs/Specs?
Nuno
Hello,
In our circular architecture, I've been using websockets so that the
browser client is also listening to some events, and can update state
accordingly.
I think it makes things richer and easier for the client, placing the
web UI as another listener with its own javascript event handlers.
Instead of persisting commands in a different way associated with my
event store, I actually have CommandReceived and CommandProcessed as
events also. With these events, and the actual target event of
interset (such as OrderCreated), I've implemented generic widgets for
showing progress in the UI.
Would that qualify as a sound solution for you?
(cheers)
"Your claim hasn't been approved yet - when it will be approved, you'll see
your balance reflect that"
On the balance page, you'll likely show the series of transactions that
brought it to that state, and the newest claim won't appear in that list.
You can also include a statement saying that "transactions may take up to an
hour to appear on this page". This historically was the product of
batch-based integration between disparate systems but users have already
gotten used to it, so why not exploit that.
Cheers,
-- Udi Dahan
-----Original Message-----
From: ddd...@googlegroups.com [mailto:ddd...@googlegroups.com] On Behalf
Of SteveG
Sent: Wednesday, September 08, 2010 1:00 AM
To: DDD/CQRS
Subject: [DDD/CQRS] Re: Using the read model as a means for providing
instant updates to the user
The data used to perform that client-side logic would come from the
persistent view model. The fact that that is denomralized isn't relevant -
the structure of the data held there is designed to be suited to these kinds
of client-side queries.
However, these queries aren't "reused" on the server side, the only reason
to do that would be because we don't trust clients. The way that that is
handled is to have all commands from un-trusted clients be piped through our
own trusted client which performs those checks, and only if they pass does
it let them through to our server.
Cheers,
-- Udi Dahan
-----Original Message-----
From: ddd...@googlegroups.com [mailto:ddd...@googlegroups.com] On Behalf
Of Nuno Lopes
Sent: Tuesday, September 07, 2010 1:58 AM
To: ddd...@googlegroups.com
Subject: Re: [DDD/CQRS] Re: Using the read model as a means for providing
instant updates to the user
After a user finishes working on a ticket - sending a command CloseTicket,
the system then stores that that user is free for another ticket and decides
which ticket to allocate to which user. This removes the competitive nature
of the domain and doesn't require high synchronization between users any
more. As such, the list of open tickets no longer needs to be very up to
date as it is primarily a report for supervisors. We can also have the
system flag tickets that haven't been resolved by a certain period of time,
automatically escalating them to supervisors.
In short, don't force fit CQRS into a given system definition. CQRS is
*part* of the system definition.
Cheers,
-- Udi Dahan
-----Original Message-----
From: ddd...@googlegroups.com [mailto:ddd...@googlegroups.com] On Behalf
Of Polemann
Sent: Tuesday, September 07, 2010 12:11 AM
To: DDD/CQRS
Subject: [DDD/CQRS] Re: Using the read model as a means for providing
instant updates to the user
By the way, does anybody contest the need for domain and technical events? I guess not, because a lot of applications already work with technical (logging) events. But if anybody has a different view on this, I'd like to hear it..
Regards,
Rick
---
Verzonden vanaf een mobiele telefoon
Op 8 sep 2010 01:26 schreef "Pedro Teixeira" <ped...@gmail.com>:
On Sep 7, 6:59 pm, SteveG <steven.gent...@gmail.com> wrote:
> My customers say 'I entered a claim, w...
Thank you for your feedback.
> However, these queries aren't "reused" on the server side, the only reason
> to do that would be because we don't trust clients. The way that that is
> handled is to have all commands from un-trusted clients be piped through our
> own trusted client which performs those checks, and only if they pass does
> it let them through to our server.
That is what we do here for about 5 years with no CQRS, so I was expecting an improvement. You see, we use MVC on the Web and we developed our own UI framework.
1) We do simple validation on the web browser (simple mandatory logic based on what is selected)
2) On the web server we have what we call a View Model. In this model we store more then is presented to to deeper validations.
3) When everything is valid we then send these data to a façade that call the web services. Each of these web service the can use a domain model bellow or whatever. When things get slow, we just reference the "domain model" dll directely.
In most cases we don't call web services in as synch.
I believe that sometimes are my expectations over CQRS that cloud my reasoning over what is written. This architecture comes with its own overhead.
What I think is that CQRS on top of a Messaging BUS is what makes this thing scale better then what we already do. Because as far how data flows is more or less the same.
Furthermore, I think Aggregates play a major part on it too.
Cheers,
Nuno
PS: How "commands" (web service calls) do fail
> This removes the competitive nature
> of the domain and doesn't require high synchronization between users any
> more.
+1. You can learn a lot about turn based games such as Chess.
Nuno
PS: Maybe at least one person will understand this drift.