cqrs

Why are commands and events separately represented?

做~自己de王妃 提交于 2019-11-28 16:57:06
What is the difference between commands and events in architectures that emphasize events? The only distinction I can see is that commands are usually sourced/invoked by actors outside the system, whereas events seem to be sourced by handlers and other code in a system. However, in many example applications I have seen, they have different (but functionally similar) interfaces. Commands can be rejected. Events have happened. This is probably the most important reason. In an event-driven architecture, there can be no question that an event raised represents something that has happened . Now,

CQRS: Storing events and publishing them - how do I do this in a safe way?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 16:52:54
As I've learned in Why is the CQRS repository publishing events, not the event store? it's the CQRS repository's task to publish events. So far, so good. Of course, storing the events and publishing them should be within one single transaction. Technically this means writing one (or more) records to the store, and publishing one (or more) events to a message bus. Hence, a simple database transaction is not enough, it should be a distributed one. Now, unfortunately, many NoSQL databases (such as MongoDB) do not support ACID-compliant transactions, not even to talk of the possibility of taking

When to use the CQRS design pattern?

六眼飞鱼酱① 提交于 2019-11-28 16:25:34
问题 My team and I have been discussing using the CQRS (Command Query Responsibility Segregation) design pattern and we are still trying to asses the pros and cons of using it. According to: http://martinfowler.com/bliki/CQRS.html we haven't seen enough uses of CQRS in the field yet to be confident that we understand its pros and cons So what do you guys think, when does a problem call for using CQRS? 回答1: CQRS is not a pattern that encompasses the whole application. It is a concept that builds on

Event Sourcing Resources [closed]

白昼怎懂夜的黑 提交于 2019-11-28 16:19:36
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Looking for some suggestions for useful discussion groups, articles, success stories, reference apps, and tooling (.Net) on the

Domain queries in CQRS

前提是你 提交于 2019-11-28 15:44:50
We are trying out CQRS . We have a validation situation where a CustomerService (domain service) needs to know whether or not a Customer exists. Customers are unique by their email address. Our Customer repository (a generic repository) only has Get(id) and Add(customer). How should the CustomerService find out if the Customer exists? Kevin Swiber Take a look at this blog post: Set based validation in the CQRS Architecture . It addresses this very issue. It's a complex issue to deal with in CQRS. What Bjarte is suggesting is to query the reporting database for existing Customer e-mail

What is the difference between a saga, a process manager and a document-based approach?

怎甘沉沦 提交于 2019-11-28 15:30:40
问题 What I understand is that all three concepts are related to long-running transactions. A process manager is, to my understanding, a finite state machine which simply reacts on events and emits commands. It does not contain any business logic, it just does routing. Its goal is to bring you to a final state, where you know that your transaction has succeeded or failed. So far, so good. But now my problems in understand start: What is a saga in contrast to a process manager? There is also the

Domain Validation in a CQRS architecture

你说的曾经没有我的故事 提交于 2019-11-28 15:18:09
Danger ... Danger Dr. Smith... Philosophical post ahead The purpose of this post is to determine if placing the validation logic outside of my domain entities (aggregate root actually) is actually granting me more flexibility or it's kamikaze code Basically I want to know if there is a better way to validate my domain entities. This is how I am planning to do it but I would like your opinion The first approach I considered was: class Customer : EntityBase<Customer> { public void ChangeEmail(string email) { if(string.IsNullOrWhitespace(email)) throw new DomainException(“...”); if(!email.IsEmail

CQRS Examples and Screencasts [closed]

前提是你 提交于 2019-11-28 14:59:29
I'm looking for some in depth end-to-end CQRS examples with a reasonable set of unit tests. Also, if anyone knows of some CQRS screencasts as well it would be extremely handy. I'm already aware of these examples CQRS Info Super Simple CQRS There's a implementation here MarkNijhof . But after reading the documents from the CQRS Info site my favourite resource is Think Before Coding look at the post Tags. ( http://thinkbeforecoding.com/ ) Some other useful resources... http://distributedpodcast.com/ http://www.udidahan.com/ http://abdullin.com/ Microsoft patterns & practices is working on a

CQRS and Event Sourcing in Java with Spring Framework

最后都变了- 提交于 2019-11-28 09:38:18
Recently I have had the opportunity to delve deep in to the world of Event Sourcing and CQRS for a modernization project where we are refactoring a 1M LOC a decade old classic java application that does more than a billion dollars of revenue across multiple lines of business. If you have to embark on a similar journey these are the resources I found useful: 1. DDD Distilled : This is the best summary of the classic Eric Evan's DDD book and Vernon's iDDD book. There is also a more practical Tools and Techniques section which summarizes Event Storming technique very well. We used a 3 day event

Using an RDBMS as event sourcing storage

泪湿孤枕 提交于 2019-11-28 02:37:41
If I were using an RDBMS (e.g. SQL Server) to store event sourcing data, what might the schema look like? I've seen a few variations talked about in an abstract sense, but nothing concrete. For example, say one has a "Product" entity, and changes to that product could come in the form of: Price, Cost and Description. I'm confused about whether I'd: Have a "ProductEvent" table, that has all the fields for a product, where each change means a new record in that table, plus "who, what, where, why, when and how" as appropriate. When cost, price or description are changed, a whole new row as added