Ming
Ming

Reputation: 1693

Command Query Responsibility Segregation (CQRS) / Event Sourcing (ES): Why use it? How to address consistency issues?

I first heard about CQRS/ES in a ScalaDays San Francisco presentation some months ago. Since then, I have noticed occasional mentions of the terms in technical writing, most recently Fiverr's blog post on the topic.

It's seemed very interesting so far, but I have encountered a number of related issues, and I am wondering if there are any common solutions:

Moreover, what are some advantages of adopting this pattern, and how do they exceed the cost of the extra layer of complexity?

Thanks in advance!

Upvotes: 0

Views: 233

Answers (2)

Ming
Ming

Reputation: 1693

Additionally, here are some slides I recently found on the topic. They cover a lot more of the "why"/"why not" aspects from a team which used CQRS/ES in practice.

http://ookami86.github.io/event-sourcing-in-practice/

Upvotes: 0

Phil Sandler
Phil Sandler

Reputation: 28016

  • How do you deal with eventual consistency and potentially inconsistent views in the short term?

  • How do you deal with use cases where the user interface requires an immediate result to the request?

It is a common misconception that using Event Sourcing automatically implies an eventually consistent read model. Many ES practitioners (up to and including Udi Dahan and Greg Young) recommend starting with a synchronous, immediately consistent model and moving toward eventual consistency only when it is needed.

  • How do you deal with business logic which touches multiple resources a.k.a. atomic reads/writes a.k.a. transactions?

This is a complex question that doesn't have a single answer, and may be more appropriate for a discussion forum vs a Q/A forum like SO. I would recommend poking around (and posting) in the DDD/CQRS discussion group.

Upvotes: 4

Related Questions