CQRS without Event Sourcing - what are the drawbacks?

前端 未结 6 1645
渐次进展
渐次进展 2021-01-30 21:04

Besides missing some of the benefits of Event Sourcing, are there any other drawbacks to adapting an existing architecture to CQRS without the Event Sourcing piece?

I\'m

6条回答
  •  抹茶落季
    2021-01-30 21:35

    In my opinion, you're making a big mistake by not using event sourcing with CQRS.

    First up, you'll almost certainly have issues synchronising your Query model with the Command model. With an event store, if the query side ever gets out of synch, you simply need to replay your events to correct it. That's the theory anyway!

    But with Event Sourcing, you also get to store the complete history of all entity transactions. And this means you can decide to create new queries and views after implementation. These are very often views that would not be possible with non-Event Sourced CQRS. I've heard Greg Young give the example of querying items that have been added, and then removed, from a shopping cart. With Event Sourcing this is possible. Without ES it's not possible because you only store the final state of the cart.

提交回复
热议问题